Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
emacs: Clear the environment while dumping
This reduces the closure size of Emacs from 575 to 279 MiB. Dumping Emacs had a chance of leaking parts of the environment (such as $PATH) into the dumped executable. This hopefully fixes it. (It's a bit hard to tell since the effect is not deterministic.)
- Loading branch information
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Dump temacs in an empty environment to prevent -dev paths from ending | ||
up in the dumped image. | ||
|
||
diff -ru -x '*~' emacs-25.3/src/Makefile.in emacs-25.3-new/src/Makefile.in | ||
--- emacs-25.3/src/Makefile.in 2017-04-14 17:02:47.000000000 +0200 | ||
+++ emacs-25.3-new/src/Makefile.in 2017-09-25 19:03:02.173861038 +0200 | ||
@@ -532,7 +532,7 @@ | ||
ifeq ($(CANNOT_DUMP),yes) | ||
ln -f temacs$(EXEEXT) $@ | ||
else | ||
- LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump | ||
+ env -i LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump | ||
ifneq ($(PAXCTL_dumped),) | ||
$(PAXCTL_dumped) $@ | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters