------- Comment #2 from rguenth at gcc dot gnu dot org 2010-04-24 20:23 ------- With -fipa-cp -flto -fuse-linker-plugin -Wl,--allow-multiple-definition, but gold does not know --allow-multiple-definition and thus I get
> gcc-4.5 1.c 2.c -fipa-cp -flto -fuse-linker-plugin /usr/bin/gold: error: /tmp/ccLqKKQ3.o: multiple definition of f /usr/bin/gold: error: /tmp/ccgya79G.o: previous definition here lto1: internal compiler error: bytecode stream: trying to read 0 bytes after the end of the input buffer which simply means that we do not properly detect gold exiting with an error. With GNU ld and w/o -fuse-linker-plugin I see $ ./xgcc -B. 2.c 1.c -fipa-cp -flto -Wl,--allow-multiple-definition /tmp/ccedC6yL.o: In function `f': 2.c:(.text+0x7): undefined reference to `g' 2.c:(.text+0xf): undefined reference to `h' collect2: ld returned 1 exit status which means it "works" and we choose the wrong f() to succeed linking and thus we never end up invoking lto1 (which is what should happen in the gold case as well). Yes, we _do_ invoke the linker before invoking lto1! -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2010-04-24 20:23:01 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43467