As described in the PR, Solaris 10/x86 ld is broken when dealing with
the SHF_MERGE flag, causing the bootstrap to break in strange ways.
Solaris as doesn't support it, but gas does, so only gas/ld builds were
affected.
This patch forces HAVE_GAS_SHF_MERGE to 0 to work around this.
I've massively simplified the scan-assembler statements in
gcc.dg/debug/dwarf2/prod-options.c. According to the original
submission, it is immaterial which concrete syntax is used for
DW_AT_producer, only that it's present in some form.
Bootstrapped on i386-pc-solaris2.10. I've also tested the
prod-options.c part on i386-pc-solaris2.11, sparc-sun-solaris2.11 (as
and gas, which use different alternatives for the DW_AT_producer scan),
and x86_64-pc-linux-gnu.
Will commit to mainline shortly and backport to the gcc-6 and gcc-7
branches after some soak time.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2018-01-28 Rainer Orth <[email protected]>
gcc/testsuite:
PR bootstrap/84017
* gcc.dg/debug/dwarf2/prod-options.c: Simplify DW_AT_producer scan.
gcc:
PR bootstrap/84017
* configure.ac (gcc_cv_as_shf_merge): Disable on Solaris 10/x86.
* configure: Regenerate.
# HG changeset patch
# Parent 1d4d7906b123d09089bb93d9833791c855b52578
Disable SHF_MERGE on Solaris 10/x86 (PR bootstrap/84017)
diff --git a/gcc/configure.ac b/gcc/configure.ac
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2954,6 +2954,14 @@ if test $gcc_cv_as_shf_merge = no; then
[elf,2,12,0], [--fatal-warnings],
[.section .rodata.str, "aMS", %progbits, 1])
fi
+case "$target" in
+ i?86-*-solaris2.10* | x86_64-*-solaris2.10*)
+ # SHF_MERGE support in Solaris 10/x86 ld is broken.
+ if test x"$gnu_ld" = xno; then
+ gcc_cv_as_shf_merge=no
+ fi
+ ;;
+esac
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.])
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c b/gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c
@@ -4,8 +4,7 @@
as well. */
/* { dg-do compile } */
/* { dg-options "-O2 -gdwarf -dA -fdebug-prefix-map=a=b" } */
-/* { dg-final { scan-assembler "DW_AT_producer: \"GNU C" { target { { { ! *-*-solaris2* } || gas } && { { ! hppa*64*-*-* } && { ! powerpc-ibm-aix* } } } } } } */
-/* { dg-final { scan-assembler "\"GNU C\[^\\n\\r\]+ DW_AT_producer" { target { { *-*-solaris2* && { ! gas } } || { hppa*64*-*-* } } } } } */
+/* { dg-final { scan-assembler "DW_AT_producer: \"GNU C|\"GNU C\[^\\n\\r\]+ DW_AT_producer" } } */
/* { dg-final { scan-assembler-not "debug-prefix-map" } } */
void func (void)