aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2019-02-01 13:03:18 -0800
committerPaul Eggert2019-02-01 13:05:39 -0800
commit3b69e02a248c8b46223d5a9cecfb2494992e5fbe (patch)
tree22eca8d283fb1ea9aef90f5529260803e95dc266
parent84802b66197c623735aaca875b8e1a39cb0ef085 (diff)
downloademacs-3b69e02a248c8b46223d5a9cecfb2494992e5fbe.tar.gz
emacs-3b69e02a248c8b46223d5a9cecfb2494992e5fbe.zip
Rename CANNOT_DUMP to HAVE_UNEXEC
* 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.
-rw-r--r--configure.ac37
-rw-r--r--etc/DEBUG2
-rw-r--r--lisp/loadup.el3
-rw-r--r--src/alloc.c12
-rw-r--r--src/conf_post.h10
-rw-r--r--src/emacs.c44
-rw-r--r--src/image.c2
-rw-r--r--src/lastfile.c2
-rw-r--r--src/lisp.h32
-rw-r--r--src/term.c3
-rw-r--r--src/timefns.c4
-rw-r--r--src/unexcoff.c4
-rw-r--r--src/w32heap.c8
13 files changed, 78 insertions, 85 deletions
diff --git a/configure.ac b/configure.ac
index 40be0859aaa..ff745eca1a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -382,15 +382,8 @@ if test "$with_pdumper" = "yes"; then
382 AC_DEFINE(HAVE_PDUMPER, 1, [Define to build with portable dumper support]) 382 AC_DEFINE(HAVE_PDUMPER, 1, [Define to build with portable dumper support])
383fi 383fi
384 384
385if test "$with_unexec" = "yes"; then
386 CANNOT_DUMP=no
387else
388 CANNOT_DUMP=yes
389fi
390
391DUMPING=$with_dumping 385DUMPING=$with_dumping
392AC_SUBST(DUMPING) 386AC_SUBST(DUMPING)
393AC_SUBST(CANNOT_DUMP)
394 387
395dnl FIXME currently it is not the last. 388dnl FIXME currently it is not the last.
396dnl This should be the last --with option, because --with-x is 389dnl This should be the last --with option, because --with-x is
@@ -1314,7 +1307,7 @@ AC_SUBST([FIND_DELETE])
1314 1307
1315PAXCTL_dumped= 1308PAXCTL_dumped=
1316PAXCTL_notdumped= 1309PAXCTL_notdumped=
1317if test "$CANNOT_DUMP" = "no" && test $opsys = gnu-linux; then 1310if test $with_unexec = yes && test $opsys = gnu-linux; then
1318 if test "${SETFATTR+set}" != set; then 1311 if test "${SETFATTR+set}" != set; then
1319 AC_CACHE_CHECK([for setfattr], 1312 AC_CACHE_CHECK([for setfattr],
1320 [emacs_cv_prog_setfattr], 1313 [emacs_cv_prog_setfattr],
@@ -1434,7 +1427,7 @@ else
1434fi 1427fi
1435 1428
1436AC_CACHE_CHECK([for -znocombreloc], [emacs_cv_znocombreloc], 1429AC_CACHE_CHECK([for -znocombreloc], [emacs_cv_znocombreloc],
1437 [if test "$CANNOT_DUMP" = "yes"; then 1430 [if test $with_unexec = no; then
1438 emacs_cv_znocombreloc='not needed' 1431 emacs_cv_znocombreloc='not needed'
1439 else 1432 else
1440 save_LDFLAGS=$LDFLAGS 1433 save_LDFLAGS=$LDFLAGS
@@ -1465,13 +1458,16 @@ AC_CACHE_CHECK([whether addresses are sanitized],
1465 [emacs_cv_sanitize_address=yes], 1458 [emacs_cv_sanitize_address=yes],
1466 [emacs_cv_sanitize_address=no])]) 1459 [emacs_cv_sanitize_address=no])])
1467 1460
1468if test "$CANNOT_DUMP" = "yes"; then 1461if test $with_unexec = yes; then
1469 AC_DEFINE(CANNOT_DUMP, 1, [Define if Emacs should not support unexec.]) 1462 AC_DEFINE([HAVE_UNEXEC], 1, [Define if Emacs supports unexec.])
1470elif test "$emacs_cv_sanitize_address" = yes; then 1463 if test "$emacs_cv_sanitize_address" = yes; then
1471 AC_MSG_WARN([[Addresses are sanitized; suggest CANNOT_DUMP=yes]]) 1464 AC_MSG_WARN([[Addresses are sanitized; suggest --without-unexec]])
1465 fi
1472fi 1466fi
1473 1467
1474UNEXEC_OBJ=unexelf.o 1468
1469UNEXEC_OBJ=
1470test $with_unexec = yes &&
1475case "$opsys" in 1471case "$opsys" in
1476 # MSDOS uses unexcoff.o 1472 # MSDOS uses unexcoff.o
1477 aix4-2) 1473 aix4-2)
@@ -1499,8 +1495,10 @@ case "$opsys" in
1499 # not been tested, so for now this change is for Solaris 10 or newer. 1495 # not been tested, so for now this change is for Solaris 10 or newer.
1500 UNEXEC_OBJ=unexsol.o 1496 UNEXEC_OBJ=unexsol.o
1501 ;; 1497 ;;
1498 *)
1499 UNEXEC_OBJ=unexelf.o
1500 ;;
1502esac 1501esac
1503test "$CANNOT_DUMP" = "yes" && UNEXEC_OBJ=
1504 1502
1505LD_SWITCH_SYSTEM= 1503LD_SWITCH_SYSTEM=
1506test "$with_unexec" = no || case "$opsys" in 1504test "$with_unexec" = no || case "$opsys" in
@@ -1551,7 +1549,7 @@ esac
1551 1549
1552C_SWITCH_MACHINE= 1550C_SWITCH_MACHINE=
1553 1551
1554test "$CANNOT_DUMP" = yes || 1552test $with_unexec = yes &&
1555case $canonical in 1553case $canonical in
1556 alpha*) 1554 alpha*)
1557 AC_CHECK_DECL([__ELF__]) 1555 AC_CHECK_DECL([__ELF__])
@@ -2310,7 +2308,7 @@ doug_lea_malloc=$emacs_cv_var_doug_lea_malloc
2310hybrid_malloc= 2308hybrid_malloc=
2311system_malloc=yes 2309system_malloc=yes
2312 2310
2313test "$CANNOT_DUMP" = yes || 2311test $with_unexec = yes &&
2314case "$opsys" in 2312case "$opsys" in
2315 ## darwin ld insists on the use of malloc routines in the System framework. 2313 ## darwin ld insists on the use of malloc routines in the System framework.
2316 darwin | mingw32 | nacl | sol2-10) ;; 2314 darwin | mingw32 | nacl | sol2-10) ;;
@@ -5440,7 +5438,7 @@ esac
5440AC_CACHE_CHECK( 5438AC_CACHE_CHECK(
5441 [for $CC option to disable position independent executables], 5439 [for $CC option to disable position independent executables],
5442 [emacs_cv_prog_cc_no_pie], 5440 [emacs_cv_prog_cc_no_pie],
5443 [if test "$CANNOT_DUMP" = yes; then 5441 [if test $with_unexec = no; then
5444 emacs_cv_prog_cc_no_pie='not needed' 5442 emacs_cv_prog_cc_no_pie='not needed'
5445 else 5443 else
5446 emacs_save_c_werror_flag=$ac_c_werror_flag 5444 emacs_save_c_werror_flag=$ac_c_werror_flag
@@ -5552,10 +5550,9 @@ emacs_config_features=
5552for opt in XAW3D XPM JPEG TIFF GIF PNG RSVG CAIRO IMAGEMAGICK SOUND GPM DBUS \ 5550for opt in XAW3D XPM JPEG TIFF GIF PNG RSVG CAIRO IMAGEMAGICK SOUND GPM DBUS \
5553 GCONF GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT \ 5551 GCONF GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT \
5554 LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS X_TOOLKIT OLDXMENU X11 XDBE XIM \ 5552 LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS X_TOOLKIT OLDXMENU X11 XDBE XIM \
5555 NS MODULES THREADS XWIDGETS LIBSYSTEMD JSON CANNOT_DUMP LCMS2 GMP; do 5553 NS MODULES THREADS XWIDGETS LIBSYSTEMD JSON LCMS2 GMP; do
5556 5554
5557 case $opt in 5555 case $opt in
5558 CANNOT_DUMP) eval val=\${$opt} ;;
5559 GLIB) val=${emacs_cv_links_glib} ;; 5556 GLIB) val=${emacs_cv_links_glib} ;;
5560 NOTIFY|ACL) eval val=\${${opt}_SUMMARY} ;; 5557 NOTIFY|ACL) eval val=\${${opt}_SUMMARY} ;;
5561 TOOLKIT_SCROLL_BARS|X_TOOLKIT) eval val=\${USE_$opt} ;; 5558 TOOLKIT_SCROLL_BARS|X_TOOLKIT) eval val=\${USE_$opt} ;;
diff --git a/etc/DEBUG b/etc/DEBUG
index 21097ccdf4b..d401d0be901 100644
--- a/etc/DEBUG
+++ b/etc/DEBUG
@@ -936,7 +936,7 @@ its own versions, and because the dumping process might be
936incompatible with the way these packages use to track allocated 936incompatible with the way these packages use to track allocated
937memory. Here are some of the changes you might find necessary: 937memory. Here are some of the changes you might find necessary:
938 938
939 - Edit configure, to set system_malloc and CANNOT_DUMP to "yes". 939 - Make sure unexec is disabled, e.g., './configure --without-unexec'.
940 940
941 - Configure with a different --prefix= option. If you use GCC, 941 - Configure with a different --prefix= option. If you use GCC,
942 version 2.7.2 is preferred, as some malloc debugging packages 942 version 2.7.2 is preferred, as some malloc debugging packages
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 747476c5067..67e8aa7d40a 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -526,8 +526,7 @@ lost after dumping")))
526 t)))) 526 t))))
527 (kill-emacs))) 527 (kill-emacs)))
528 528
529;; For machines with CANNOT_DUMP defined in config.h, 529;; This file must be loaded each time Emacs is run from scratch, e.g., temacs.
530;; this file must be loaded each time Emacs is run.
531;; So run the startup code now. First, remove `-l loadup' from args. 530;; So run the startup code now. First, remove `-l loadup' from args.
532 531
533(if (and (member (nth 1 command-line-args) '("-l" "--load")) 532(if (and (member (nth 1 command-line-args) '("-l" "--load"))
diff --git a/src/alloc.c b/src/alloc.c
index 5ea466becae..a0d0a611346 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -168,7 +168,7 @@ voidfuncptr __MALLOC_HOOK_VOLATILE __malloc_initialize_hook EXTERNALLY_VISIBLE
168 168
169#endif 169#endif
170 170
171#if defined DOUG_LEA_MALLOC || !defined CANNOT_DUMP 171#if defined DOUG_LEA_MALLOC || defined HAVE_UNEXEC
172 172
173/* Allocator-related actions to do just before and after unexec. */ 173/* Allocator-related actions to do just before and after unexec. */
174 174
@@ -502,11 +502,11 @@ static struct mem_node *mem_find (void *);
502#endif 502#endif
503 503
504/* Addresses of staticpro'd variables. Initialize it to a nonzero 504/* Addresses of staticpro'd variables. Initialize it to a nonzero
505 value if we might dump; otherwise some compilers put it into 505 value if we might unexec; otherwise some compilers put it into
506 BSS. */ 506 BSS. */
507 507
508Lisp_Object *staticvec[NSTATICS] 508Lisp_Object *staticvec[NSTATICS]
509#ifndef CANNOT_DUMP 509#ifdef HAVE_UNEXEC
510= {&Vpurify_flag} 510= {&Vpurify_flag}
511#endif 511#endif
512 ; 512 ;
@@ -1192,9 +1192,9 @@ verify (POWER_OF_2 (BLOCK_ALIGN));
1192 1192
1193/* Use aligned_alloc if it or a simple substitute is available. 1193/* Use aligned_alloc if it or a simple substitute is available.
1194 Aligned allocation is incompatible with unexmacosx.c, so don't use 1194 Aligned allocation is incompatible with unexmacosx.c, so don't use
1195 it on Darwin unless CANNOT_DUMP. */ 1195 it on Darwin if HAVE_UNEXEC. */
1196 1196
1197#if !defined DARWIN_OS || defined CANNOT_DUMP 1197#if ! (defined DARWIN_OS && defined HAVE_UNEXEC)
1198# if (defined HAVE_ALIGNED_ALLOC \ 1198# if (defined HAVE_ALIGNED_ALLOC \
1199 || (defined HYBRID_MALLOC \ 1199 || (defined HYBRID_MALLOC \
1200 ? defined HAVE_POSIX_MEMALIGN \ 1200 ? defined HAVE_POSIX_MEMALIGN \
@@ -5390,7 +5390,7 @@ pure_alloc (size_t size, int type)
5390} 5390}
5391 5391
5392 5392
5393#ifndef CANNOT_DUMP 5393#ifdef HAVE_UNEXEC
5394 5394
5395/* Print a warning if PURESIZE is too small. */ 5395/* Print a warning if PURESIZE is too small. */
5396 5396
diff --git a/src/conf_post.h b/src/conf_post.h
index 125dbf01528..f8254cfa9df 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -92,13 +92,11 @@ typedef bool bool_bf;
92# define ADDRESS_SANITIZER false 92# define ADDRESS_SANITIZER false
93#endif 93#endif
94 94
95#ifdef DARWIN_OS 95#if defined DARWIN_OS && defined emacs && defined HAVE_UNEXEC
96#if defined emacs && !defined CANNOT_DUMP 96# define malloc unexec_malloc
97#define malloc unexec_malloc 97# define realloc unexec_realloc
98#define realloc unexec_realloc 98# define free unexec_free
99#define free unexec_free
100#endif 99#endif
101#endif /* DARWIN_OS */
102 100
103/* If HYBRID_MALLOC is defined (e.g., on Cygwin), emacs will use 101/* If HYBRID_MALLOC is defined (e.g., on Cygwin), emacs will use
104 gmalloc before dumping and the system malloc after dumping. 102 gmalloc before dumping and the system malloc after dumping.
diff --git a/src/emacs.c b/src/emacs.c
index d6b8a87c723..ff814a149b3 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -149,7 +149,7 @@ bool running_asynch_code;
149bool display_arg; 149bool display_arg;
150#endif 150#endif
151 151
152#if defined GNU_LINUX && !defined CANNOT_DUMP 152#if defined GNU_LINUX && defined HAVE_UNEXEC
153/* The gap between BSS end and heap start as far as we can tell. */ 153/* The gap between BSS end and heap start as far as we can tell. */
154static uprintmax_t heap_bss_diff; 154static uprintmax_t heap_bss_diff;
155#endif 155#endif
@@ -868,7 +868,7 @@ main (int argc, char **argv)
868 can set heap flags properly if we're going to unexec. */ 868 can set heap flags properly if we're going to unexec. */
869 if (!initialized && temacs) 869 if (!initialized && temacs)
870 { 870 {
871#ifndef CANNOT_DUMP 871#ifdef HAVE_UNEXEC
872 if (strcmp (temacs, "dump") == 0 || 872 if (strcmp (temacs, "dump") == 0 ||
873 strcmp (temacs, "bootstrap") == 0) 873 strcmp (temacs, "bootstrap") == 0)
874 gflags.will_dump_with_unexec_ = true; 874 gflags.will_dump_with_unexec_ = true;
@@ -878,7 +878,7 @@ main (int argc, char **argv)
878 strcmp (temacs, "pbootstrap") == 0) 878 strcmp (temacs, "pbootstrap") == 0)
879 gflags.will_dump_with_pdumper_ = true; 879 gflags.will_dump_with_pdumper_ = true;
880#endif 880#endif
881#if defined (HAVE_PDUMPER) || !defined (CANNOT_DUMP) 881#if defined HAVE_PDUMPER || defined HAVE_UNEXEC
882 if (strcmp (temacs, "bootstrap") == 0 || 882 if (strcmp (temacs, "bootstrap") == 0 ||
883 strcmp (temacs, "pbootstrap") == 0) 883 strcmp (temacs, "pbootstrap") == 0)
884 gflags.will_bootstrap_ = true; 884 gflags.will_bootstrap_ = true;
@@ -904,7 +904,7 @@ main (int argc, char **argv)
904#endif 904#endif
905 } 905 }
906 906
907#ifndef CANNOT_DUMP 907#ifdef HAVE_UNEXEC
908 if (!will_dump_with_unexec_p ()) 908 if (!will_dump_with_unexec_p ())
909 gflags.will_not_unexec_ = true; 909 gflags.will_not_unexec_ = true;
910#endif 910#endif
@@ -953,7 +953,7 @@ main (int argc, char **argv)
953 argc = maybe_disable_address_randomization ( 953 argc = maybe_disable_address_randomization (
954 will_dump_with_unexec_p (), argc, argv); 954 will_dump_with_unexec_p (), argc, argv);
955 955
956#if defined (GNU_LINUX) && !defined (CANNOT_DUMP) 956#if defined GNU_LINUX && defined HAVE_UNEXEC
957 if (!initialized) 957 if (!initialized)
958 { 958 {
959 char *heap_start = my_heap_start (); 959 char *heap_start = my_heap_start ();
@@ -967,7 +967,7 @@ main (int argc, char **argv)
967#endif 967#endif
968 968
969/* If using unexmacosx.c (set by s/darwin.h), we must do this. */ 969/* If using unexmacosx.c (set by s/darwin.h), we must do this. */
970#if defined DARWIN_OS && !defined CANNOT_DUMP 970#if defined DARWIN_OS && defined HAVE_UNEXEC
971 if (!initialized) 971 if (!initialized)
972 unexec_init_emacs_zone (); 972 unexec_init_emacs_zone ();
973#endif 973#endif
@@ -1445,7 +1445,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1445 /* Call syms_of_keyboard before init_window_once because 1445 /* Call syms_of_keyboard before init_window_once because
1446 keyboard sets up symbols that include some face names that 1446 keyboard sets up symbols that include some face names that
1447 the X support will want to use. This can happen when 1447 the X support will want to use. This can happen when
1448 CANNOT_DUMP is defined. */ 1448 Emacs starts up from scratch (e.g., temacs). */
1449 syms_of_keyboard (); 1449 syms_of_keyboard ();
1450 1450
1451 /* Called before syms_of_fileio, because it sets up Qerror_condition. */ 1451 /* Called before syms_of_fileio, because it sets up Qerror_condition. */
@@ -2378,7 +2378,7 @@ shut_down_emacs (int sig, Lisp_Object stuff)
2378 2378
2379 2379
2380 2380
2381#ifndef CANNOT_DUMP 2381#ifdef HAVE_UNEXEC
2382 2382
2383#include "unexec.h" 2383#include "unexec.h"
2384 2384
@@ -2405,10 +2405,10 @@ You must run Emacs in batch mode in order to dump it. */)
2405 if (definitely_will_not_unexec_p ()) 2405 if (definitely_will_not_unexec_p ())
2406 error ("This Emacs instance was not started in temacs mode"); 2406 error ("This Emacs instance was not started in temacs mode");
2407 2407
2408#if defined GNU_LINUX && !defined CANNOT_DUMP 2408# if defined GNU_LINUX && defined HAVE_UNEXEC
2409 2409
2410 /* Warn if the gap between BSS end and heap start is larger than this. */ 2410 /* Warn if the gap between BSS end and heap start is larger than this. */
2411# define MAX_HEAP_BSS_DIFF (1024*1024) 2411# define MAX_HEAP_BSS_DIFF (1024 * 1024)
2412 2412
2413 if (heap_bss_diff > MAX_HEAP_BSS_DIFF) 2413 if (heap_bss_diff > MAX_HEAP_BSS_DIFF)
2414 { 2414 {
@@ -2421,7 +2421,7 @@ You must run Emacs in batch mode in order to dump it. */)
2421 fprintf (stderr, "exec-shield in etc/PROBLEMS for more information.\n"); 2421 fprintf (stderr, "exec-shield in etc/PROBLEMS for more information.\n");
2422 fprintf (stderr, "**************************************************\n"); 2422 fprintf (stderr, "**************************************************\n");
2423 } 2423 }
2424#endif /* GNU_LINUX */ 2424# endif
2425 2425
2426 /* Bind `command-line-processed' to nil before dumping, 2426 /* Bind `command-line-processed' to nil before dumping,
2427 so that the dumped Emacs will process its command line 2427 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. */)
2445 tem = Vpurify_flag; 2445 tem = Vpurify_flag;
2446 Vpurify_flag = Qnil; 2446 Vpurify_flag = Qnil;
2447 2447
2448#ifdef HYBRID_MALLOC 2448# ifdef HYBRID_MALLOC
2449 { 2449 {
2450 static char const fmt[] = "%d of %d static heap bytes used"; 2450 static char const fmt[] = "%d of %d static heap bytes used";
2451 char buf[sizeof fmt + 2 * (INT_STRLEN_BOUND (int) - 2)]; 2451 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. */)
2454 /* Don't log messages, because at this point buffers cannot be created. */ 2454 /* Don't log messages, because at this point buffers cannot be created. */
2455 message1_nolog (buf); 2455 message1_nolog (buf);
2456 } 2456 }
2457#endif 2457# endif
2458 2458
2459 fflush_unlocked (stdout); 2459 fflush_unlocked (stdout);
2460 /* Tell malloc where start of impure now is. */ 2460 /* Tell malloc where start of impure now is. */
2461 /* Also arrange for warnings when nearly out of space. */ 2461 /* Also arrange for warnings when nearly out of space. */
2462#if !defined SYSTEM_MALLOC && !defined HYBRID_MALLOC 2462# if !defined SYSTEM_MALLOC && !defined HYBRID_MALLOC && !defined WINDOWSNT
2463#ifndef WINDOWSNT
2464 /* On Windows, this was done before dumping, and that once suffices. 2463 /* On Windows, this was done before dumping, and that once suffices.
2465 Meanwhile, my_edata is not valid on Windows. */ 2464 Meanwhile, my_edata is not valid on Windows. */
2466 memory_warnings (my_edata, malloc_warning); 2465 memory_warnings (my_edata, malloc_warning);
2467#endif /* not WINDOWSNT */ 2466# endif
2468#endif /* not SYSTEM_MALLOC and not HYBRID_MALLOC */
2469 2467
2470 struct gflags old_gflags = gflags; 2468 struct gflags old_gflags = gflags;
2471 gflags.will_dump_ = false; 2469 gflags.will_dump_ = false;
@@ -2480,19 +2478,19 @@ You must run Emacs in batch mode in order to dump it. */)
2480 2478
2481 gflags = old_gflags; 2479 gflags = old_gflags;
2482 2480
2483#ifdef WINDOWSNT 2481# ifdef WINDOWSNT
2484 Vlibrary_cache = Qnil; 2482 Vlibrary_cache = Qnil;
2485#endif 2483# endif
2486#ifdef HAVE_WINDOW_SYSTEM 2484# ifdef HAVE_WINDOW_SYSTEM
2487 reset_image_types (); 2485 reset_image_types ();
2488#endif 2486# endif
2489 2487
2490 Vpurify_flag = tem; 2488 Vpurify_flag = tem;
2491 2489
2492 return unbind_to (count, Qnil); 2490 return unbind_to (count, Qnil);
2493} 2491}
2494 2492
2495#endif /* not CANNOT_DUMP */ 2493#endif
2496 2494
2497 2495
2498#if HAVE_SETLOCALE 2496#if HAVE_SETLOCALE
@@ -2781,7 +2779,7 @@ syms_of_emacs (void)
2781 DEFSYM (Qkill_emacs, "kill-emacs"); 2779 DEFSYM (Qkill_emacs, "kill-emacs");
2782 DEFSYM (Qkill_emacs_hook, "kill-emacs-hook"); 2780 DEFSYM (Qkill_emacs_hook, "kill-emacs-hook");
2783 2781
2784#ifndef CANNOT_DUMP 2782#ifdef HAVE_UNEXEC
2785 defsubr (&Sdump_emacs); 2783 defsubr (&Sdump_emacs);
2786#endif 2784#endif
2787 2785
diff --git a/src/image.c b/src/image.c
index 20148605817..57bbf3cdb93 100644
--- a/src/image.c
+++ b/src/image.c
@@ -10003,7 +10003,7 @@ lookup_image_type (Lisp_Object type)
10003 return NULL; 10003 return NULL;
10004} 10004}
10005 10005
10006#if !defined CANNOT_DUMP && defined HAVE_WINDOW_SYSTEM 10006#if defined HAVE_UNEXEC && defined HAVE_WINDOW_SYSTEM
10007 10007
10008/* Reset image_types before dumping. 10008/* Reset image_types before dumping.
10009 Called from Fdump_emacs. */ 10009 Called from Fdump_emacs. */
diff --git a/src/lastfile.c b/src/lastfile.c
index 706f667dbb9..bcaf105a51b 100644
--- a/src/lastfile.c
+++ b/src/lastfile.c
@@ -43,7 +43,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
43char my_edata[] = "End of Emacs initialized data"; 43char my_edata[] = "End of Emacs initialized data";
44#endif 44#endif
45 45
46#ifndef CANNOT_DUMP 46#ifdef HAVE_UNEXEC
47 47
48/* Help unexec locate the end of the .bss area used by Emacs (which 48/* Help unexec locate the end of the .bss area used by Emacs (which
49 isn't always a separate section in NT executables). */ 49 isn't always a separate section in NT executables). */
diff --git a/src/lisp.h b/src/lisp.h
index 5a0de4b12c7..3b481089cfd 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -633,11 +633,11 @@ extern bool initialized;
633 633
634extern struct gflags { 634extern struct gflags {
635 /* True means this Emacs instance was born to dump. */ 635 /* True means this Emacs instance was born to dump. */
636#if defined (HAVE_PDUMPER) || !defined (CANNOT_DUMP) 636#if defined HAVE_PDUMPER || defined HAVE_UNEXEC
637 bool will_dump_ : 1; 637 bool will_dump_ : 1;
638 bool will_bootstrap_ : 1; 638 bool will_bootstrap_ : 1;
639#endif 639#endif
640#if defined (HAVE_PDUMPER) 640#ifdef HAVE_PDUMPER
641 /* Set in an Emacs process that will likely dump with pdumper; all 641 /* Set in an Emacs process that will likely dump with pdumper; all
642 Emacs processes may dump with pdumper, however. */ 642 Emacs processes may dump with pdumper, however. */
643 bool will_dump_with_pdumper_ : 1; 643 bool will_dump_with_pdumper_ : 1;
@@ -645,7 +645,7 @@ extern struct gflags {
645 dump. */ 645 dump. */
646 bool dumped_with_pdumper_ : 1; 646 bool dumped_with_pdumper_ : 1;
647#endif 647#endif
648#ifndef CANNOT_DUMP 648#ifdef HAVE_UNEXEC
649 bool will_dump_with_unexec_ : 1; 649 bool will_dump_with_unexec_ : 1;
650 /* Set in an Emacs process that has been restored from an unexec 650 /* Set in an Emacs process that has been restored from an unexec
651 dump. */ 651 dump. */
@@ -658,7 +658,7 @@ extern struct gflags {
658INLINE bool 658INLINE bool
659will_dump_p (void) 659will_dump_p (void)
660{ 660{
661#if HAVE_PDUMPER || !defined (CANNOT_DUMP) 661#if HAVE_PDUMPER || defined HAVE_UNEXEC
662 return gflags.will_dump_; 662 return gflags.will_dump_;
663#else 663#else
664 return false; 664 return false;
@@ -668,7 +668,7 @@ will_dump_p (void)
668INLINE bool 668INLINE bool
669will_bootstrap_p (void) 669will_bootstrap_p (void)
670{ 670{
671#if HAVE_PDUMPER || !defined (CANNOT_DUMP) 671#if HAVE_PDUMPER || defined HAVE_UNEXEC
672 return gflags.will_bootstrap_; 672 return gflags.will_bootstrap_;
673#else 673#else
674 return false; 674 return false;
@@ -698,20 +698,20 @@ dumped_with_pdumper_p (void)
698INLINE bool 698INLINE bool
699will_dump_with_unexec_p (void) 699will_dump_with_unexec_p (void)
700{ 700{
701#ifdef CANNOT_DUMP 701#ifdef HAVE_UNEXEC
702 return false;
703#else
704 return gflags.will_dump_with_unexec_; 702 return gflags.will_dump_with_unexec_;
703#else
704 return false;
705#endif 705#endif
706} 706}
707 707
708INLINE bool 708INLINE bool
709dumped_with_unexec_p (void) 709dumped_with_unexec_p (void)
710{ 710{
711#ifdef CANNOT_DUMP 711#ifdef HAVE_UNEXEC
712 return false;
713#else
714 return gflags.dumped_with_unexec_; 712 return gflags.dumped_with_unexec_;
713#else
714 return false;
715#endif 715#endif
716} 716}
717 717
@@ -721,10 +721,10 @@ dumped_with_unexec_p (void)
721INLINE bool 721INLINE bool
722definitely_will_not_unexec_p (void) 722definitely_will_not_unexec_p (void)
723{ 723{
724#ifdef CANNOT_DUMP 724#ifdef HAVE_UNEXEC
725 return true;
726#else
727 return gflags.will_not_unexec_; 725 return gflags.will_not_unexec_;
726#else
727 return true;
728#endif 728#endif
729} 729}
730 730
@@ -3032,7 +3032,7 @@ CHECK_INTEGER (Lisp_Object x)
3032/* If we're not dumping using the legacy dumper and we might be using 3032/* If we're not dumping using the legacy dumper and we might be using
3033 the portable dumper, try to bunch all the subr structures together 3033 the portable dumper, try to bunch all the subr structures together
3034 for more efficient dump loading. */ 3034 for more efficient dump loading. */
3035#ifdef CANNOT_DUMP 3035#ifndef HAVE_UNEXEC
3036# ifdef DARWIN_OS 3036# ifdef DARWIN_OS
3037# define SUBR_SECTION_ATTRIBUTE ATTRIBUTE_SECTION ("__DATA,subrs") 3037# define SUBR_SECTION_ATTRIBUTE ATTRIBUTE_SECTION ("__DATA,subrs")
3038# else 3038# else
@@ -4135,7 +4135,7 @@ Lisp_Object backtrace_top_function (void);
4135extern bool let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol); 4135extern bool let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol);
4136 4136
4137/* Defined in unexmacosx.c. */ 4137/* Defined in unexmacosx.c. */
4138#if defined DARWIN_OS && !defined CANNOT_DUMP 4138#if defined DARWIN_OS && defined HAVE_UNEXEC
4139extern void unexec_init_emacs_zone (void); 4139extern void unexec_init_emacs_zone (void);
4140extern void *unexec_malloc (size_t); 4140extern void *unexec_malloc (size_t);
4141extern void *unexec_realloc (void *, size_t); 4141extern void *unexec_realloc (void *, size_t);
diff --git a/src/term.c b/src/term.c
index c5a1fb99a15..7255f561e2a 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1350,7 +1350,8 @@ term_get_fkeys_1 (void)
1350 char **address = term_get_fkeys_address; 1350 char **address = term_get_fkeys_address;
1351 KBOARD *kboard = term_get_fkeys_kboard; 1351 KBOARD *kboard = term_get_fkeys_kboard;
1352 1352
1353 /* This can happen if CANNOT_DUMP or with strange options. */ 1353 /* This can happen if Emacs is starting up from scratch, or with
1354 strange options. */
1354 if (!KEYMAPP (KVAR (kboard, Vinput_decode_map))) 1355 if (!KEYMAPP (KVAR (kboard, Vinput_decode_map)))
1355 kset_input_decode_map (kboard, Fmake_sparse_keymap (Qnil)); 1356 kset_input_decode_map (kboard, Fmake_sparse_keymap (Qnil));
1356 1357
diff --git a/src/timefns.c b/src/timefns.c
index ce1f4d3f5a9..7e061228e2c 100644
--- a/src/timefns.c
+++ b/src/timefns.c
@@ -294,7 +294,7 @@ tzlookup (Lisp_Object zone, bool settz)
294void 294void
295init_timefns (void) 295init_timefns (void)
296{ 296{
297#ifndef CANNOT_DUMP 297#ifdef HAVE_UNEXEC
298 /* A valid but unlikely setting for the TZ environment variable. 298 /* A valid but unlikely setting for the TZ environment variable.
299 It is OK (though a bit slower) if the user chooses this value. */ 299 It is OK (though a bit slower) if the user chooses this value. */
300 static char dump_tz_string[] = "TZ=UtC0"; 300 static char dump_tz_string[] = "TZ=UtC0";
@@ -311,7 +311,7 @@ init_timefns (void)
311 311
312 char *tz = getenv ("TZ"); 312 char *tz = getenv ("TZ");
313 313
314#if !defined CANNOT_DUMP 314#ifdef HAVE_UNEXEC
315 /* If the execution TZ happens to be the same as the dump TZ, 315 /* If the execution TZ happens to be the same as the dump TZ,
316 change it to some other value and then change it back, 316 change it to some other value and then change it back,
317 to force the underlying implementation to reload the TZ info. 317 to force the underlying implementation to reload the TZ info.
diff --git a/src/unexcoff.c b/src/unexcoff.c
index 6e90c0628d2..220ce709df9 100644
--- a/src/unexcoff.c
+++ b/src/unexcoff.c
@@ -56,7 +56,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
56 56
57#define PERROR(file) report_error (file, new) 57#define PERROR(file) report_error (file, new)
58 58
59#ifndef CANNOT_DUMP /* all rest of file! */ 59#ifdef HAVE_UNEXEC /* all rest of file! */
60 60
61#ifdef HAVE_COFF_H 61#ifdef HAVE_COFF_H
62#include <coff.h> 62#include <coff.h>
@@ -538,4 +538,4 @@ unexec (const char *new_name, const char *a_name)
538 emacs_close (a_out); 538 emacs_close (a_out);
539} 539}
540 540
541#endif /* not CANNOT_DUMP */ 541#endif /* HAVE_UNEXEC */
diff --git a/src/w32heap.c b/src/w32heap.c
index 8a2c1b5877b..9a59a1f0758 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -115,9 +115,9 @@ typedef struct _RTL_HEAP_PARAMETERS {
115 than half of the size stated below. It would be nice to find a way 115 than half of the size stated below. It would be nice to find a way
116 to build only the first bootstrap-emacs.exe with the large size, 116 to build only the first bootstrap-emacs.exe with the large size,
117 and reset that to a lower value afterwards. */ 117 and reset that to a lower value afterwards. */
118#ifdef CANNOT_DUMP 118#ifndef HAVE_UNEXEC
119/* We don't use dumped_data[] when CANNOT_DUMP, so define to a small 119/* We don't use dumped_data[], so define to a small size that won't
120 size that won't matter. */ 120 matter. */
121# define DUMPED_HEAP_SIZE 10 121# define DUMPED_HEAP_SIZE 10
122#else 122#else
123# if defined _WIN64 || defined WIDE_EMACS_INT 123# if defined _WIN64 || defined WIDE_EMACS_INT
@@ -597,7 +597,7 @@ free_after_dump_9x (void *ptr)
597 } 597 }
598} 598}
599 599
600#if !defined (CANNOT_DUMP) && defined (ENABLE_CHECKING) 600#if defined HAVE_UNEXEC && defined ENABLE_CHECKING
601void 601void
602report_temacs_memory_usage (void) 602report_temacs_memory_usage (void)
603{ 603{