diff options
| author | Paul Eggert | 2016-10-16 16:25:47 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-10-16 16:53:03 -0700 |
| commit | 032a299b0ed25f067f4133c547a822b283bc4cb8 (patch) | |
| tree | 3cd9c7f0be803730955e88f47fdc3d8e1f6a7943 | |
| parent | 3ed8100f77a25170bf7953217d0f2b919934465b (diff) | |
| download | emacs-032a299b0ed25f067f4133c547a822b283bc4cb8.tar.gz emacs-032a299b0ed25f067f4133c547a822b283bc4cb8.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).
| -rw-r--r-- | configure.ac | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac index cd11b10c00a..3f06eff0033 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -5123,25 +5123,29 @@ case "$opsys" in | |||
| 5123 | *) LD_SWITCH_SYSTEM_TEMACS= ;; | 5123 | *) LD_SWITCH_SYSTEM_TEMACS= ;; |
| 5124 | esac | 5124 | esac |
| 5125 | 5125 | ||
| 5126 | # -nopie fixes a temacs segfault on Gentoo, OpenBSD, and other systems | 5126 | # -no-pie or -nopie fixes a temacs segfault on Gentoo, OpenBSD, |
| 5127 | # with "hardened" GCC configurations for some reason (Bug#18784). | 5127 | # Ubuntu, and other systems with "hardened" GCC configurations for |
| 5128 | # We don't know why -nopie works, but not segfaulting is better than | 5128 | # some reason (Bug#18784). We don't know why this works, but not |
| 5129 | # segfaulting. Use ac_c_werror_flag=yes when trying -nopie, otherwise | 5129 | # segfaulting is better than segfaulting. Use ac_c_werror_flag=yes |
| 5130 | # clang keeps warning that it does not understand -nopie, and pre-4.6 | 5130 | # when trying the option, otherwise clang keeps warning that it does |
| 5131 | # GCC has a similar problem (Bug#20338). | 5131 | # not understand it, and pre-4.6 GCC has a similar problem |
| 5132 | AC_CACHE_CHECK([whether $CC accepts -nopie], | 5132 | # (Bug#20338). Prefer -no-pie to -nopie, as -no-pie is the |
| 5133 | [emacs_cv_prog_cc_nopie], | 5133 | # spelling used by GCC 6.1.0 and later (Bug#24682). |
| 5134 | AC_CACHE_CHECK( | ||
| 5135 | [for $CC option to disable position independent executables], | ||
| 5136 | [emacs_cv_prog_cc_no_pie], | ||
| 5134 | [emacs_save_c_werror_flag=$ac_c_werror_flag | 5137 | [emacs_save_c_werror_flag=$ac_c_werror_flag |
| 5135 | emacs_save_LDFLAGS=$LDFLAGS | 5138 | emacs_save_LDFLAGS=$LDFLAGS |
| 5136 | ac_c_werror_flag=yes | 5139 | ac_c_werror_flag=yes |
| 5137 | LDFLAGS="$LDFLAGS -nopie" | 5140 | for emacs_cv_prog_cc_no_pie in -no-pie -nopie no; do |
| 5138 | AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], | 5141 | test $emacs_cv_prog_cc_no_pie = no && break |
| 5139 | [emacs_cv_prog_cc_nopie=yes], | 5142 | LDFLAGS="$emacs_save_LDFLAGS $emacs_cv_prog_cc_no_pie" |
| 5140 | [emacs_cv_prog_cc_nopie=no]) | 5143 | AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [break]) |
| 5144 | done | ||
| 5141 | ac_c_werror_flag=$emacs_save_c_werror_flag | 5145 | ac_c_werror_flag=$emacs_save_c_werror_flag |
| 5142 | LDFLAGS=$emacs_save_LDFLAGS]) | 5146 | LDFLAGS=$emacs_save_LDFLAGS]) |
| 5143 | if test "$emacs_cv_prog_cc_nopie" = yes; then | 5147 | if test "$emacs_cv_prog_cc_no_pie" != no; then |
| 5144 | LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS -nopie" | 5148 | LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS $emacs_cv_prog_cc_no_pie" |
| 5145 | fi | 5149 | fi |
| 5146 | 5150 | ||
| 5147 | if test x$ac_enable_profiling != x ; then | 5151 | if test x$ac_enable_profiling != x ; then |