summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-10-17 17:55:43 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2018-10-17 17:57:45 -0700
commite511b9dd6a91ef37e87903182578a0d48cbacece (patch)
treea0a55108d3b579f7154d103827dbbcba0d8b6c20 /configure.ac
parent73567432329a245b2eb02e4c61adea2c8eab6b3a (diff)
downloademacs-e511b9dd6a91ef37e87903182578a0d48cbacece.tar.gz
Bring back nocombreloc if dumping
Without this patch, Emacs dumps core on Fedora 28 x86-64 when configured via "CC='gcc -m32' --enable-gcc-warnings --without-imagemagick --without-gif --with-modules PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/share/pkgconfig". and then when run normally in a windowing system. 'make check' and 'emacs -nw' work OK even without the patch. * configure.ac (LD_SWITCH_SYSTEM_TEMACS): Prepend -znocombreloc if supported and if dumping. This mostly reverts 2018-06-15T21:37:39!eggert@cs.ucla.edu "Remove old combreloc hack".
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac33
1 files changed, 33 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index bfd9d5d177c..3a610909026 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1336,6 +1336,37 @@ else
ac_link="$ac_link $NON_GCC_LINK_TEST_OPTIONS"
fi
+dnl On some platforms using GNU ld, linking temacs needs -znocombreloc.
+dnl Although this has something to do with dumping, the details are unknown.
+dnl If the flag is used but not needed,
+dnl Emacs should still work (albeit a bit more slowly),
+dnl so use the flag everywhere that it is supported.
+dnl When testing whether the flag works, treat GCC specially
+dnl since it just gives a non-fatal 'unrecognized option'
+dnl if not built to support GNU ld.
+if test "$GCC" = yes; then
+ LDFLAGS_NOCOMBRELOC="-Wl,-znocombreloc"
+else
+ LDFLAGS_NOCOMBRELOC="-znocombreloc"
+fi
+
+AC_CACHE_CHECK([for -znocombreloc], [emacs_cv_znocombreloc],
+ [if test "$CANNOT_DUMP" = "yes"; then
+ emacs_cv_znocombreloc='not needed'
+ else
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS $LDFLAGS_NOCOMBRELOC"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+ [emacs_cv_znocombreloc=yes], [emacs_cv_znocombreloc=no])
+ LDFLAGS=$save_LDFLAGS
+ fi])
+
+case $emacs_cv_znocombreloc in
+ no*)
+ LDFLAGS_NOCOMBRELOC= ;;
+esac
+
+
AC_CACHE_CHECK([whether addresses are sanitized],
[emacs_cv_sanitize_address],
[AC_COMPILE_IFELSE(
@@ -5346,6 +5377,8 @@ if test x$ac_enable_profiling != x ; then
esac
fi
+LD_SWITCH_SYSTEM_TEMACS="$LDFLAGS_NOCOMBRELOC $LD_SWITCH_SYSTEM_TEMACS"
+
AC_SUBST(LD_SWITCH_SYSTEM_TEMACS)
## Common for all window systems