diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2013-08-07 13:54:01 +0800 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2013-08-07 13:58:28 +0800 |
commit | 5e6cdf76af295c9a39b695ca228cff675e8ff4ae (patch) | |
tree | 9822016264ef3488c1a80bf220d891cf34238627 /gcc-4.8/gcc/configure | |
parent | 34cef20a1108ff399ecbe13f42e1f6bc8c909b27 (diff) | |
download | toolchain_gcc-5e6cdf76af295c9a39b695ca228cff675e8ff4ae.tar.gz toolchain_gcc-5e6cdf76af295c9a39b695ca228cff675e8ff4ae.tar.bz2 toolchain_gcc-5e6cdf76af295c9a39b695ca228cff675e8ff4ae.zip |
[4.8] Always enable --eh-frame-hdr for static executable
See 23e3137ee2897464b051599b85a09f130d3ad05d for the reason why
Port patch from http://gcc.gnu.org/ml/gcc-patches/2012-09/msg00969.html
gcc/
2012-09-14 H.J. Lu <hongjiu.lu@intel.com>
PR debug/54568
* configure.ac: Add --enable-eh-frame-hdr-for-static. Set
USE_EH_FRAME_HDR_FOR_STATIC if PT_GNU_EH_FRAME is supported for
static executable.
* config.in: Regenerated.
* configure: Likewise.
* config/gnu-user.h (LINK_EH_SPEC): Defined as "--eh-frame-hdr "
if USE_EH_FRAME_HDR_FOR_STATIC is defined.
* config/sol2.h (LINK_EH_SPEC): Likewise.
* config/openbsd.h (LINK_EH_SPEC): Likewise.
* config/alpha/elf.h (LINK_EH_SPEC): Likewise.
* config/freebsd.h (LINK_EH_SPEC): Likewise.
* config/rs6000/sysv4.h (LINK_EH_SPEC): Likewise.
gcc/testsuite/
2012-09-13 H.J. Lu <hongjiu.lu@intel.com>
PR debug/54568
* g++.dg/eh/spec3-static.C: New test.
libgcc/
2012-09-14 H.J. Lu <hongjiu.lu@intel.com>
PR debug/54568
* crtstuff.c (USE_PT_GNU_EH_FRAME): Check CRTSTUFFT_O together
with USE_EH_FRAME_HDR_FOR_STATIC.
Change-Id: If442d27eeb1347ac5a1b943acbbeff5f708a9929
Diffstat (limited to 'gcc-4.8/gcc/configure')
-rwxr-xr-x | gcc-4.8/gcc/configure | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/configure b/gcc-4.8/gcc/configure index 1ea9b9ec7..1e9bfd184 100755 --- a/gcc-4.8/gcc/configure +++ b/gcc-4.8/gcc/configure @@ -911,6 +911,7 @@ enable_gnu_indirect_function enable_initfini_array enable_comdat enable_gnu_unique_object +enable_eh_frame_hdr_for_static enable_linker_build_id with_long_double_128 with_gc @@ -1622,6 +1623,9 @@ Optional Features: --enable-gnu-unique-object enable the use of the @gnu_unique_object ELF extension on glibc systems + --enable-eh-frame-hdr-for-static + enable linker PT_GNU_EH_FRAME support for static + executable --enable-linker-build-id compiler will always pass --build-id to linker --enable-maintainer-mode @@ -26284,6 +26288,38 @@ if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then $as_echo "#define HAVE_LD_EH_FRAME_HDR 1" >>confdefs.h + # Check whether --enable-eh-frame-hdr-for-static was given. +if test "${enable_eh_frame_hdr_for_static+set}" = set; then : + enableval=$enable_eh_frame_hdr_for_static; case $enable_eh_frame_hdr_for_static in + yes | no) ;; + *) as_fn_error "'$enable_eh_frame_hdr_for_static' is an invalid +value for --enable-eh-frame-hdr-for-static. +Valid choices are 'yes' and 'no'." "$LINENO" 5 ;; + esac +else + # Only support for glibc 2.3.0 or higher with AT_PHDR/AT_PHNUM from +# Linux kernel. + if test x$host = x$build -a x$host = x$target && + ldd --version 2>&1 >/dev/null && + glibcver=`ldd --version 2>/dev/null | sed 's/.* //;q'`; then + glibcmajor=`expr "$glibcver" : "\([0-9]*\)"` + glibcminor=`expr "$glibcver" : "[2-9]*\.\([0-9]*\)"` + glibcnum=`expr $glibcmajor \* 1000 + $glibcminor` + if test "$glibcnum" -ge 2003 ; then + auvx=`LD_SHOW_AUXV=1 ldd 2>/dev/null` + if echo "$auvx" | grep AT_PHDR > /dev/null && + echo "$auvx" | grep AT_PHNUM > /dev/null; then + enable_eh_frame_hdr_for_static=yes + fi + fi + fi +fi + + if test x$enable_eh_frame_hdr_for_static = xyes; then + +$as_echo "#define USE_EH_FRAME_HDR_FOR_STATIC 1" >>confdefs.h + + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_eh_frame_hdr" >&5 $as_echo "$gcc_cv_ld_eh_frame_hdr" >&6; } |