mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-17 03:10:58 -08:00
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.
This commit is contained in:
parent
b73f4668ab
commit
99892eeec8
1 changed files with 18 additions and 14 deletions
32
configure.ac
32
configure.ac
|
|
@ -5159,25 +5159,29 @@ case "$opsys" in
|
||||||
*) LD_SWITCH_SYSTEM_TEMACS= ;;
|
*) LD_SWITCH_SYSTEM_TEMACS= ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# -nopie fixes a temacs segfault on Gentoo, OpenBSD, and other systems
|
# -no-pie or -nopie fixes a temacs segfault on Gentoo, OpenBSD,
|
||||||
# with "hardened" GCC configurations for some reason (Bug#18784).
|
# Ubuntu, and other systems with "hardened" GCC configurations for
|
||||||
# We don't know why -nopie works, but not segfaulting is better than
|
# some reason (Bug#18784). We don't know why this works, but not
|
||||||
# segfaulting. Use ac_c_werror_flag=yes when trying -nopie, otherwise
|
# segfaulting is better than segfaulting. Use ac_c_werror_flag=yes
|
||||||
# clang keeps warning that it does not understand -nopie, and pre-4.6
|
# when trying the option, otherwise clang keeps warning that it does
|
||||||
# GCC has a similar problem (Bug#20338).
|
# not understand it, and pre-4.6 GCC has a similar problem
|
||||||
AC_CACHE_CHECK([whether $CC accepts -nopie],
|
# (Bug#20338). Prefer -no-pie to -nopie, as -no-pie is the
|
||||||
[emacs_cv_prog_cc_nopie],
|
# spelling used by GCC 6.1.0 and later (Bug#24682).
|
||||||
|
AC_CACHE_CHECK(
|
||||||
|
[for $CC option to disable position independent executables],
|
||||||
|
[emacs_cv_prog_cc_no_pie],
|
||||||
[emacs_save_c_werror_flag=$ac_c_werror_flag
|
[emacs_save_c_werror_flag=$ac_c_werror_flag
|
||||||
emacs_save_LDFLAGS=$LDFLAGS
|
emacs_save_LDFLAGS=$LDFLAGS
|
||||||
ac_c_werror_flag=yes
|
ac_c_werror_flag=yes
|
||||||
LDFLAGS="$LDFLAGS -nopie"
|
for emacs_cv_prog_cc_no_pie in -no-pie -nopie no; do
|
||||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
|
test $emacs_cv_prog_cc_no_pie = no && break
|
||||||
[emacs_cv_prog_cc_nopie=yes],
|
LDFLAGS="$emacs_save_LDFLAGS $emacs_cv_prog_cc_no_pie"
|
||||||
[emacs_cv_prog_cc_nopie=no])
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [break])
|
||||||
|
done
|
||||||
ac_c_werror_flag=$emacs_save_c_werror_flag
|
ac_c_werror_flag=$emacs_save_c_werror_flag
|
||||||
LDFLAGS=$emacs_save_LDFLAGS])
|
LDFLAGS=$emacs_save_LDFLAGS])
|
||||||
if test "$emacs_cv_prog_cc_nopie" = yes; then
|
if test "$emacs_cv_prog_cc_no_pie" != no; then
|
||||||
LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS -nopie"
|
LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS $emacs_cv_prog_cc_no_pie"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test x$ac_enable_profiling != x ; then
|
if test x$ac_enable_profiling != x ; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue