http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45851

           Summary: FAIL: gcc.dg/lto/20090210 link test with WHOPR owing
                    to bad -pthread option.
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: da...@gcc.gnu.org


>From original post at http://gcc.gnu.org/ml/gcc-patches/2010-09/msg01076.html:

On 15/07/2010 19:08, Rainer Orth wrote:

> > * The TLS tests in libobjc failed because they weren't linked with
> >   -pthread.  I've implemented and used dg-add-options tls to handle
> >   this.  Only gcc.dg/lto/20090210_0.c needs an explict
> >   dg-extra-ld-options "-pthread" since dg-lto-do tests don't work with
> >   dg-add-options.

> >     gcc/testsuite:
> >     * gcc.dg/lto/20090210_0.c: Add -pthread for *-*-solaris2.[89].

    Hi Rainer,

  I have a problem on i686-pc-cygwin caused by this part of your patch:

> > diff -r c7b371acdb35 gcc/testsuite/gcc.dg/lto/20090210_0.c
> > --- a/gcc/testsuite/gcc.dg/lto/20090210_0.c Mon Jul 12 16:03:30 2010 +0200
> > +++ b/gcc/testsuite/gcc.dg/lto/20090210_0.c Thu Jul 15 18:27:58 2010 +0200
> > @@ -1,5 +1,7 @@
> >  /* { dg-lto-do run }  */
> >  /* { dg-suppress-ld-options {-fPIC} }  */
> > +/* { dg-require-effective-target tls } */
> > +/* { dg-extra-ld-options "-pthread" { target *-*-solaris2.[89] } } */
> >  int foo (int x)
> >  {
> >    return x;

  As far as I can tell, dg-extra-ld-options doesn't take a target modifier in
the way you've used there, so that "-pthread" is in effect on all targets and
breaks the testcase on targets which don't support that option.  See proc
lto-get-options-main in gcc/testsuite/lto.exp.  Perhaps you could extend it to
work with a target selector?  Or maybe there's some other way you could get
the -pthread flag passed on Solaris (only)?

    cheers,
      DaveK


Here's gcc.log around where the failure occurs:



Executing on host: /gnu/gcc/obj-tfmode-fenv/gcc/xgcc
-B/gnu/gcc/obj-tfmode-fenv/gcc/  -O0 -fwhopr  -c  -o c_lto_20090210_0.o
/gnu/gcc/gcc-unpatched/gcc/testsuite/gcc.dg/lto/20090210_0.c    (timeout = 300)
spawn /gnu/gcc/obj-tfmode-fenv/gcc/xgcc -B/gnu/gcc/obj-tfmode-fenv/gcc/ -O0
-fwhopr -c -o c_lto_20090210_0.o
/gnu/gcc/gcc-unpatched/gcc/testsuite/gcc.dg/lto/20090210_0.c 
PASS: gcc.dg/lto/20090210 c_lto_20090210_0.o assemble, -O0 -fwhopr
Executing on host: /gnu/gcc/obj-tfmode-fenv/gcc/xgcc
-B/gnu/gcc/obj-tfmode-fenv/gcc/  -O0 -fwhopr -fPIC -c  -o c_lto_20090210_1.o
/gnu/gcc/gcc-unpatched/gcc/testsuite/gcc.dg/lto/20090210_1.c    (timeout = 300)
spawn /gnu/gcc/obj-tfmode-fenv/gcc/xgcc -B/gnu/gcc/obj-tfmode-fenv/gcc/ -O0
-fwhopr -fPIC -c -o c_lto_20090210_1.o
/gnu/gcc/gcc-unpatched/gcc/testsuite/gcc.dg/lto/20090210_1.c 
/gnu/gcc/gcc-unpatched/gcc/testsuite/gcc.dg/lto/20090210_1.c:1:0: warning:
-fPIC ignored for target (all code is position independent) [enabled by
default]
output is:
/gnu/gcc/gcc-unpatched/gcc/testsuite/gcc.dg/lto/20090210_1.c:1:0: warning:
-fPIC ignored for target (all code is position independent) [enabled by
default]

PASS: gcc.dg/lto/20090210 c_lto_20090210_1.o assemble, -O0 -fwhopr
Executing on host: /gnu/gcc/obj-tfmode-fenv/gcc/xgcc
-B/gnu/gcc/obj-tfmode-fenv/gcc/ c_lto_20090210_0.o c_lto_20090210_1.o  -O0
-fwhopr -pthread      -o gcc-dg-lto-20090210-01    (timeout = 300)
spawn /gnu/gcc/obj-tfmode-fenv/gcc/xgcc -B/gnu/gcc/obj-tfmode-fenv/gcc/
c_lto_20090210_0.o c_lto_20090210_1.o -O0 -fwhopr -pthread -o
gcc-dg-lto-20090210-01 
xgcc: error: unrecognized option '-pthread'
compiler exited with status 1
output is:
xgcc: error: unrecognized option '-pthread'

FAIL: gcc.dg/lto/20090210 c_lto_20090210_0.o-c_lto_20090210_1.o link, -O0
-fwhopr
UNRESOLVED: gcc.dg/lto/20090210 c_lto_20090210_0.o-c_lto_20090210_1.o execute
-O0 -fwhopr

Reply via email to