From af2e3244f56152d94a18c1339a18a4c0b0e33060 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Fri, 26 Jan 2018 08:32:21 +0000 Subject: [PATCH] Configure USE_HIDDEN_LINKONCE on Solaris/x86 gcc/testsuite: * gcc.target/i386/mcount_pic.c: Only xfail get_pc_thunk scan on Solaris 10. * gcc.target/i386/pr63620.c: Likewise. gcc: * config/i386/sol2.h (USE_HIDDEN_LINKONCE): Remove. * configure.ac (hidden_linkonce): New test. * configure: Regenerate. * config.in: Regenerate. From-SVN: r257076 --- gcc/ChangeLog | 7 ++++++ gcc/config.in | 6 +++++ gcc/config/i386/sol2.h | 6 ----- gcc/configure | 29 ++++++++++++++++++++++ gcc/configure.ac | 25 +++++++++++++++++++ gcc/testsuite/ChangeLog | 6 +++++ gcc/testsuite/gcc.target/i386/mcount_pic.c | 2 +- gcc/testsuite/gcc.target/i386/pr63620.c | 2 +- 8 files changed, 75 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f92720c0284..66ae9d189a8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-01-26 Rainer Orth + + * config/i386/sol2.h (USE_HIDDEN_LINKONCE): Remove. + * configure.ac (hidden_linkonce): New test. + * configure: Regenerate. + * config.in: Regenerate. + 2018-01-26 Julia Koval * config/i386/avx512bitalgintrin.h (_mm512_bitshuffle_epi64_mask, diff --git a/gcc/config.in b/gcc/config.in index 5651bcba431..8dc453104c1 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -2207,6 +2207,12 @@ #endif +/* Define 0/1 if your linker supports hidden thunks in linkonce sections. */ +#ifndef USED_FOR_TARGET +#undef USE_HIDDEN_LINKONCE +#endif + + /* Define to 1 if the 'long long' type is wider than 'long' but still efficiently supported by the host hardware. */ #ifndef USED_FOR_TARGET diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h index ae727f0d7ab..41048d23776 100644 --- a/gcc/config/i386/sol2.h +++ b/gcc/config/i386/sol2.h @@ -253,9 +253,3 @@ along with GCC; see the file COPYING3. If not see /* We do not need NT_VERSION notes. */ #undef X86_FILE_START_VERSION_DIRECTIVE #define X86_FILE_START_VERSION_DIRECTIVE false - -/* Only recent versions of Solaris 11 ld properly support hidden .gnu.linkonce - sections, so don't use them. */ -#ifndef USE_GLD -#define USE_HIDDEN_LINKONCE 0 -#endif diff --git a/gcc/configure b/gcc/configure index 376d3410762..f3695adc945 100755 --- a/gcc/configure +++ b/gcc/configure @@ -23798,6 +23798,35 @@ cat >>confdefs.h <<_ACEOF _ACEOF +# Restrict this test to Solaris/x86: other targets define this statically. +case "${target}" in + i?86-*-solaris2* | x86_64-*-solaris2*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking support for hidden thunks in linkonce sections" >&5 +$as_echo_n "checking support for hidden thunks in linkonce sections... " >&6; } + if test $in_tree_ld = yes || echo "$ld_ver" | grep GNU > /dev/null; then + hidden_linkonce=yes + else + case "${target}" in + # Full support for hidden thunks in linkonce sections only appeared in + # Solaris 11/OpenSolaris. + *-*-solaris2.1[1-9]*) + hidden_linkonce=yes + ;; + *) + hidden_linkonce=no + ;; + esac + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hidden_linkonce" >&5 +$as_echo "$hidden_linkonce" >&6; } + +cat >>confdefs.h <<_ACEOF +#define USE_HIDDEN_LINKONCE `if test $hidden_linkonce = yes; then echo 1; else echo 0; fi` +_ACEOF + + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for line table discriminator support" >&5 $as_echo_n "checking assembler for line table discriminator support... " >&6; } if test "${gcc_cv_as_discriminator+set}" = set; then : diff --git a/gcc/configure.ac b/gcc/configure.ac index 6d645fe5412..b7f972868f6 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3070,6 +3070,31 @@ AC_DEFINE_UNQUOTED(HAVE_COMDAT_GROUP, || test $gcc_cv_as_comdat_group_group = yes; then echo 1; else echo 0; fi`], [Define 0/1 if your assembler and linker support COMDAT groups.]) +# Restrict this test to Solaris/x86: other targets define this statically. +case "${target}" in + i?86-*-solaris2* | x86_64-*-solaris2*) + AC_MSG_CHECKING(support for hidden thunks in linkonce sections) + if test $in_tree_ld = yes || echo "$ld_ver" | grep GNU > /dev/null; then + hidden_linkonce=yes + else + case "${target}" in + # Full support for hidden thunks in linkonce sections only appeared in + # Solaris 11/OpenSolaris. + *-*-solaris2.1[[1-9]]*) + hidden_linkonce=yes + ;; + *) + hidden_linkonce=no + ;; + esac + fi + AC_MSG_RESULT($hidden_linkonce) + AC_DEFINE_UNQUOTED(USE_HIDDEN_LINKONCE, + [`if test $hidden_linkonce = yes; then echo 1; else echo 0; fi`], + [Define 0/1 if your linker supports hidden thunks in linkonce sections.]) + ;; +esac + gcc_GAS_CHECK_FEATURE([line table discriminator support], gcc_cv_as_discriminator, [2,19,51],, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 72a0069eb9c..01904c83cb4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-01-26 Rainer Orth + + * gcc.target/i386/mcount_pic.c: Only xfail get_pc_thunk scan on + Solaris 10. + * gcc.target/i386/pr63620.c: Likewise. + 2018-01-26 Julia Koval * gcc.target/i386/avx512bitalg-vpshufbitqmb-1.c: Add -mavx512f -mavx512bw. diff --git a/gcc/testsuite/gcc.target/i386/mcount_pic.c b/gcc/testsuite/gcc.target/i386/mcount_pic.c index 82722a1f8d5..2eccfbd1c90 100644 --- a/gcc/testsuite/gcc.target/i386/mcount_pic.c +++ b/gcc/testsuite/gcc.target/i386/mcount_pic.c @@ -11,5 +11,5 @@ int main () } /* { dg-final { scan-assembler "mcount" } } */ -/* { dg-final { scan-assembler "get_pc_thunk" { xfail { *-*-solaris* && { ! gld } } } } } */ +/* { dg-final { scan-assembler "get_pc_thunk" { xfail { *-*-solaris2.10* && { ! gld } } } } } */ /* { dg-final { cleanup-profile-file } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr63620.c b/gcc/testsuite/gcc.target/i386/pr63620.c index 077a84a58b9..36f6b63f1e8 100644 --- a/gcc/testsuite/gcc.target/i386/pr63620.c +++ b/gcc/testsuite/gcc.target/i386/pr63620.c @@ -17,4 +17,4 @@ test (__float128 x, int p, func f) return x; } -/* { dg-final { scan-assembler "get_pc_thunk" { xfail { *-*-solaris* && { ! gld } } } } } */ +/* { dg-final { scan-assembler "get_pc_thunk" { xfail { *-*-solaris2.10* && { ! gld } } } } } */ -- 2.30.2