emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 2d45a5b: configure.ac: Add -nopie to LD_SWITCH_SYST


From: Ulrich Müller
Subject: [Emacs-diffs] master 2d45a5b: configure.ac: Add -nopie to LD_SWITCH_SYSTEM_TEMACS.
Date: Fri, 03 Apr 2015 11:45:54 +0000

branch: master
commit 2d45a5be18ee61e23dfe6af4e23f1eda3595b22c
Author: Ulrich Müller <address@hidden>
Commit: Ulrich Müller <address@hidden>

    configure.ac: Add -nopie to LD_SWITCH_SYSTEM_TEMACS.
    
    * configure.ac (LD_SWITCH_SYSTEM_TEMACS): Add -nopie option if it
    is supported, in order to avoid segfaults in temacs.  (Bug#18784)
---
 ChangeLog    |    5 +++++
 configure.ac |   15 +++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6df5a5a..030ef37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-03  Ulrich Müller  <address@hidden>
+
+       * configure.ac (LD_SWITCH_SYSTEM_TEMACS): Add -nopie option if it
+       is supported, in order to avoid segfaults in temacs.  (Bug#18784)
+
 2015-03-27  Pete Williamson  <address@hidden>  (tiny change)
 
        Add NaCl target
diff --git a/configure.ac b/configure.ac
index 44709d4..d2a9b37 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5027,11 +5027,22 @@ case "$opsys" in
    esac
    ;;
 
-  openbsd) LD_SWITCH_SYSTEM_TEMACS='-nopie' ;;
-
   *) LD_SWITCH_SYSTEM_TEMACS= ;;
 esac
 
+AC_CACHE_CHECK([whether the linker accepts -nopie],
+  [emacs_cv_prog_cc_nopie],
+  [emacs_save_LDFLAGS=$LDFLAGS
+  LDFLAGS="$LDFLAGS -nopie"
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+    [emacs_cv_prog_cc_nopie=yes],
+    [emacs_cv_prog_cc_nopie=no])
+  LDFLAGS=$emacs_save_LDFLAGS])
+if test "$emacs_cv_prog_cc_nopie" = yes; then
+  # Disable PIE to avoid segfaults in temacs (bug#18784)
+  LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS -nopie"
+fi
+
 if test x$ac_enable_profiling != x ; then
   case $opsys in
     *freebsd | gnu-linux) ;;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]