aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2018-06-15 15:51:39 -0700
committerPaul Eggert2018-06-15 15:51:56 -0700
commitb8b960e5e1520874b0a59575d31368f96b7f8b47 (patch)
tree93bb733623bc109d0b0e0bf7e63ddbf0d5740c8d
parentc2b20948fbe1dbb4be76c477e66cf120797417ff (diff)
downloademacs-b8b960e5e1520874b0a59575d31368f96b7f8b47.tar.gz
emacs-b8b960e5e1520874b0a59575d31368f96b7f8b47.zip
Minor CANNOT_DUMP cleanups
Mostly, this avoids munging executables when CANNOT_DUMP = yes, as the munging is needed only for unexec. * configure.ac (PAXCTL_dumped, PAXCTL_notdumped) [CANNOT_DUMP]: Leave these empty. (LD_SWITCH_SYSTEM_TEMACS) [CANNOT_DUMP]: Do not append -no-pie or -nopie. * src/alloc.c (my_heap_start) [CANNOT_DUMP]: Omit; not used.
-rw-r--r--configure.ac116
-rw-r--r--src/alloc.c2
2 files changed, 63 insertions, 55 deletions
diff --git a/configure.ac b/configure.ac
index 4fcb846c608..e33b1f1e353 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1226,50 +1226,52 @@ AC_SUBST([FIND_DELETE])
1226 1226
1227PAXCTL_dumped= 1227PAXCTL_dumped=
1228PAXCTL_notdumped= 1228PAXCTL_notdumped=
1229if test $opsys = gnu-linux; then 1229if test "$CANNOT_DUMP" != yes; then
1230 if test "${SETFATTR+set}" != set; then 1230 if test $opsys = gnu-linux; then
1231 AC_CACHE_CHECK([for setfattr], 1231 if test "${SETFATTR+set}" != set; then
1232 [emacs_cv_prog_setfattr], 1232 AC_CACHE_CHECK([for setfattr],
1233 [touch conftest.tmp 1233 [emacs_cv_prog_setfattr],
1234 if (setfattr -n user.pax.flags conftest.tmp) >/dev/null 2>&1; then 1234 [touch conftest.tmp
1235 emacs_cv_prog_setfattr=yes 1235 if (setfattr -n user.pax.flags conftest.tmp) >/dev/null 2>&1; then
1236 else 1236 emacs_cv_prog_setfattr=yes
1237 emacs_cv_prog_setfattr=no 1237 else
1238 fi]) 1238 emacs_cv_prog_setfattr=no
1239 if test "$emacs_cv_prog_setfattr" = yes; then 1239 fi])
1240 PAXCTL_notdumped='$(SETFATTR) -n user.pax.flags -v er' 1240 if test "$emacs_cv_prog_setfattr" = yes; then
1241 SETFATTR=setfattr 1241 PAXCTL_notdumped='$(SETFATTR) -n user.pax.flags -v er'
1242 else 1242 SETFATTR=setfattr
1243 SETFATTR= 1243 else
1244 SETFATTR=
1245 fi
1246 rm -f conftest.tmp
1247 AC_SUBST([SETFATTR])
1244 fi 1248 fi
1245 rm -f conftest.tmp
1246 AC_SUBST([SETFATTR])
1247 fi 1249 fi
1248fi 1250 case $opsys,$PAXCTL_notdumped,$emacs_uname_r in
1249case $opsys,$PAXCTL_notdumped,$emacs_uname_r in 1251 gnu-linux,,* | netbsd,,[0-7].*)
1250 gnu-linux,,* | netbsd,,[0-7].*) 1252 AC_PATH_PROG([PAXCTL], [paxctl], [],
1251 AC_PATH_PROG([PAXCTL], [paxctl], [], 1253 [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin])
1252 [$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin]) 1254 if test -n "$PAXCTL"; then
1253 if test -n "$PAXCTL"; then 1255 if test "$opsys" = netbsd; then
1254 if test "$opsys" = netbsd; then 1256 PAXCTL_dumped='$(PAXCTL) +a'
1255 PAXCTL_dumped='$(PAXCTL) +a' 1257 PAXCTL_notdumped=$PAXCTL_dumped
1256 PAXCTL_notdumped=$PAXCTL_dumped 1258 else
1257 else 1259 AC_MSG_CHECKING([whether binaries have a PT_PAX_FLAGS header])
1258 AC_MSG_CHECKING([whether binaries have a PT_PAX_FLAGS header]) 1260 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
1259 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], 1261 [if $PAXCTL -v conftest$EXEEXT >/dev/null 2>&1; then
1260 [if $PAXCTL -v conftest$EXEEXT >/dev/null 2>&1; then 1262 AC_MSG_RESULT([yes])
1261 AC_MSG_RESULT([yes]) 1263 else
1262 else 1264 AC_MSG_RESULT([no])
1263 AC_MSG_RESULT([no]) 1265 PAXCTL=
1264 PAXCTL= 1266 fi])
1265 fi]) 1267 if test -n "$PAXCTL"; then
1266 if test -n "$PAXCTL"; then 1268 PAXCTL_dumped='$(PAXCTL) -zex'
1267 PAXCTL_dumped='$(PAXCTL) -zex' 1269 PAXCTL_notdumped='$(PAXCTL) -r'
1268 PAXCTL_notdumped='$(PAXCTL) -r' 1270 fi
1269 fi 1271 fi
1270 fi 1272 fi;;
1271 fi;; 1273 esac
1272esac 1274fi
1273AC_SUBST([PAXCTL_dumped]) 1275AC_SUBST([PAXCTL_dumped])
1274AC_SUBST([PAXCTL_notdumped]) 1276AC_SUBST([PAXCTL_notdumped])
1275 1277
@@ -5287,19 +5289,25 @@ esac
5287AC_CACHE_CHECK( 5289AC_CACHE_CHECK(
5288 [for $CC option to disable position independent executables], 5290 [for $CC option to disable position independent executables],
5289 [emacs_cv_prog_cc_no_pie], 5291 [emacs_cv_prog_cc_no_pie],
5290 [emacs_save_c_werror_flag=$ac_c_werror_flag 5292 [if test "$CANNOT_DUMP" = yes; then
5291 emacs_save_LDFLAGS=$LDFLAGS 5293 emacs_cv_prog_cc_no_pie='not needed'
5292 ac_c_werror_flag=yes 5294 else
5293 for emacs_cv_prog_cc_no_pie in -no-pie -nopie no; do 5295 emacs_save_c_werror_flag=$ac_c_werror_flag
5294 test $emacs_cv_prog_cc_no_pie = no && break 5296 emacs_save_LDFLAGS=$LDFLAGS
5295 LDFLAGS="$emacs_save_LDFLAGS $emacs_cv_prog_cc_no_pie" 5297 ac_c_werror_flag=yes
5296 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [break]) 5298 for emacs_cv_prog_cc_no_pie in -no-pie -nopie no; do
5297 done 5299 test $emacs_cv_prog_cc_no_pie = no && break
5298 ac_c_werror_flag=$emacs_save_c_werror_flag 5300 LDFLAGS="$emacs_save_LDFLAGS $emacs_cv_prog_cc_no_pie"
5299 LDFLAGS=$emacs_save_LDFLAGS]) 5301 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [break])
5300if test "$emacs_cv_prog_cc_no_pie" != no; then 5302 done
5301 LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS $emacs_cv_prog_cc_no_pie" 5303 ac_c_werror_flag=$emacs_save_c_werror_flag
5302fi 5304 LDFLAGS=$emacs_save_LDFLAGS
5305 fi])
5306case $emacs_cv_prog_cc_no_pie in
5307 -*)
5308 LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS $emacs_cv_prog_cc_no_pie"
5309 ;;
5310esac
5303 5311
5304if test x$ac_enable_profiling != x ; then 5312if test x$ac_enable_profiling != x ; then
5305 case $opsys in 5313 case $opsys in
diff --git a/src/alloc.c b/src/alloc.c
index 7b2140501ec..286358662b9 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -104,7 +104,7 @@ static bool valgrind_p;
104#include "w32heap.h" /* for sbrk */ 104#include "w32heap.h" /* for sbrk */
105#endif 105#endif
106 106
107#ifdef GNU_LINUX 107#if defined GNU_LINUX && !defined CANNOT_DUMP
108/* The address where the heap starts. */ 108/* The address where the heap starts. */
109void * 109void *
110my_heap_start (void) 110my_heap_start (void)