diff options
| author | Philipp Stephani | 2016-03-02 10:21:45 -0800 |
|---|---|---|
| committer | Paul Eggert | 2016-03-02 10:24:11 -0800 |
| commit | d5a18a93270bfc8c36e40910f8520b3738a91f43 (patch) | |
| tree | 9b1ec350299e142d4431ca7da9d519e80c0ca366 /src | |
| parent | a59a4bd47a9435fed49213d9613cce7aba193da7 (diff) | |
| download | emacs-d5a18a93270bfc8c36e40910f8520b3738a91f43.tar.gz emacs-d5a18a93270bfc8c36e40910f8520b3738a91f43.zip | |
Remove build system name from deterministic dumps
* configure.ac (DETERMINISTIC_DUMP): New configuration option.
* lisp/version.el (emacs-build-time): Add a comment to make the
build time deterministic if requested.
(emacs-build-system): Make variable deterministic if requested.
* src/emacs.c (main): Initialize `deterministic-dump' from the
configuration option.
(syms_of_emacs): New constant `deterministic-dump'.
* src/sysdep.c (init_system_name): Use a constant
if a deterministic dump is requested.
Diffstat (limited to 'src')
| -rw-r--r-- | src/emacs.c | 10 | ||||
| -rw-r--r-- | src/sysdep.c | 7 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/emacs.c b/src/emacs.c index c512885076c..e7cb4ea4aaa 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -872,6 +872,9 @@ main (int argc, char **argv) | |||
| 872 | SET_BINARY (fileno (stdout)); | 872 | SET_BINARY (fileno (stdout)); |
| 873 | #endif /* MSDOS */ | 873 | #endif /* MSDOS */ |
| 874 | 874 | ||
| 875 | if (DETERMINISTIC_DUMP) | ||
| 876 | Vdeterministic_dump = Qt; | ||
| 877 | |||
| 875 | /* Skip initial setlocale if LC_ALL is "C", as it's not needed in that case. | 878 | /* Skip initial setlocale if LC_ALL is "C", as it's not needed in that case. |
| 876 | The build procedure uses this while dumping, to ensure that the | 879 | The build procedure uses this while dumping, to ensure that the |
| 877 | dumped Emacs does not have its system locale tables initialized, | 880 | dumped Emacs does not have its system locale tables initialized, |
| @@ -2532,6 +2535,13 @@ libraries; only those already known by Emacs will be loaded. */); | |||
| 2532 | Vdynamic_library_alist = Qnil; | 2535 | Vdynamic_library_alist = Qnil; |
| 2533 | Fput (intern_c_string ("dynamic-library-alist"), Qrisky_local_variable, Qt); | 2536 | Fput (intern_c_string ("dynamic-library-alist"), Qrisky_local_variable, Qt); |
| 2534 | 2537 | ||
| 2538 | DEFVAR_BOOL ("deterministic-dump", Vdeterministic_dump, | ||
| 2539 | doc: /* If non-nil, attempt to make dumping deterministic by | ||
| 2540 | avoiding sources of nondeterminism such as absolute file names, the | ||
| 2541 | hostname, or timestamps. */); | ||
| 2542 | Vdeterministic_dump = DETERMINISTIC_DUMP ? Qt : Qnil; | ||
| 2543 | XSYMBOL (intern_c_string ("deterministic-dump"))->constant = 1; | ||
| 2544 | |||
| 2535 | #ifdef WINDOWSNT | 2545 | #ifdef WINDOWSNT |
| 2536 | Vlibrary_cache = Qnil; | 2546 | Vlibrary_cache = Qnil; |
| 2537 | staticpro (&Vlibrary_cache); | 2547 | staticpro (&Vlibrary_cache); |
diff --git a/src/sysdep.c b/src/sysdep.c index 418c50d5e78..b01c64d52ac 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -1408,6 +1408,13 @@ setup_pty (int fd) | |||
| 1408 | void | 1408 | void |
| 1409 | init_system_name (void) | 1409 | init_system_name (void) |
| 1410 | { | 1410 | { |
| 1411 | if (DETERMINISTIC_DUMP && (might_dump || ! NILP (Vpurify_flag))) | ||
| 1412 | { | ||
| 1413 | /* If we're dumping, set the hostname to a literal so that the | ||
| 1414 | dump is deterministic. */ | ||
| 1415 | Vsystem_name = build_pure_c_string ("elided"); | ||
| 1416 | return; | ||
| 1417 | } | ||
| 1411 | char *hostname_alloc = NULL; | 1418 | char *hostname_alloc = NULL; |
| 1412 | char *hostname; | 1419 | char *hostname; |
| 1413 | #ifndef HAVE_GETHOSTNAME | 1420 | #ifndef HAVE_GETHOSTNAME |