public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/44802]  New: -flto -fuse-linker-plugin causes undefined references from libc in the link phase
@ 2010-07-03 12:31 moonshine at kapsi dot fi
  2010-07-03 12:32 ` [Bug lto/44802] " moonshine at kapsi dot fi
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: moonshine at kapsi dot fi @ 2010-07-03 12:31 UTC (permalink / raw)
  To: gcc-bugs

This works fine without -fuse-linker-plugin (with all object files extracted
from archive). This reduced testcase has some undefined references of its own
but still exposes the bug as shown below. Whole output of linking a complete
program is attached because of its 30 kB size. Also a preprocessed source file
is attached.

gcc -std=gnu99 -fvisibility=hidden -O3 -fomit-frame-pointer -march=pentium4
-flto -fuse-linker-plugin -o xz main.i

--SNAP--
/home/misty/gcc/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../i686-pc-linux-gnu/bin/ld:
error: hidden symbol 'fgetc' is not defined locally
/home/misty/gcc/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../i686-pc-linux-gnu/bin/ld:
error: hidden symbol 'ferror' is not defined locally
--SNAP--

main.i was produced with:

gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. 
-DLOCALEDIR=\"/home/misty/gcc/share/locale\" -I../../src/common
-I../../src/liblzma/api -I../../lib -DLZMA_API_STATIC  -pthread
-fvisibility=hidden -Wall -Wextra -Wformat=2 -Winit-self -Wmissing-include-dirs
-Wstrict-aliasing -Wfloat-equal -Wundef -Wshadow -Wpointer-arith
-Wbad-function-cast -Wwrite-strings -Wlogical-op -Waggregate-return
-Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes
-Wmissing-declarations -Wmissing-noreturn -Wredundant-decls -O3
-fomit-frame-pointer -march=pentium4 -flto -fuse-linker-plugin -MT xz-main.o
-MD -MP -MF .deps/xz-main.Tpo -E main.c >main.i


-- 
           Summary: -flto -fuse-linker-plugin causes undefined references
                    from libc in the link phase
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: moonshine at kapsi dot fi
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug lto/44802] -flto -fuse-linker-plugin causes undefined references from libc in the link phase
  2010-07-03 12:31 [Bug lto/44802] New: -flto -fuse-linker-plugin causes undefined references from libc in the link phase moonshine at kapsi dot fi
@ 2010-07-03 12:32 ` moonshine at kapsi dot fi
  2010-07-03 12:33 ` moonshine at kapsi dot fi
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: moonshine at kapsi dot fi @ 2010-07-03 12:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from moonshine at kapsi dot fi  2010-07-03 12:32 -------
Created an attachment (id=21076)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21076&action=view)
full error message


-- 


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


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

* [Bug lto/44802] -flto -fuse-linker-plugin causes undefined references from libc in the link phase
  2010-07-03 12:31 [Bug lto/44802] New: -flto -fuse-linker-plugin causes undefined references from libc in the link phase moonshine at kapsi dot fi
  2010-07-03 12:32 ` [Bug lto/44802] " moonshine at kapsi dot fi
@ 2010-07-03 12:33 ` moonshine at kapsi dot fi
  2010-07-03 13:35 ` moonshine at kapsi dot fi
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: moonshine at kapsi dot fi @ 2010-07-03 12:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from moonshine at kapsi dot fi  2010-07-03 12:33 -------
Created an attachment (id=21077)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21077&action=view)
a testcase


-- 


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


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

* [Bug lto/44802] -flto -fuse-linker-plugin causes undefined references from libc in the link phase
  2010-07-03 12:31 [Bug lto/44802] New: -flto -fuse-linker-plugin causes undefined references from libc in the link phase moonshine at kapsi dot fi
  2010-07-03 12:32 ` [Bug lto/44802] " moonshine at kapsi dot fi
  2010-07-03 12:33 ` moonshine at kapsi dot fi
@ 2010-07-03 13:35 ` moonshine at kapsi dot fi
  2010-07-08  2:03 ` moonshine at kapsi dot fi
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: moonshine at kapsi dot fi @ 2010-07-03 13:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from moonshine at kapsi dot fi  2010-07-03 13:35 -------
On trunk the same link command fails too, but in a different way. I was able to
produce a reduced testcase and filed a new report as these issues are probably
not related.

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


-- 


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


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

* [Bug lto/44802] -flto -fuse-linker-plugin causes undefined references from libc in the link phase
  2010-07-03 12:31 [Bug lto/44802] New: -flto -fuse-linker-plugin causes undefined references from libc in the link phase moonshine at kapsi dot fi
                   ` (2 preceding siblings ...)
  2010-07-03 13:35 ` moonshine at kapsi dot fi
@ 2010-07-08  2:03 ` moonshine at kapsi dot fi
  2010-07-26 21:14 ` hubicka at gcc dot gnu dot org
  2010-07-27 12:42 ` moonshine at kapsi dot fi
  5 siblings, 0 replies; 7+ messages in thread
From: moonshine at kapsi dot fi @ 2010-07-08  2:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from moonshine at kapsi dot fi  2010-07-08 02:02 -------
(In reply to comment #3)

Bug mentioned in #3 was fixed on the mainline, so now this issue manifests
itself on trunk also. The difficulty is that a complete testcase would be to
build xz, the smaller case I added is unfortunately incomplete. As there are
some improvements coming to LTO soon according to the mailing lists, I'll just
test the complete build regularly to see if it gets fixed and (if it doesn't :)
get back to this later.


-- 


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


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

* [Bug lto/44802] -flto -fuse-linker-plugin causes undefined references from libc in the link phase
  2010-07-03 12:31 [Bug lto/44802] New: -flto -fuse-linker-plugin causes undefined references from libc in the link phase moonshine at kapsi dot fi
                   ` (3 preceding siblings ...)
  2010-07-08  2:03 ` moonshine at kapsi dot fi
@ 2010-07-26 21:14 ` hubicka at gcc dot gnu dot org
  2010-07-27 12:42 ` moonshine at kapsi dot fi
  5 siblings, 0 replies; 7+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2010-07-26 21:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from hubicka at gcc dot gnu dot org  2010-07-26 21:14 -------
I fixed similar problem on mainline (it was bogus visibility handling for
external symbols). Can you re-try?


-- 

hubicka at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug lto/44802] -flto -fuse-linker-plugin causes undefined references from libc in the link phase
  2010-07-03 12:31 [Bug lto/44802] New: -flto -fuse-linker-plugin causes undefined references from libc in the link phase moonshine at kapsi dot fi
                   ` (4 preceding siblings ...)
  2010-07-26 21:14 ` hubicka at gcc dot gnu dot org
@ 2010-07-27 12:42 ` moonshine at kapsi dot fi
  5 siblings, 0 replies; 7+ messages in thread
From: moonshine at kapsi dot fi @ 2010-07-27 12:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from moonshine at kapsi dot fi  2010-07-27 12:42 -------
(In reply to comment #5)

I compiled xz with a trunk compiler and this seems to be fixed now. Thanks!


-- 

moonshine at kapsi dot fi changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2010-07-27 12:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-03 12:31 [Bug lto/44802] New: -flto -fuse-linker-plugin causes undefined references from libc in the link phase moonshine at kapsi dot fi
2010-07-03 12:32 ` [Bug lto/44802] " moonshine at kapsi dot fi
2010-07-03 12:33 ` moonshine at kapsi dot fi
2010-07-03 13:35 ` moonshine at kapsi dot fi
2010-07-08  2:03 ` moonshine at kapsi dot fi
2010-07-26 21:14 ` hubicka at gcc dot gnu dot org
2010-07-27 12:42 ` moonshine at kapsi dot fi

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).