[Bug testsuite/42001] New: LTO test failures

View: New views
13 Messages — Rating Filter:   Alert me  

[Bug testsuite/42001] New: LTO test failures

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Linux/ia32, this patch:

http://gcc.gnu.org/ml/gcc-patches/2009-10/msg01547.html

caused:

Executing on host: /export/build/gnu/gcc/build-i686-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-i686-linux/gcc/  -r -nostdlib  -c  -o
c_lto_20081212-1_0.o
/net/gnu-13/export/gnu/src/gcc/gcc/gcc/testsuite/gcc.dg/lto/20081212-1_0.c  
(timeout = 300)
PASS: gcc.dg/lto/20081212-1 c_lto_20081212-1_0.o assemble, -r -nostdlib
Executing on host: /export/build/gnu/gcc/build-i686-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-i686-linux/gcc/ c_lto_20081212-1_0.o  -r
-nostdlib   -lm   -o gcc-dg-lto-20081212-1-01    (timeout = 300)
/usr/local/bin/ld: cannot find -lm^M
collect2: ld returned 1 exit status^M
compiler exited with status 1
output is:
/usr/local/bin/ld: cannot find -lm^M
collect2: ld returned 1 exit status^M

FAIL: gcc.dg/lto/20081212-1 c_lto_20081212-1_0.o-c_lto_20081212-1_0.o link
UNRESOLVED: gcc.dg/lto/20081212-1 c_lto_20081212-1_0.o-c_lto_20081212-1_0.o
execute -r -nostdlib

It may also cause PR 41913.


--
           Summary: LTO test failures
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl dot tools at gmail dot com


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


[Bug testsuite/42001] LTO test failures

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #1 from pinskia at gcc dot gnu dot org  2009-11-11 05:39 -------
A simple test like:
gcc -r t.o t1.o -nostdlib -lm -v -B /home/pinskia/src/gcc/local/gcc/objdir/gcc
Works so I don't know what is going wrong with your build.

The only thing I can think of is that your ld is build incorrectly and does not
include /lib /usr/lib by default.

You are the only one who has this failure from what I can tell from the
testresults too.  See
http://gcc.gnu.org/ml/gcc-testresults/2009-11/msg00875.html for an example
where it works (and yes that includes lto testing too because of the C++
failures).


--


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


[Bug testsuite/42001] LTO test failures

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #2 from hjl dot tools at gmail dot com  2009-11-11 06:02 -------
GNU linker doesn't search any directories when "-r" is used.
Gcc driver doesn't pass explicit search directories to linker:

[hjl@gnu-29 gcc]$ ./xgcc -B./ -v x.o
Reading specs from ./specs
COLLECT_GCC=./xgcc
COLLECT_LTO_WRAPPER=./lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../src-trunk/configure --enable-clocale=gnu --with-system-zlib
--enable-shared --with-demangler-in-ld
Thread model: posix
gcc version 4.5.0 20091110 (experimental) [trunk revision 154081] (GCC)
COMPILER_PATH=./
LIBRARY_PATH=./:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-B./' '-v' '-mtune=generic'
 ./collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2
/usr/lib/crt1.o /usr/lib/crti.o ./crtbegin.o -L. x.o -lgcc --as-needed -lgcc_s
--no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed ./crtend.o
/usr/lib/crtn.o
[hjl@gnu-29 gcc]$ ./xgcc -B./ -r x.o -lm -v
Reading specs from ./specs
COLLECT_GCC=./xgcc
COLLECT_LTO_WRAPPER=./lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../src-trunk/configure --enable-clocale=gnu --with-system-zlib
--enable-shared --with-demangler-in-ld
Thread model: posix
gcc version 4.5.0 20091110 (experimental) [trunk revision 154081] (GCC)
COMPILER_PATH=./
LIBRARY_PATH=./:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-B./' '-r' '-v' '-mtune=generic'
 ./collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -r
/usr/lib/crt1.o /usr/lib/crti.o ./crtbegin.o -L. x.o -lm -lgcc --as-needed
-lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed ./crtend.o
/usr/lib/crtn.o
/usr/local/i686-pc-linux-gnu/bin/ld: cannot find -lm
collect2: ld returned 1 exit status
[hjl@gnu-29 gcc]$

That is why "ld -r -lm" fails.


--


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


[Bug testsuite/42001] LTO test failures

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #3 from hjl dot tools at gmail dot com  2009-11-11 06:05 -------
You have to see it on a machine without multilib support.
Otherwise, gcc driver will pass -L... to linker.


--


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


[Bug testsuite/42001] LTO test failures

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #4 from pinskia at gcc dot gnu dot org  2009-11-11 06:07 -------
It works for me:
pinskia@gcc13:~/src/local$ gcc -r t.o t1.o -nostdlib -lm -v -B
/home/pinskia/src/gcc/local/gcc/objdir/gcc -Wl,-v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --enable-checking=release
x86_64-linux-gnu
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
 /usr/lib/gcc/x86_64-linux-gnu/4.1.2/collect2 --eh-frame-hdr -m elf_x86_64
-dynamic-linker /lib64/ld-linux-x86-64.so.2 -r
-L/usr/lib/gcc/x86_64-linux-gnu/4.1.2 -L/usr/lib/gcc/x86_64-linux-gnu/4.1.2
-L/usr/lib/gcc/x86_64-linux-gnu/4.1.2/../../../../lib64 -L/lib/../lib64
-L/usr/lib/../lib64 t.o t1.o -lm -v
collect2 version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) (x86-64
Linux/ELF)
/usr/bin/ld --eh-frame-hdr -m elf_x86_64 -dynamic-linker
/lib64/ld-linux-x86-64.so.2 -r -L/usr/lib/gcc/x86_64-linux-gnu/4.1.2
-L/usr/lib/gcc/x86_64-linux-gnu/4.1.2
-L/usr/lib/gcc/x86_64-linux-gnu/4.1.2/../../../../lib64 -L/lib/../lib64
-L/usr/lib/../lib64 t.o t1.o -lm -v
GNU ld version 2.17 Debian GNU/Linux

Oh it looks like SPECS difference between x86_64 and i386 ....


--


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


[Bug testsuite/42001] LTO test failures

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #5 from pinskia at gcc dot gnu dot org  2009-11-11 06:08 -------
well most targets are multilibbed now so I never saw it.  I think you should
just remove -lm then .


--


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


[Bug testsuite/42001] LTO tests fail with non multilib targets (but still not --disable-multilib )

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #6 from pinskia at gcc dot gnu dot org  2009-11-11 06:15 -------
Oh multilib.h is correct  for  --disable-multilib case ...


--


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


[Bug testsuite/42001] LTO tests fail with non multilib targets (but still not --disable-multilib )

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #7 from hjl dot tools at gmail dot com  2009-11-11 15:08 -------
(In reply to comment #5)
> well most targets are multilibbed now so I never saw it.  I think you should
> just remove -lm then .
>

-lm is added to most, if not, tests. How do you remove it? Shouldn't
we have both -r and -shared options? We use -r for those targets which
don't support shared libraries.


--


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


[Bug testsuite/42001] LTO tests fail with non multilib targets (but still not --disable-multilib )

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #8 from hjl dot tools at gmail dot com  2009-11-11 20:06 -------
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00566.html


--

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2009-
                   |                            |11/msg00566.html


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


[Bug testsuite/42001] LTO tests fail with non multilib targets (but still not --disable-multilib )

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #9 from hjl at gcc dot gnu dot org  2009-11-11 20:34 -------
Subject: Bug 42001

Author: hjl
Date: Wed Nov 11 20:34:13 2009
New Revision: 154104

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154104
Log:
2009-11-11  H.J. Lu  <hongjiu.lu@...>

        PR testsuite/42001
        * gcc.dg/lto/lto.exp: Pass no-mathlib to lto_init.  Call
        lto_finish at the end.

        * lib/lto.exp (lto_init): Set mathlib to " " for no-mathlib.
        (lto_finish): New. Restore mathlib.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/lto/lto.exp
    trunk/gcc/testsuite/lib/lto.exp


--


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


[Bug testsuite/42001] LTO tests fail with non multilib targets (but still not --disable-multilib )

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #10 from rguenth at gcc dot gnu dot org  2009-11-11 20:37 -------
Fixed?


--


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


[Bug testsuite/42001] LTO tests fail with non multilib targets (but still not --disable-multilib )

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #11 from uros at gcc dot gnu dot org  2009-11-13 09:05 -------
Subject: Bug 42001

Author: uros
Date: Fri Nov 13 09:05:18 2009
New Revision: 154145

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154145
Log:
        PR testsuite/42001
        * g++.dg/lto/lto.exp: Pass no-mathlib to lto_init.  Call
        lto_finish at the end.
        * gfortran.dg/lto/lto.exp: Ditto.


Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/lto/lto.exp
    trunk/gcc/testsuite/gfortran.dg/lto/lto.exp


--


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


[Bug testsuite/42001] LTO tests fail with non multilib targets (but still not --disable-multilib )

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #12 from ubizjak at gmail dot com  2009-11-13 09:11 -------
Fixed.


--

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.5.0


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