diff options
| author | Paul Eggert | 2016-10-16 16:25:47 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-10-16 23:16:32 -0700 |
| commit | 99892eeec8990884ef38601f14038ec6dc227741 (patch) | |
| tree | 9ccfc7ebaddd75101ef3a1d417ceb38a223f907c | |
| parent | b73f4668ab685dfb690eced15b20ed47f90efccb (diff) | |
| download | emacs-99892eeec8990884ef38601f14038ec6dc227741.tar.gz emacs-99892eeec8990884ef38601f14038ec6dc227741.zip | |
Port to Ubuntu 16.10, which needs gcc -nopie
* configure.ac (emacs_cv_prog_cc_no_pie): Rename from
emacs_cv_prog_cc_nopie. All usages changed. Check for -no-pie in
preference to -nopie (Bug#24682). Backport from master.
| -rw-r--r-- | configure.ac | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac index 7a697ec3d06..7c115a036db 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -5159,25 +5159,29 @@ case "$opsys" in | |||
| 5159 | *) LD_SWITCH_SYSTEM_TEMACS= ;; | 5159 | *) LD_SWITCH_SYSTEM_TEMACS= ;; |
| 5160 | esac | 5160 | esac |
| 5161 | 5161 | ||
| 5162 | # -nopie fixes a temacs segfault on Gentoo, OpenBSD, and other systems | 5162 | # -no-pie or -nopie fixes a temacs segfault on Gentoo, OpenBSD, |
| 5163 | # with "hardened" GCC configurations for some reason (Bug#18784). | 5163 | # Ubuntu, and other systems with "hardened" GCC configurations for |
| 5164 | # We don't know why -nopie works, but not segfaulting is better than | 5164 | # some reason (Bug#18784). We don't know why this works, but not |
| 5165 | # segfaulting. Use ac_c_werror_flag=yes when trying -nopie, otherwise | 5165 | # segfaulting is better than segfaulting. Use ac_c_werror_flag=yes |
| 5166 | # clang keeps warning that it does not understand -nopie, and pre-4.6 | 5166 | # when trying the option, otherwise clang keeps warning that it does |
| 5167 | # GCC has a similar problem (Bug#20338). | 5167 | # not understand it, and pre-4.6 GCC has a similar problem |
| 5168 | AC_CACHE_CHECK([whether $CC accepts -nopie], | 5168 | # (Bug#20338). Prefer -no-pie to -nopie, as -no-pie is the |
| 5169 | [emacs_cv_prog_cc_nopie], | 5169 | # spelling used by GCC 6.1.0 and later (Bug#24682). |
| 5170 | AC_CACHE_CHECK( | ||
| 5171 | [for $CC option to disable position independent executables], | ||
| 5172 | [emacs_cv_prog_cc_no_pie], | ||
| 5170 | [emacs_save_c_werror_flag=$ac_c_werror_flag | 5173 | [emacs_save_c_werror_flag=$ac_c_werror_flag |
| 5171 | emacs_save_LDFLAGS=$LDFLAGS | 5174 | emacs_save_LDFLAGS=$LDFLAGS |
| 5172 | ac_c_werror_flag=yes | 5175 | ac_c_werror_flag=yes |
| 5173 | LDFLAGS="$LDFLAGS -nopie" | 5176 | for emacs_cv_prog_cc_no_pie in -no-pie -nopie no; do |
| 5174 | AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], | 5177 | test $emacs_cv_prog_cc_no_pie = no && break |
| 5175 | [emacs_cv_prog_cc_nopie=yes], | 5178 | LDFLAGS="$emacs_save_LDFLAGS $emacs_cv_prog_cc_no_pie" |
| 5176 | [emacs_cv_prog_cc_nopie=no]) | 5179 | AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [break]) |
| 5180 | done | ||
| 5177 | ac_c_werror_flag=$emacs_save_c_werror_flag | 5181 | ac_c_werror_flag=$emacs_save_c_werror_flag |
| 5178 | LDFLAGS=$emacs_save_LDFLAGS]) | 5182 | LDFLAGS=$emacs_save_LDFLAGS]) |
| 5179 | if test "$emacs_cv_prog_cc_nopie" = yes; then | 5183 | if test "$emacs_cv_prog_cc_no_pie" != no; then |
| 5180 | LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS -nopie" | 5184 | LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS $emacs_cv_prog_cc_no_pie" |
| 5181 | fi | 5185 | fi |
| 5182 | 5186 | ||
| 5183 | if test x$ac_enable_profiling != x ; then | 5187 | if test x$ac_enable_profiling != x ; then |