public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/48447] New: LTO link fails to link libgcc correctly when -nostdlib option is specified
@ 2011-04-05  6:14 patrick at motec dot com.au
  2011-04-05  7:13 ` [Bug lto/48447] " d.g.gorbachev at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: patrick at motec dot com.au @ 2011-04-05  6:14 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: LTO link fails to link libgcc correctly when -nostdlib
                    option is specified
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: patrick@motec.com.au


Created attachment 23879
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23879
Test cases

Not sure if this is a bug with gcc or binutils (ld) but I suspect gcc as test
case 2 succeeds.

Attached are 3 test cases which build a minimal project demonstrating the
following behaviours:

1. Link with LTO and -nostartfiles (succeeds)
2. Link without LTO and -nostdlib, libgcc is specified on the command line
(succeeds)
3. Link with LTO and -nostdlib, libgcc is specified on the command line (fails)

*** TEST 1: LTO with -nostartfiles
powerpc-eabispe-gcc -nostartfiles -flto -fuse-linker-plugin -Os -o test1 crt0.o
main.o -L.
*** TEST 2: no LTO with -nostdlib
powerpc-eabispe-gcc -nostdlib -Os -o test2 crt0.o main.o
/home/patrick/src/e7/toolchain/stage2/lib/gcc/powerpc-eabispe/4.6.0/libgcc.a
*** TEST 3: LTO with -nostdlib
powerpc-eabispe-gcc -nostdlib -flto -fuse-linker-plugin -Os -o test3 crt0.o
main.o
/home/patrick/src/e7/toolchain/stage2/lib/gcc/powerpc-eabispe/4.6.0/libgcc.a
/tmp/ccpXMwiG.ltrans0.ltrans.o: In function `foo.1466':
ccpXMwiG.ltrans0.o:(.text+0x84): undefined reference to `_rest32gpr_29_x'
collect2: ld returned 1 exit status
make: *** [test3] Error 1

Output of gcc -v

patrick@gtr:~/src/patrick/test$ powerpc-eabispe-gcc -v
Using built-in specs.
COLLECT_GCC=powerpc-eabispe-gcc
COLLECT_LTO_WRAPPER=/home/patrick/src/e7/toolchain/stage2/libexec/gcc/powerpc-eabispe/4.6.0/lto-wrapper
Target: powerpc-eabispe
Configured with: /home/patrick/src/e7/toolchain/src/gcc-4.6.0/configure
--prefix=/home/patrick/src/e7/toolchain/stage2 --build=x86_64-unknown-linux-gnu
--host=x86_64-unknown-linux-gnu --target=powerpc-eabispe
--enable-languages=c,c++ --with-sysroot=/home/patrick/src/e7/prex_sysroot
--disable-nls --disable-werror --with-newlib
--with-gmp=/home/patrick/src/e7/toolchain/stage2
--with-mpfr=/home/patrick/src/e7/toolchain/stage2 --disable-shared
--disable-debug --disable-libssp --with-cpu=8540
Thread model: single
gcc version 4.6.0 (GCC)

I have tried this with binutils 2.21 and the latest 2.21.51 development
snapshot.

Please let me know if there is any other information I can provide to assist in
working this out.

Thanks,

    Patrick


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-04-07 22:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-05  6:14 [Bug lto/48447] New: LTO link fails to link libgcc correctly when -nostdlib option is specified patrick at motec dot com.au
2011-04-05  7:13 ` [Bug lto/48447] " d.g.gorbachev at gmail dot com
2011-04-05 11:18 ` rguenth at gcc dot gnu.org
2011-04-05 12:45 ` d.g.gorbachev at gmail dot com
2011-04-06 22:47 ` patrick at motec dot com.au
2011-04-07 15:49 ` davek at gcc dot gnu.org
2011-04-07 15:51 ` davek at gcc dot gnu.org
2011-04-07 18:18 ` d.g.gorbachev at gmail dot com
2011-04-07 22:16 ` patrick at motec dot com.au
2011-04-07 22:23 ` davek at gcc dot gnu.org
2011-04-07 22:50 ` patrick at motec dot com.au

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).