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