diff options
author | ro <ro@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-23 12:08:21 +0000 |
---|---|---|
committer | ro <ro@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-23 12:08:21 +0000 |
commit | bdd793b231c5454437e28d91ecda885a83819e66 (patch) | |
tree | 5a2534c26dcca183ded5325723da202b9e3ced1c /gcc/configure.ac | |
parent | 6bd88b86b4b1a4d3adc1b51f33a23191dd268d32 (diff) | |
download | gcc-bdd793b231c5454437e28d91ecda885a83819e66.tar.gz |
* configure.ac (gcc_cv_ld_eh_frame_hdr): Only check GNU ld for
--eh-frame-hdr.
Check for working Sun ld version.
(HAVE_LD_EH_FRAME_HDR): Adapt comment.
(glibc_header_dir): Set only once.
Rename to ...
(target_header_dir): ... this.
Adapt users.
(gcc_cv_target_dl_iterate_frame_hdr): Check on *-*-solaris2*.
(TARGET_DL_ITERATE_PHDR): Define if present.
* configure: Regenerate.
* config.in: Likewise.
* config/t-sol2 (LIB2ADDEH, LIB2ADDEHDEP): Define.
* crtstuff.c (USE_PT_GNU_EH_FRAME): Define for recent Solaris 11
with linker support and dl_iterate_phdr.
* unwind-dw2-fde-glibc.c (USE_PT_GNU_EH_FRAME): Likewise.
(_Unwind_IteratePhdrCallback) [PT_SUNW_UNWIND]: Also accept
PT_SUNW_UNWIND .eh_frame_hdr sections.
[CRT_GET_RFIB_DATA && __i386__ && __sun__ && __svr4__]: Add
load_base to data->dbase.
[CRT_GET_RFIB_DATA && __x86_64__ && __sun__ && __svr4__]: Handle
64-bit Solaris 10+/x86.
* config/sol2-gld.h [TARGET_DL_ITERATE_PHDR && HAVE_LD_EH_FRAME_HDR]
(LINK_EH_SPEC): Define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168204 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/configure.ac')
-rw-r--r-- | gcc/configure.ac | 104 |
1 files changed, 62 insertions, 42 deletions
diff --git a/gcc/configure.ac b/gcc/configure.ac index 166500e3110..ad8d008837b 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3930,15 +3930,26 @@ if test $in_tree_ld = yes ; then gcc_cv_ld_eh_frame_hdr=yes fi elif test x$gcc_cv_ld != x; then - # Check if linker supports --eh-frame-hdr option - if $gcc_cv_ld --help 2>/dev/null | grep eh-frame-hdr > /dev/null; then - gcc_cv_ld_eh_frame_hdr=yes - fi + if echo "$ld_ver" | grep GNU > /dev/null; then + # Check if linker supports --eh-frame-hdr option + if $gcc_cv_ld --help 2>/dev/null | grep eh-frame-hdr > /dev/null; then + gcc_cv_ld_eh_frame_hdr=yes + fi + else + case "$target" in + *-*-solaris2*) + # Sun ld has various bugs in .eh_frame_hdr support before version 1.2249. + if test "$ld_vers_major" -gt 1 || test "$ld_vers_minor" -ge 2249; then + gcc_cv_ld_eh_frame_hdr=yes + fi + ;; + esac + fi fi GCC_TARGET_TEMPLATE([HAVE_LD_EH_FRAME_HDR]) if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then AC_DEFINE(HAVE_LD_EH_FRAME_HDR, 1, -[Define if your linker supports --eh-frame-hdr option.]) +[Define if your linker supports .eh_frame_hdr.]) fi AC_MSG_RESULT($gcc_cv_ld_eh_frame_hdr) @@ -4219,45 +4230,46 @@ if test x$with_sysroot = x && test x$host = x$target \ [Define to PREFIX/include if cpp should also search that directory.]) fi +if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then + if test "x$with_headers" != x; then + target_header_dir=$with_headers + elif test "x$with_sysroot" = x; then + target_header_dir="${exec_prefix}/${target_noncanonical}/sys-include" + elif test "x$with_build_sysroot" != "x"; then + target_header_dir="${with_build_sysroot}/usr/include" + elif test "x$with_sysroot" = xyes; then + target_header_dir="${exec_prefix}/${target_noncanonical}/sys-root/usr/include" + else + target_header_dir="${with_sysroot}/usr/include" + fi +else + target_header_dir=/usr/include +fi + # Test for stack protector support in target C library. AC_CACHE_CHECK(__stack_chk_fail in target C library, gcc_cv_libc_provides_ssp, [gcc_cv_libc_provides_ssp=no case "$target" in *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then - if test "x$with_headers" != x; then - glibc_header_dir=$with_headers - elif test "x$with_sysroot" = x; then - glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-include" - elif test "x$with_build_sysroot" != "x"; then - glibc_header_dir="${with_build_sysroot}/usr/include" - elif test "x$with_sysroot" = xyes; then - glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-root/usr/include" - else - glibc_header_dir="${with_sysroot}/usr/include" - fi - else - glibc_header_dir=/usr/include - fi [# glibc 2.4 and later provides __stack_chk_fail and # either __stack_chk_guard, or TLS access to stack guard canary. - if test -f $glibc_header_dir/features.h \ + if test -f $target_header_dir/features.h \ && $EGREP '^[ ]*#[ ]*define[ ]+__GNU_LIBRARY__[ ]+([1-9][0-9]|[6-9])' \ - $glibc_header_dir/features.h > /dev/null; then + $target_header_dir/features.h > /dev/null; then if $EGREP '^[ ]*#[ ]*define[ ]+__GLIBC__[ ]+([1-9][0-9]|[3-9])' \ - $glibc_header_dir/features.h > /dev/null; then + $target_header_dir/features.h > /dev/null; then gcc_cv_libc_provides_ssp=yes elif $EGREP '^[ ]*#[ ]*define[ ]+__GLIBC__[ ]+2' \ - $glibc_header_dir/features.h > /dev/null \ + $target_header_dir/features.h > /dev/null \ && $EGREP '^[ ]*#[ ]*define[ ]+__GLIBC_MINOR__[ ]+([1-9][0-9]|[4-9])' \ - $glibc_header_dir/features.h > /dev/null; then + $target_header_dir/features.h > /dev/null; then gcc_cv_libc_provides_ssp=yes elif $EGREP '^[ ]*#[ ]*define[ ]+__UCLIBC__[ ]+1' \ - $glibc_header_dir/features.h > /dev/null && \ - test -f $glibc_header_dir/bits/uClibc_config.h && \ + $target_header_dir/features.h > /dev/null && \ + test -f $target_header_dir/bits/uClibc_config.h && \ $EGREP '^[ ]*#[ ]*define[ ]+__UCLIBC_HAS_SSP__[ ]+1' \ - $glibc_header_dir/bits/uClibc_config.h > /dev/null; then + $target_header_dir/bits/uClibc_config.h > /dev/null; then gcc_cv_libc_provides_ssp=yes fi fi] @@ -4293,21 +4305,8 @@ case "$target" in [ --with-long-double-128 Use 128-bit long double by default.], gcc_cv_target_ldbl128="$with_long_double_128", [[gcc_cv_target_ldbl128=no - if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then - if test "x$with_sysroot" = x; then - glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-include" - elif test "x$with_build_sysroot" != "x"; then - glibc_header_dir="${with_build_sysroot}/usr/include" - elif test "x$with_sysroot" = xyes; then - glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-root/usr/include" - else - glibc_header_dir="${with_sysroot}/usr/include" - fi - else - glibc_header_dir=/usr/include - fi grep '^[ ]*#[ ]*define[ ][ ]*__LONG_DOUBLE_MATH_OPTIONAL' \ - $glibc_header_dir/bits/wordsize.h > /dev/null 2>&1 \ + $target_header_dir/bits/wordsize.h > /dev/null 2>&1 \ && gcc_cv_target_ldbl128=yes ]]) ;; @@ -4317,6 +4316,27 @@ if test x$gcc_cv_target_ldbl128 = xyes; then [Define if TFmode long double should be the default]) fi +AC_MSG_CHECKING(dl_iterate_phdr in target C library) +gcc_cv_target_dl_iterate_phdr=unknown +case "$target" in + *-*-solaris2*) + # <link.h> needs both a dl_iterate_phdr declaration and support for + # compilation with largefile support. + if grep dl_iterate_phdr $target_header_dir/link.h > /dev/null 2>&1 \ + && grep 'large file capable' $target_header_dir/link.h > /dev/null 2>&1; then + gcc_cv_target_dl_iterate_phdr=yes + else + gcc_cv_target_dl_iterate_phdr=no + fi + ;; +esac +GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR]) +if test x$gcc_cv_target_dl_iterate_phdr = xyes; then + AC_DEFINE(TARGET_DL_ITERATE_PHDR, 1, +[Define if your target C library provides the `dl_iterate_phdr' function.]) +fi +AC_MSG_RESULT($gcc_cv_target_dl_iterate_phdr) + # Find out what GC implementation we want, or may, use. AC_ARG_WITH(gc, [ --with-gc={page,zone} choose the garbage collection mechanism to use |