aboutsummaryrefslogtreecommitdiff
blob: 53d97c3eb95aab4261d1ec1f5e8322a1fcdd893f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Fix failure in unexec with hardened Linux kernel and XATTR_PAX_FLAGS=y.
https://bugs.gentoo.org/456970

--- emacs-23.4-orig/configure.in
+++ emacs-23.4/configure.in
@@ -812,6 +812,18 @@
   fi
 fi
 
+AC_PATH_PROG(SETFATTR, setfattr)
+if test "X$SETFATTR" != X; then
+  AC_MSG_CHECKING([whether extended attributes are supported])
+  touch conftest.tmp
+  if $SETFATTR -n user.pax.flags conftest.tmp >/dev/null 2>&1; then
+    AC_MSG_RESULT(yes)
+  else
+    AC_MSG_RESULT(no); SETFATTR=""
+  fi
+  rm -f conftest.tmp
+fi
+
 ## Need makeinfo >= 4.6 (?) to build the manuals.
 AC_PATH_PROG(MAKEINFO, makeinfo, no)
 dnl By this stage, configure has already checked for egrep and set EGREP,
--- emacs-23.4-orig/src/Makefile.in
+++ emacs-23.4/src/Makefile.in
@@ -514,6 +514,9 @@
    memory randomization in temacs with "paxctl -r".  See bug#11398.  */
 PAXCTL = @PAXCTL@
 
+/* If available, the full path to the setfattr program.  */
+SETFATTR = @SETFATTR@
+
 /* 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".
@@ -983,6 +986,8 @@
 #endif
 #ifndef CANNOT_DUMP
 	test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
+	test "X$(SETFATTR)" = X \
+	  || $(SETFATTR) -n user.pax.flags -v r temacs$(EXEEXT)
 #endif
 
 /* We do not use ALL_LDFLAGS because LD_SWITCH_SYSTEM and LD_SWITCH_MACHINE