public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo commit in src/patchsets/emacs/23.4: 10_all_paxctl.patch
@ 2012-05-26 15:05 Ulrich Mueller (ulm)
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Mueller (ulm) @ 2012-05-26 15:05 UTC (permalink / raw
  To: gentoo-commits

ulm         12/05/26 15:05:13

  Added:                10_all_paxctl.patch
  Log:
  Fix building on systems with PaX enabled kernel, bug 411439.

Revision  Changes    Path
1.1                  src/patchsets/emacs/23.4/10_all_paxctl.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/emacs/23.4/10_all_paxctl.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/emacs/23.4/10_all_paxctl.patch?rev=1.1&content-type=text/plain

Index: 10_all_paxctl.patch
===================================================================
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.






^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gentoo-commits] gentoo commit in src/patchsets/emacs/23.4: 10_all_paxctl.patch
@ 2012-07-26 16:29 Ulrich Mueller (ulm)
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Mueller (ulm) @ 2012-07-26 16:29 UTC (permalink / raw
  To: gentoo-commits

ulm         12/07/26 16:29:31

  Modified:             10_all_paxctl.patch
  Log:
  Run paxctl only if the toolchain supports PT_PAX_FLAGS, bug 426394.

Revision  Changes    Path
1.2                  src/patchsets/emacs/23.4/10_all_paxctl.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/emacs/23.4/10_all_paxctl.patch?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/emacs/23.4/10_all_paxctl.patch?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/emacs/23.4/10_all_paxctl.patch?r1=1.1&r2=1.2

Index: 10_all_paxctl.patch
===================================================================
RCS file: /var/cvsroot/gentoo/src/patchsets/emacs/23.4/10_all_paxctl.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 10_all_paxctl.patch	26 May 2012 15:05:12 -0000	1.1
+++ 10_all_paxctl.patch	26 Jul 2012 16:29:30 -0000	1.2
@@ -1,21 +1,29 @@
-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".
+https://bugs.gentoo.org/411439
+https://bugs.gentoo.org/426394
+http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11398
 
 --- emacs-23.4-orig/configure.in
 +++ emacs-23.4/configure.in
-@@ -800,6 +800,8 @@
- AC_PATH_PROG(INSTALL_INFO, install-info,:, /sbin)
+@@ -801,6 +801,16 @@
  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])
  
++if test $opsys = gnu-linux; then
++  AC_PATH_PROG(PAXCTL, paxctl,,
++    [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin])
++  if test "X$PAXCTL" != X; then
++    AC_MSG_CHECKING([whether binaries have a PT_PAX_FLAGS header])
++    AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
++      [if $PAXCTL -v conftest$EXEEXT >/dev/null 2>&1; then AC_MSG_RESULT(yes)
++      else AC_MSG_RESULT(no); PAXCTL=""; fi])
++  fi
++fi
  
  ## Need makeinfo >= 4.6 (?) to build the manuals.
+ AC_PATH_PROG(MAKEINFO, makeinfo, no)
 --- emacs-23.4-orig/src/Makefile.in
 +++ emacs-23.4/src/Makefile.in
 @@ -508,6 +508,12 @@





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-26 16:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-26 15:05 [gentoo-commits] gentoo commit in src/patchsets/emacs/23.4: 10_all_paxctl.patch Ulrich Mueller (ulm)
  -- strict thread matches above, loose matches on Subject: below --
2012-07-26 16:29 Ulrich Mueller (ulm)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox