>From 3d67ec142099196df17a633da63e772fbe33b4fb Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 17 Oct 2018 17:55:43 -0700 Subject: [PATCH] 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:address@hidden "Remove old combreloc hack". --- configure.ac | 33 +++++++++++++++++++++++++++++++++ etc/PROBLEMS | 12 ++++++++++++ 2 files changed, 45 insertions(+) diff --git a/configure.ac b/configure.ac index bfd9d5d177..3a61090902 100644 --- a/configure.ac +++ b/configure.ac @@ -1336,6 +1336,37 @@ AC_DEFUN 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 @@ AC_DEFUN esac fi +LD_SWITCH_SYSTEM_TEMACS="$LDFLAGS_NOCOMBRELOC $LD_SWITCH_SYSTEM_TEMACS" + AC_SUBST(LD_SWITCH_SYSTEM_TEMACS) ## Common for all window systems diff --git a/etc/PROBLEMS b/etc/PROBLEMS index eba3420fcb..6805e8733d 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -192,6 +192,18 @@ Upgrading to a newer version of Exceed has been reported to prevent these crashes. You should consider switching to a free X server, such as Xming or Cygwin/X. +** Emacs crashes with SIGSEGV in XtInitializeWidgetClass. + +It crashes on X, but runs fine when called with option "-nw". + +This has been observed when Emacs is linked with GNU ld but without passing +the -z nocombreloc flag. Emacs normally knows to pass the -z nocombreloc +flag when needed, so if you come across a situation where the flag is +necessary but missing, please report it via M-x report-emacs-bug. + +On platforms such as Solaris, you can also work around this problem by +configuring your compiler to use the native linker instead of GNU ld. + ** When Emacs is compiled with Gtk+, closing a display kills Emacs. There is a long-standing bug in GTK that prevents it from recovering -- 2.17.2