diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-04-16 00:14:11 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-04-16 00:14:42 -0700 |
commit | c6e93df20266fe9f8517f14f3b7c367281f988a5 (patch) | |
tree | 4e3fdc7a3d9e9e65a1e6de0f4cf6862fb27a6412 /configure.ac | |
parent | 3074a9fad1c7c57948521125ee947bfa11ae185b (diff) | |
download | emacs-c6e93df20266fe9f8517f14f3b7c367281f988a5.tar.gz |
Pre-4.6 GCC succeeds with unknown option
* configure.ac (emacs_cv_prog_cc_nopie): Port to pre-4.6 GCC.
Fixes: bug#20338
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index c35e9626611..39f3f9f5f2f 100644 --- a/configure.ac +++ b/configure.ac @@ -5021,18 +5021,19 @@ esac # -nopie fixes a temacs segfault on Gentoo, OpenBSD, and other systems # with "hardened" GCC configurations for some reason (Bug#18784). # We don't know why -nopie works, but not segfaulting is better than -# segfaulting. Use -Werror when trying -nopie, otherwise clang keeps -# warning that it does not understand -nopie. +# segfaulting. Use ac_c_werror_flag=yes when trying -nopie, otherwise +# clang keeps warning that it does not understand -nopie, and pre-4.6 +# GCC has a similar problem (Bug#20338). AC_CACHE_CHECK([whether $CC accepts -nopie], [emacs_cv_prog_cc_nopie], - [emacs_save_CFLAGS=$CFLAGS + [emacs_save_c_werror_flag=$ac_c_werror_flag emacs_save_LDFLAGS=$LDFLAGS - CFLAGS="$CFLAGS -Werror" + ac_c_werror_flag=yes LDFLAGS="$LDFLAGS -nopie" AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [emacs_cv_prog_cc_nopie=yes], [emacs_cv_prog_cc_nopie=no]) - CFLAGS=$emacs_save_CFLAGS + ac_c_werror_flag=$emacs_save_c_werror_flag LDFLAGS=$emacs_save_LDFLAGS]) if test "$emacs_cv_prog_cc_nopie" = yes; then LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS -nopie" |