Rename CANNOT_DUMP to HAVE_UNEXEC
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 1 Feb 2019 21:03:18 +0000 (13:03 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 1 Feb 2019 21:05:39 +0000 (13:05 -0800)
* configure.ac (CANNOT_DUMP): Remove.  All uses removed,
or changed to the negative of with_unexec.
(HAVE_UNEXEC): New macro.  All uses of CANNOT_DUMP changed
to the negative of this macro.

13 files changed:
configure.ac
etc/DEBUG
lisp/loadup.el
src/alloc.c
src/conf_post.h
src/emacs.c
src/image.c
src/lastfile.c
src/lisp.h
src/term.c
src/timefns.c
src/unexcoff.c
src/w32heap.c

index 40be0859aaa4c780745ce880b9ca86b3d974fce0..ff745eca1a5a80221b89d8da894269b2b5255a00 100644 (file)
@@ -382,15 +382,8 @@ if test "$with_pdumper" = "yes"; then
     AC_DEFINE(HAVE_PDUMPER, 1, [Define to build with portable dumper support])
 fi
 
-if test "$with_unexec" = "yes"; then
-  CANNOT_DUMP=no
-else
-  CANNOT_DUMP=yes
-fi
-
 DUMPING=$with_dumping
 AC_SUBST(DUMPING)
-AC_SUBST(CANNOT_DUMP)
 
 dnl FIXME currently it is not the last.
 dnl This should be the last --with option, because --with-x is
@@ -1314,7 +1307,7 @@ AC_SUBST([FIND_DELETE])
 
 PAXCTL_dumped=
 PAXCTL_notdumped=
-if test "$CANNOT_DUMP" = "no" && test $opsys = gnu-linux; then
+if test $with_unexec = yes && test $opsys = gnu-linux; then
   if test "${SETFATTR+set}" != set; then
     AC_CACHE_CHECK([for setfattr],
       [emacs_cv_prog_setfattr],
@@ -1434,7 +1427,7 @@ else
 fi
 
 AC_CACHE_CHECK([for -znocombreloc], [emacs_cv_znocombreloc],
-  [if test "$CANNOT_DUMP" = "yes"; then
+  [if test $with_unexec = no; then
      emacs_cv_znocombreloc='not needed'
    else
      save_LDFLAGS=$LDFLAGS
@@ -1465,13 +1458,16 @@ AC_CACHE_CHECK([whether addresses are sanitized],
      [emacs_cv_sanitize_address=yes],
      [emacs_cv_sanitize_address=no])])
 
-if test "$CANNOT_DUMP" = "yes"; then
-  AC_DEFINE(CANNOT_DUMP, 1, [Define if Emacs should not support unexec.])
-elif test "$emacs_cv_sanitize_address" = yes; then
-  AC_MSG_WARN([[Addresses are sanitized; suggest CANNOT_DUMP=yes]])
+if test $with_unexec = yes; then
+  AC_DEFINE([HAVE_UNEXEC], 1, [Define if Emacs supports unexec.])
+  if test "$emacs_cv_sanitize_address" = yes; then
+    AC_MSG_WARN([[Addresses are sanitized; suggest --without-unexec]])
+  fi
 fi
 
-UNEXEC_OBJ=unexelf.o
+
+UNEXEC_OBJ=
+test $with_unexec = yes &&
 case "$opsys" in
   # MSDOS uses unexcoff.o
   aix4-2)
@@ -1499,8 +1495,10 @@ case "$opsys" in
    # not been tested, so for now this change is for Solaris 10 or newer.
    UNEXEC_OBJ=unexsol.o
    ;;
+  *)
+   UNEXEC_OBJ=unexelf.o
+   ;;
 esac
-test "$CANNOT_DUMP" = "yes" && UNEXEC_OBJ=
 
 LD_SWITCH_SYSTEM=
 test "$with_unexec" = no || case "$opsys" in
@@ -1551,7 +1549,7 @@ esac
 
 C_SWITCH_MACHINE=
 
-test "$CANNOT_DUMP" = yes ||
+test $with_unexec = yes &&
 case $canonical in
  alpha*)
   AC_CHECK_DECL([__ELF__])
@@ -2310,7 +2308,7 @@ doug_lea_malloc=$emacs_cv_var_doug_lea_malloc
 hybrid_malloc=
 system_malloc=yes
 
-test "$CANNOT_DUMP" = yes ||
+test $with_unexec = yes &&
 case "$opsys" in
   ## darwin ld insists on the use of malloc routines in the System framework.
   darwin | mingw32 | nacl | sol2-10) ;;
@@ -5440,7 +5438,7 @@ esac
 AC_CACHE_CHECK(
   [for $CC option to disable position independent executables],
   [emacs_cv_prog_cc_no_pie],
-  [if test "$CANNOT_DUMP" = yes; then
+  [if test $with_unexec = no; then
      emacs_cv_prog_cc_no_pie='not needed'
    else
      emacs_save_c_werror_flag=$ac_c_werror_flag
@@ -5552,10 +5550,9 @@ emacs_config_features=
 for opt in XAW3D XPM JPEG TIFF GIF PNG RSVG CAIRO IMAGEMAGICK SOUND GPM DBUS \
   GCONF GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT \
   LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS X_TOOLKIT OLDXMENU X11 XDBE XIM \
-  NS MODULES THREADS XWIDGETS LIBSYSTEMD JSON CANNOT_DUMP LCMS2 GMP; do
+  NS MODULES THREADS XWIDGETS LIBSYSTEMD JSON LCMS2 GMP; do
 
     case $opt in
-      CANNOT_DUMP) eval val=\${$opt} ;;
       GLIB) val=${emacs_cv_links_glib} ;;
       NOTIFY|ACL) eval val=\${${opt}_SUMMARY} ;;
       TOOLKIT_SCROLL_BARS|X_TOOLKIT) eval val=\${USE_$opt} ;;
index 21097ccdf4b39b17299cca20e5989edc366343f6..d401d0be901f1b996e5b43d4de84408819f27dac 100644 (file)
--- a/etc/DEBUG
+++ b/etc/DEBUG
@@ -936,7 +936,7 @@ its own versions, and because the dumping process might be
 incompatible with the way these packages use to track allocated
 memory.  Here are some of the changes you might find necessary:
 
-  - Edit configure, to set system_malloc and CANNOT_DUMP to "yes".
+  - Make sure unexec is disabled, e.g., './configure --without-unexec'.
 
   - Configure with a different --prefix= option.  If you use GCC,
     version 2.7.2 is preferred, as some malloc debugging packages
index 747476c5067595c87eeee871dbafbbb8443c5b4f..67e8aa7d40a04a5b32725582d8879138c4cce700 100644 (file)
@@ -526,8 +526,7 @@ lost after dumping")))
                                 t))))
       (kill-emacs)))
 
-;; For machines with CANNOT_DUMP defined in config.h,
-;; this file must be loaded each time Emacs is run.
+;; This file must be loaded each time Emacs is run from scratch, e.g., temacs.
 ;; So run the startup code now.  First, remove `-l loadup' from args.
 
 (if (and (member (nth 1 command-line-args) '("-l" "--load"))
index 5ea466becaebd7982a5b7ed98f8568661f46284c..a0d0a611346308fd569b503a7228ad9384369d36 100644 (file)
@@ -168,7 +168,7 @@ voidfuncptr __MALLOC_HOOK_VOLATILE __malloc_initialize_hook EXTERNALLY_VISIBLE
 
 #endif
 
-#if defined DOUG_LEA_MALLOC || !defined CANNOT_DUMP
+#if defined DOUG_LEA_MALLOC || defined HAVE_UNEXEC
 
 /* Allocator-related actions to do just before and after unexec.  */
 
@@ -502,11 +502,11 @@ static struct mem_node *mem_find (void *);
 #endif
 
 /* Addresses of staticpro'd variables.  Initialize it to a nonzero
-   value if we might dump; otherwise some compilers put it into
+   value if we might unexec; otherwise some compilers put it into
    BSS.  */
 
 Lisp_Object *staticvec[NSTATICS]
-#ifndef CANNOT_DUMP
+#ifdef HAVE_UNEXEC
 = {&Vpurify_flag}
 #endif
   ;
@@ -1192,9 +1192,9 @@ verify (POWER_OF_2 (BLOCK_ALIGN));
 
 /* Use aligned_alloc if it or a simple substitute is available.
    Aligned allocation is incompatible with unexmacosx.c, so don't use
-   it on Darwin unless CANNOT_DUMP.  */
+   it on Darwin if HAVE_UNEXEC.  */
 
-#if !defined DARWIN_OS || defined CANNOT_DUMP
+#if ! (defined DARWIN_OS && defined HAVE_UNEXEC)
 # if (defined HAVE_ALIGNED_ALLOC                                       \
       || (defined HYBRID_MALLOC                                                \
          ? defined HAVE_POSIX_MEMALIGN                                 \
@@ -5390,7 +5390,7 @@ pure_alloc (size_t size, int type)
 }
 
 
-#ifndef CANNOT_DUMP
+#ifdef HAVE_UNEXEC
 
 /* Print a warning if PURESIZE is too small.  */
 
index 125dbf0152828dc6f992969fa6b98cebb0a5e992..f8254cfa9df8dd0c919ac8877b03f85b9d5fb115 100644 (file)
@@ -92,13 +92,11 @@ typedef bool bool_bf;
 # define ADDRESS_SANITIZER false
 #endif
 
-#ifdef DARWIN_OS
-#if defined emacs && !defined CANNOT_DUMP
-#define malloc unexec_malloc
-#define realloc unexec_realloc
-#define free unexec_free
+#if defined DARWIN_OS && defined emacs && defined HAVE_UNEXEC
+# define malloc unexec_malloc
+# define realloc unexec_realloc
+# define free unexec_free
 #endif
-#endif  /* DARWIN_OS */
 
 /* If HYBRID_MALLOC is defined (e.g., on Cygwin), emacs will use
    gmalloc before dumping and the system malloc after dumping.
index d6b8a87c72353f6d53f3e17816272f7110fea4c8..ff814a149b31f76737d1d6299b983b01058c4d5c 100644 (file)
@@ -149,7 +149,7 @@ bool running_asynch_code;
 bool display_arg;
 #endif
 
-#if defined GNU_LINUX && !defined CANNOT_DUMP
+#if defined GNU_LINUX && defined HAVE_UNEXEC
 /* The gap between BSS end and heap start as far as we can tell.  */
 static uprintmax_t heap_bss_diff;
 #endif
@@ -868,7 +868,7 @@ main (int argc, char **argv)
      can set heap flags properly if we're going to unexec.  */
   if (!initialized && temacs)
     {
-#ifndef CANNOT_DUMP
+#ifdef HAVE_UNEXEC
       if (strcmp (temacs, "dump") == 0 ||
           strcmp (temacs, "bootstrap") == 0)
         gflags.will_dump_with_unexec_ = true;
@@ -878,7 +878,7 @@ main (int argc, char **argv)
           strcmp (temacs, "pbootstrap") == 0)
         gflags.will_dump_with_pdumper_ = true;
 #endif
-#if defined (HAVE_PDUMPER) || !defined (CANNOT_DUMP)
+#if defined HAVE_PDUMPER || defined HAVE_UNEXEC
       if (strcmp (temacs, "bootstrap") == 0 ||
           strcmp (temacs, "pbootstrap") == 0)
         gflags.will_bootstrap_ = true;
@@ -904,7 +904,7 @@ main (int argc, char **argv)
 #endif
     }
 
-#ifndef CANNOT_DUMP
+#ifdef HAVE_UNEXEC
   if (!will_dump_with_unexec_p ())
     gflags.will_not_unexec_ = true;
 #endif
@@ -953,7 +953,7 @@ main (int argc, char **argv)
   argc = maybe_disable_address_randomization (
     will_dump_with_unexec_p (), argc, argv);
 
-#if defined (GNU_LINUX) && !defined (CANNOT_DUMP)
+#if defined GNU_LINUX && defined HAVE_UNEXEC
   if (!initialized)
     {
       char *heap_start = my_heap_start ();
@@ -967,7 +967,7 @@ main (int argc, char **argv)
 #endif
 
 /* If using unexmacosx.c (set by s/darwin.h), we must do this. */
-#if defined DARWIN_OS && !defined CANNOT_DUMP
+#if defined DARWIN_OS && defined HAVE_UNEXEC
   if (!initialized)
     unexec_init_emacs_zone ();
 #endif
@@ -1445,7 +1445,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
       /* Call syms_of_keyboard before init_window_once because
         keyboard sets up symbols that include some face names that
         the X support will want to use.  This can happen when
-        CANNOT_DUMP is defined.  */
+        Emacs starts up from scratch (e.g., temacs).  */
       syms_of_keyboard ();
 
       /* Called before syms_of_fileio, because it sets up Qerror_condition.  */
@@ -2378,7 +2378,7 @@ shut_down_emacs (int sig, Lisp_Object stuff)
 
 
 \f
-#ifndef CANNOT_DUMP
+#ifdef HAVE_UNEXEC
 
 #include "unexec.h"
 
@@ -2405,10 +2405,10 @@ You must run Emacs in batch mode in order to dump it.  */)
   if (definitely_will_not_unexec_p ())
     error ("This Emacs instance was not started in temacs mode");
 
-#if defined GNU_LINUX && !defined CANNOT_DUMP
+# if defined GNU_LINUX && defined HAVE_UNEXEC
 
   /* Warn if the gap between BSS end and heap start is larger than this.  */
-# define MAX_HEAP_BSS_DIFF (1024*1024)
+#  define MAX_HEAP_BSS_DIFF (1024 * 1024)
 
   if (heap_bss_diff > MAX_HEAP_BSS_DIFF)
     {
@@ -2421,7 +2421,7 @@ You must run Emacs in batch mode in order to dump it.  */)
       fprintf (stderr, "exec-shield in etc/PROBLEMS for more information.\n");
       fprintf (stderr, "**************************************************\n");
     }
-#endif /* GNU_LINUX */
+# endif
 
   /* Bind `command-line-processed' to nil before dumping,
      so that the dumped Emacs will process its command line
@@ -2445,7 +2445,7 @@ You must run Emacs in batch mode in order to dump it.  */)
   tem = Vpurify_flag;
   Vpurify_flag = Qnil;
 
-#ifdef HYBRID_MALLOC
+# ifdef HYBRID_MALLOC
   {
     static char const fmt[] = "%d of %d static heap bytes used";
     char buf[sizeof fmt + 2 * (INT_STRLEN_BOUND (int) - 2)];
@@ -2454,18 +2454,16 @@ You must run Emacs in batch mode in order to dump it.  */)
     /* Don't log messages, because at this point buffers cannot be created.  */
     message1_nolog (buf);
   }
-#endif
+# endif
 
   fflush_unlocked (stdout);
   /* Tell malloc where start of impure now is.  */
   /* Also arrange for warnings when nearly out of space.  */
-#if !defined SYSTEM_MALLOC && !defined HYBRID_MALLOC
-#ifndef WINDOWSNT
+# if !defined SYSTEM_MALLOC && !defined HYBRID_MALLOC && !defined WINDOWSNT
   /* On Windows, this was done before dumping, and that once suffices.
      Meanwhile, my_edata is not valid on Windows.  */
   memory_warnings (my_edata, malloc_warning);
-#endif /* not WINDOWSNT */
-#endif /* not SYSTEM_MALLOC and not HYBRID_MALLOC */
+# endif
 
   struct gflags old_gflags = gflags;
   gflags.will_dump_ = false;
@@ -2480,19 +2478,19 @@ You must run Emacs in batch mode in order to dump it.  */)
 
   gflags = old_gflags;
 
-#ifdef WINDOWSNT
+# ifdef WINDOWSNT
   Vlibrary_cache = Qnil;
-#endif
-#ifdef HAVE_WINDOW_SYSTEM
+# endif
+# ifdef HAVE_WINDOW_SYSTEM
   reset_image_types ();
-#endif
+# endif
 
   Vpurify_flag = tem;
 
   return unbind_to (count, Qnil);
 }
 
-#endif /* not CANNOT_DUMP */
+#endif
 
 \f
 #if HAVE_SETLOCALE
@@ -2781,7 +2779,7 @@ syms_of_emacs (void)
   DEFSYM (Qkill_emacs, "kill-emacs");
   DEFSYM (Qkill_emacs_hook, "kill-emacs-hook");
 
-#ifndef CANNOT_DUMP
+#ifdef HAVE_UNEXEC
   defsubr (&Sdump_emacs);
 #endif
 
index 20148605817777a791f69a2a65b18ef35741524c..57bbf3cdb9365c6f0ca84c6da69f65e14436aee8 100644 (file)
@@ -10003,7 +10003,7 @@ lookup_image_type (Lisp_Object type)
   return NULL;
 }
 
-#if !defined CANNOT_DUMP && defined HAVE_WINDOW_SYSTEM
+#if defined HAVE_UNEXEC && defined HAVE_WINDOW_SYSTEM
 
 /* Reset image_types before dumping.
    Called from Fdump_emacs.  */
index 706f667dbb93ad337a74059eda4d21020fc207fb..bcaf105a51b14c5f47939bb833c01cb002fd0eef 100644 (file)
@@ -43,7 +43,7 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 char my_edata[] = "End of Emacs initialized data";
 #endif
 
-#ifndef CANNOT_DUMP
+#ifdef HAVE_UNEXEC
 
 /* Help unexec locate the end of the .bss area used by Emacs (which
    isn't always a separate section in NT executables).  */
index 5a0de4b12c73b1b3f6001860e218a626483bb023..3b481089cfd9bc1ee3f0fc6ebc436ff4c72f2eae 100644 (file)
@@ -633,11 +633,11 @@ extern bool initialized;
 
 extern struct gflags {
   /* True means this Emacs instance was born to dump.  */
-#if defined (HAVE_PDUMPER) || !defined (CANNOT_DUMP)
+#if defined HAVE_PDUMPER || defined HAVE_UNEXEC
   bool will_dump_ : 1;
   bool will_bootstrap_ : 1;
 #endif
-#if defined (HAVE_PDUMPER)
+#ifdef HAVE_PDUMPER
   /* Set in an Emacs process that will likely dump with pdumper; all
      Emacs processes may dump with pdumper, however.  */
   bool will_dump_with_pdumper_ : 1;
@@ -645,7 +645,7 @@ extern struct gflags {
      dump.  */
   bool dumped_with_pdumper_ : 1;
 #endif
-#ifndef CANNOT_DUMP
+#ifdef HAVE_UNEXEC
   bool will_dump_with_unexec_ : 1;
   /* Set in an Emacs process that has been restored from an unexec
      dump.  */
@@ -658,7 +658,7 @@ extern struct gflags {
 INLINE bool
 will_dump_p (void)
 {
-#if HAVE_PDUMPER || !defined (CANNOT_DUMP)
+#if HAVE_PDUMPER || defined HAVE_UNEXEC
   return gflags.will_dump_;
 #else
   return false;
@@ -668,7 +668,7 @@ will_dump_p (void)
 INLINE bool
 will_bootstrap_p (void)
 {
-#if HAVE_PDUMPER || !defined (CANNOT_DUMP)
+#if HAVE_PDUMPER || defined HAVE_UNEXEC
   return gflags.will_bootstrap_;
 #else
   return false;
@@ -698,20 +698,20 @@ dumped_with_pdumper_p (void)
 INLINE bool
 will_dump_with_unexec_p (void)
 {
-#ifdef CANNOT_DUMP
-  return false;
-#else
+#ifdef HAVE_UNEXEC
   return gflags.will_dump_with_unexec_;
+#else
+  return false;
 #endif
 }
 
 INLINE bool
 dumped_with_unexec_p (void)
 {
-#ifdef CANNOT_DUMP
-  return false;
-#else
+#ifdef HAVE_UNEXEC
   return gflags.dumped_with_unexec_;
+#else
+  return false;
 #endif
 }
 
@@ -721,10 +721,10 @@ dumped_with_unexec_p (void)
 INLINE bool
 definitely_will_not_unexec_p (void)
 {
-#ifdef CANNOT_DUMP
-  return true;
-#else
+#ifdef HAVE_UNEXEC
   return gflags.will_not_unexec_;
+#else
+  return true;
 #endif
 }
 
@@ -3032,7 +3032,7 @@ CHECK_INTEGER (Lisp_Object x)
 /* If we're not dumping using the legacy dumper and we might be using
    the portable dumper, try to bunch all the subr structures together
    for more efficient dump loading.  */
-#ifdef CANNOT_DUMP
+#ifndef HAVE_UNEXEC
 # ifdef DARWIN_OS
 #  define SUBR_SECTION_ATTRIBUTE ATTRIBUTE_SECTION ("__DATA,subrs")
 # else
@@ -4135,7 +4135,7 @@ Lisp_Object backtrace_top_function (void);
 extern bool let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol);
 
 /* Defined in unexmacosx.c.  */
-#if defined DARWIN_OS && !defined CANNOT_DUMP
+#if defined DARWIN_OS && defined HAVE_UNEXEC
 extern void unexec_init_emacs_zone (void);
 extern void *unexec_malloc (size_t);
 extern void *unexec_realloc (void *, size_t);
index c5a1fb99a15411109c28914d9f4acaf3d240c9e9..7255f561e2a46beb95e51a26fea19c073a38296e 100644 (file)
@@ -1350,7 +1350,8 @@ term_get_fkeys_1 (void)
   char **address = term_get_fkeys_address;
   KBOARD *kboard = term_get_fkeys_kboard;
 
-  /* This can happen if CANNOT_DUMP or with strange options.  */
+  /* This can happen if Emacs is starting up from scratch, or with
+     strange options.  */
   if (!KEYMAPP (KVAR (kboard, Vinput_decode_map)))
     kset_input_decode_map (kboard, Fmake_sparse_keymap (Qnil));
 
index ce1f4d3f5a93594fe37fbf0d24c4e881c9ac7784..7e061228e2ce1c495f5e9bbf9579f301f41d5eab 100644 (file)
@@ -294,7 +294,7 @@ tzlookup (Lisp_Object zone, bool settz)
 void
 init_timefns (void)
 {
-#ifndef CANNOT_DUMP
+#ifdef HAVE_UNEXEC
   /* A valid but unlikely setting for the TZ environment variable.
      It is OK (though a bit slower) if the user chooses this value.  */
   static char dump_tz_string[] = "TZ=UtC0";
@@ -311,7 +311,7 @@ init_timefns (void)
 
   char *tz = getenv ("TZ");
 
-#if !defined CANNOT_DUMP
+#ifdef HAVE_UNEXEC
   /* If the execution TZ happens to be the same as the dump TZ,
      change it to some other value and then change it back,
      to force the underlying implementation to reload the TZ info.
index 6e90c0628d2a93e39b2b0386f0ce9121d07da7ae..220ce709df90b7b036d7e200ffbfd8d88fb6643e 100644 (file)
@@ -56,7 +56,7 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #define PERROR(file) report_error (file, new)
 
-#ifndef CANNOT_DUMP  /* all rest of file!  */
+#ifdef HAVE_UNEXEC  /* all rest of file!  */
 
 #ifdef HAVE_COFF_H
 #include <coff.h>
@@ -538,4 +538,4 @@ unexec (const char *new_name, const char *a_name)
     emacs_close (a_out);
 }
 
-#endif /* not CANNOT_DUMP */
+#endif /* HAVE_UNEXEC */
index 8a2c1b5877b3174149b2f7fe660ef72cae4474f0..9a59a1f0758e910cc86eb8fa2b933e41fce9f3f2 100644 (file)
@@ -115,9 +115,9 @@ typedef struct _RTL_HEAP_PARAMETERS {
    than half of the size stated below.  It would be nice to find a way
    to build only the first bootstrap-emacs.exe with the large size,
    and reset that to a lower value afterwards.  */
-#ifdef CANNOT_DUMP
-/* We don't use dumped_data[] when CANNOT_DUMP, so define to a small
-   size that won't matter.  */
+#ifndef HAVE_UNEXEC
+/* We don't use dumped_data[], so define to a small size that won't
+   matter.  */
 # define DUMPED_HEAP_SIZE 10
 #else
 # if defined _WIN64 || defined WIDE_EMACS_INT
@@ -597,7 +597,7 @@ free_after_dump_9x (void *ptr)
     }
 }
 
-#if !defined (CANNOT_DUMP) && defined (ENABLE_CHECKING)
+#if defined HAVE_UNEXEC && defined ENABLE_CHECKING
 void
 report_temacs_memory_usage (void)
 {