diff options
author | Ulrich Müller <ulm@gentoo.org> | 2012-05-26 15:05:12 +0000 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2012-05-26 15:05:12 +0000 |
commit | bdbe86c9876f88a7464f24df6e3ac58549caab8a (patch) | |
tree | b29979d66b353f5aa1fb87a85cf8a36cd0e79345 | |
parent | Remove 23.3 patchset. (diff) | |
download | emacs-patches-bdbe86c9876f88a7464f24df6e3ac58549caab8a.tar.gz emacs-patches-bdbe86c9876f88a7464f24df6e3ac58549caab8a.tar.bz2 emacs-patches-bdbe86c9876f88a7464f24df6e3ac58549caab8a.zip |
Fix building on systems with PaX enabled kernel, bug 411439.emacs-23.4-patches-3
-rw-r--r-- | emacs/23.4/10_all_paxctl.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/emacs/23.4/10_all_paxctl.patch b/emacs/23.4/10_all_paxctl.patch new file mode 100644 index 0000000..dd79a88 --- /dev/null +++ b/emacs/23.4/10_all_paxctl.patch @@ -0,0 +1,59 @@ +https://bugs.gentoo.org/411439 +http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11398 + +On grsecurity/PaX systems, unexec will fail due to a gap between +the bss section and the heap. This can be prevented by disabling +memory randomization in temacs with "paxctl -r". + +--- emacs-23.4-orig/configure.in ++++ emacs-23.4/configure.in +@@ -800,6 +800,8 @@ + AC_PATH_PROG(INSTALL_INFO, install-info,:, /sbin) + dnl Don't use GZIP, which is used by gzip for additional parameters. + AC_PATH_PROG(GZIP_PROG, gzip) ++AC_PATH_PROG(PAXCTL, paxctl,, ++ [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin]) + + + ## Need makeinfo >= 4.6 (?) to build the manuals. +--- emacs-23.4-orig/src/Makefile.in ++++ emacs-23.4/src/Makefile.in +@@ -508,6 +508,12 @@ + some cpps. */ + TEMACS_LDFLAGS = LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_TEMACS LD_SWITCH_MACHINE LD_SWITCH_MACHINE_TEMACS + ++/* If available, the full path to the paxctl program. ++ On grsecurity/PaX systems, unexec will fail due to a gap between ++ the bss section and the heap. This can be prevented by disabling ++ memory randomization in temacs with "paxctl -r". See bug#11398. */ ++PAXCTL = @PAXCTL@ ++ + /* A macro which other sections of Makefile can redefine to munge the + flags before they are passed to LD. This is helpful if you have + redefined LD to something odd, like "gcc". +@@ -933,6 +939,7 @@ + -EMACSLOADPATH=${lispsource} ./emacs -q -batch -f list-load-path-shadows + #else + LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump ++ test "X$(PAXCTL)" = X || $(PAXCTL) -zex emacs$(EXEEXT) + @: This new Emacs is as functional and more efficient then + @: bootstrap-emacs, so let us replace it. + -ln -f emacs${EXEEXT} bootstrap-emacs${EXEEXT} +@@ -974,6 +981,9 @@ + -o temacs ${STARTFILES} ${obj} ${otherobj} \ + ${LIBES} + #endif ++#ifndef CANNOT_DUMP ++ test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT) ++#endif + + /* We do not use ALL_LDFLAGS because LD_SWITCH_SYSTEM and LD_SWITCH_MACHINE + often contain options that have to do with using Emacs''s crt0, +@@ -1419,6 +1429,7 @@ + ln -f temacs${EXEEXT} bootstrap-emacs${EXEEXT} + #else + $(RUN_TEMACS) --batch --load loadup bootstrap ++ test "X$(PAXCTL)" = X || $(PAXCTL) -zex emacs$(EXEEXT) + mv -f emacs${EXEEXT} bootstrap-emacs${EXEEXT} + #endif /* ! defined (CANNOT_DUMP) */ + @: Compile some files earlier to speed up further compilation. |