Two tests scanning for get_pc_thunk were FAILing on Solaris/x86:
FAIL: gcc.target/i386/mcount_pic.c (test for excess errors)
WARNING: gcc.target/i386/mcount_pic.c compilation failed to produce executable
FAIL: gcc.target/i386/mcount_pic.c scan-assembler get_pc_thunk
FAIL: gcc.target/i386/pr63620.c scan-assembler get_pc_thunk
The first one initially failed due to the use of -p: on Solaris, this
requires mcrt1.o, which is only distributed with the Studio compilers,
while gcrt1.o (for -pg) is included either with the OS or comes from
libgcc. On Linux/x86, both -p and -pg work, so I've changed the test to
use the latter.
After that, the scans for get_pc_thunk FAILed, explained by this comment
in i386/sol2.h:
/* 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
The following patch fixes those issues by compiling with -pg and
XFAILing the scan-assembler tests on Solaris/x86 without gld.
Tested with the appropriate runtest invocations on i386-pc-solaris2.11
(with and without gld), and x86_64-unknown-linux-gnu (both 32 and 64-bit
multilibs). Installed on mainline.
Rainer
2014-11-07 Rainer Orth <[email protected]>
* gcc.target/i386/pr63620.c: XFAIL get_pc_thunk scan on
*-*-solaris* && !gld.
* gcc.target/i386/mcount_pic.c: Likewise.
Use -pg.
# HG changeset patch
# Parent aeefb237cf7036cddb5dea755c6cfd987e7c8a0f
Skip gcc.target/i386/mcount_pic.c on Solaris
diff --git a/gcc/testsuite/gcc.target/i386/mcount_pic.c b/gcc/testsuite/gcc.target/i386/mcount_pic.c
--- a/gcc/testsuite/gcc.target/i386/mcount_pic.c
+++ b/gcc/testsuite/gcc.target/i386/mcount_pic.c
@@ -3,7 +3,7 @@
/* { dg-do run } */
/* { dg-require-effective-target fpic } */
/* { dg-require-effective-target ia32 } */
-/* { dg-options "-O2 -fpic -p -save-temps" } */
+/* { dg-options "-O2 -fpic -pg -save-temps" } */
int main ()
{
@@ -11,5 +11,5 @@ int main ()
}
/* { dg-final { scan-assembler "mcount" } } */
-/* { dg-final { scan-assembler "get_pc_thunk" } } */
+/* { dg-final { scan-assembler "get_pc_thunk" { xfail { *-*-solaris* && { ! gld } } } } } */
/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr63620.c b/gcc/testsuite/gcc.target/i386/pr63620.c
--- 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" } } */
+/* { dg-final { scan-assembler "get_pc_thunk" { xfail { *-*-solaris* && { ! gld } } } } } */
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University