all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ulrich Mueller <ulm@gentoo.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 18784@debbugs.gnu.org
Subject: bug#18784: Coultdn't compile emacs-24.4
Date: Mon, 16 Mar 2015 17:26:32 +0100	[thread overview]
Message-ID: <21767.1080.494409.524340@a1i15.kph.uni-mainz.de> (raw)
In-Reply-To: <jwvegopks3r.fsf-monnier+emacsbugs@gnu.org>

>>>>> On Mon, 16 Mar 2015, Stefan Monnier wrote:

> Hmm... is `-nopie' a linker-option or a compiler-option?
> IOW what about systems which use gcc to compile but something else
> to link or vice-versa?

Right. Also it seems that not all configurations of gcc will recognise
the -nopie option, so we must laboriously test for it. Updated patch
below.


From b3d5b10c10d7062b0da5c8316e787ae554f5c81a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@gentoo.org>
Date: Mon, 16 Mar 2015 17:09:54 +0100
Subject: [PATCH] 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#18780)
---
 ChangeLog    |  5 +++++
 configure.ac | 15 +++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4f6523e..308b889 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-16  Ulrich Müller  <ulm@gentoo.org>
+
+	* configure.ac (LD_SWITCH_SYSTEM_TEMACS): Add -nopie option if it
+	is supported, in order to avoid segfaults in temacs.  (Bug#18780)
+
 2015-03-02  Robert Pluim  <rpluim@gmail.com>  (tiny change)
 
 	* configure.ac: Error out if with-file-notification=w32 is
diff --git a/configure.ac b/configure.ac
index d65494a..40ea5cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4989,11 +4989,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#18780)
+  LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS -nopie"
+fi
+
 if test x$ac_enable_profiling != x ; then
   case $opsys in
     *freebsd | gnu-linux) ;;
-- 
2.3.2






      parent reply	other threads:[~2015-03-16 16:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21 11:52 bug#18784: Coultdn't compile emacs-24.4 Gangræna Gorgeous
2014-10-21 15:16 ` Eli Zaretskii
2014-10-21 15:49   ` David Engster
2015-03-13 19:54 ` Glenn Morris
2015-03-13 20:43   ` Ulrich Mueller
2015-03-13 21:09     ` Ulrich Mueller
2015-03-13 23:25       ` Stefan Monnier
2015-03-16  9:16         ` Ulrich Mueller
2015-03-16 13:09           ` Stefan Monnier
2015-03-16 16:18             ` Eli Zaretskii
2015-03-16 18:19               ` Stefan Monnier
2015-03-16 18:29                 ` Eli Zaretskii
2015-03-16 19:06                   ` Stefan Monnier
2015-03-16 19:34                     ` Eli Zaretskii
2015-03-16 20:04                       ` Ulrich Mueller
2015-03-16 20:29                         ` Stefan Monnier
2015-03-29 12:19                           ` Ulrich Mueller
2015-04-03 11:45                             ` Ulrich Mueller
2015-03-16 16:26             ` Ulrich Mueller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=21767.1080.494409.524340@a1i15.kph.uni-mainz.de \
    --to=ulm@gentoo.org \
    --cc=18784@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.