aboutsummaryrefslogtreecommitdiff
path: root/gcc/configure.ac
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2011-05-19 14:29:05 +0000
committerRainer Orth <ro@gcc.gnu.org>2011-05-19 14:29:05 +0000
commit2ca48caa2c83ba7ba516a227788b2e86f8ca74ec (patch)
tree126d3363c833de58bd88e73fd92d6cd7e70bb915 /gcc/configure.ac
parentea93a47bc825a409079665551203aa194e71fc18 (diff)
downloadgcc-2ca48caa2c83ba7ba516a227788b2e86f8ca74ec.zip
gcc-2ca48caa2c83ba7ba516a227788b2e86f8ca74ec.tar.gz
gcc-2ca48caa2c83ba7ba516a227788b2e86f8ca74ec.tar.bz2
re PR target/40483 (gcc 4.x needs to utilize better COMDAT mechanism under Solaris)
PR target/40483 * configure.ac (gcc_cv_as_comdat_group_group): Check for Sun as COMDAT group syntax, both SPARC and x86 variants. (HAVE_COMDAT_GROUP): Also define if gcc_cv_as_comdat_group_group. * configure: Regenerate. * config/sol2.h (TARGET_SOLARIS): Define. (PUSHSECTION_FORMAT): Remove. (SECTION_NAME_FORMAT): Define. * config/sol2.c: Include hashtab.h. (solaris_output_init_fini): Replace PUSHSECTION_FORMAT by its expansion, using SECTION_NAME_FORMAT. (solaris_comdat_htab): New variable. (struct comdat_entry): Define. (comdat_hash): New function. (comdat_eq): New function. (solaris_elf_asm_comdat_section): New function. (solaris_define_comdat_signature): New function. (solaris_code_end): New function. * config/sol2-protos.h (solaris_elf_asm_comdat_section): Declare. (solaris_code_end): Declare. * config/t-sol2 (sol2.o): Add $HASHTAB_H dependency. * config/i386/i386.c (ix86_code_end) [TARGET_SOLARIS]: Call solaris_code_end. (i386_solaris_elf_named_section): Wrap in TARGET_SOLARIS. Remove ATTRIBUTE_UNUSED. [!USE_GAS]: Call solaris_elf_asm_comdat_section for SECTION_LINKONCE sections if HAVE_COMDAT_GROUP. * config/sparc/sparc.c (sparc_solaris_elf_asm_named_section): Likewise. * config/i386/sol2-10.h (TARGET_ASM_NAMED_SECTION): Moved ... * config/i386/sol2.h (TARGET_ASM_NAMED_SECTION): ... here. * config/sparc/sol2.h (TARGET_ASM_CODE_END): Redefine. (PUSHSECTION_FORMAT): Remove. (SECTION_NAME_FORMAT): Redefine. From-SVN: r173913
Diffstat (limited to 'gcc/configure.ac')
-rw-r--r--gcc/configure.ac55
1 files changed, 47 insertions, 8 deletions
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 87b7120..ff6d5e9 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2589,15 +2589,48 @@ AC_DEFINE_UNQUOTED(HAVE_GAS_SHF_MERGE,
[`if test $gcc_cv_as_shf_merge = yes; then echo 1; else echo 0; fi`],
[Define 0/1 if your assembler supports marking sections with SHF_MERGE flag.])
-gcc_GAS_CHECK_FEATURE(COMDAT group support, gcc_cv_as_comdat_group,
+gcc_GAS_CHECK_FEATURE([COMDAT group support (GNU as)],
+ gcc_cv_as_comdat_group,
[elf,2,16,0], [--fatal-warnings],
[.section .text,"axG",@progbits,.foo,comdat])
if test $gcc_cv_as_comdat_group = yes; then
gcc_cv_as_comdat_group_percent=no
+ gcc_cv_as_comdat_group_group=no
else
- gcc_GAS_CHECK_FEATURE(COMDAT group support, gcc_cv_as_comdat_group_percent,
+ gcc_GAS_CHECK_FEATURE([COMDAT group support (GNU as, %type)],
+ gcc_cv_as_comdat_group_percent,
[elf,2,16,0], [--fatal-warnings],
[.section .text,"axG",%progbits,.foo,comdat])
+ if test $gcc_cv_as_comdat_group_percent = yes; then
+ gcc_cv_as_comdat_group_group=no
+ else
+ case "${target}" in
+ # Sun as uses a completely different syntax.
+ *-*-solaris2*)
+ case "${target}" in
+ sparc*-*-solaris2*)
+ conftest_s='
+ .group foo,".text%foo",#comdat
+ .section ".text%foo", #alloc,#execinstr,#progbits
+ .globl foo
+ foo:
+ '
+ ;;
+ i?86-*-solaris2*)
+ conftest_s='
+ .group foo,.text%foo,#comdat
+ .section .text%foo, "ax", @progbits
+ .globl foo
+ foo:
+ '
+ ;;
+ esac
+ gcc_GAS_CHECK_FEATURE([COMDAT group support (Sun as, .group)],
+ gcc_cv_as_comdat_group_group,
+ ,, [$conftest_s])
+ ;;
+ esac
+ fi
fi
if test x"$ld_is_gold" = xyes; then
comdat_group=yes
@@ -2623,16 +2656,19 @@ else
changequote(,)dnl
case "${target}" in
*-*-solaris2.1[1-9]*)
+ comdat_group=no
# Sun ld has COMDAT group support since Solaris 9, but it doesn't
# interoperate with GNU as until Solaris 11 build 130, i.e. ld
# version 1.688.
#
- # FIXME: Maybe need to refine later when COMDAT group support with
- # Sun as is implemented.
- if test "$ld_vers_major" -gt 1 || test "$ld_vers_minor" -ge 1688; then
+ # If using Sun as for COMDAT group as emitted by GCC, one needs at
+ # least ld version 1.2267.
+ if test "$ld_vers_major" -gt 1; then
comdat_group=yes
- else
- comdat_group=no
+ elif test "x$gas_flag" = xyes && test "$ld_vers_minor" -ge 1688; then
+ comdat_group=yes
+ elif test "$ld_vers_minor" -ge 2267; then
+ comdat_group=yes
fi
;;
*)
@@ -2649,9 +2685,12 @@ AC_ARG_ENABLE(comdat,
if test $comdat_group = no; then
gcc_cv_as_comdat_group=no
gcc_cv_as_comdat_group_percent=no
+ gcc_cv_as_comdat_group_group=no
fi
AC_DEFINE_UNQUOTED(HAVE_COMDAT_GROUP,
- [`if test $gcc_cv_as_comdat_group = yes || test $gcc_cv_as_comdat_group_percent = yes; then echo 1; else echo 0; fi`],
+ [`if test $gcc_cv_as_comdat_group = yes \
+ || test $gcc_cv_as_comdat_group_percent = yes \
+ || 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.])
gcc_GAS_CHECK_FEATURE([line table discriminator support],