[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-12-06 Thread davek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 Dave Korn davek at gcc dot gnu.org changed: What|Removed |Added Status|ASSIGNED|RESOLVED

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-12-05 Thread d.g.gorbachev at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #37 from Dmitry Gorbachev d.g.gorbachev at gmail dot com 2010-12-05 12:37:26 UTC --- (In reply to comment #36) It seems to work. Thanks.

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-12-05 Thread d.g.gorbachev at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #38 from Dmitry Gorbachev d.g.gorbachev at gmail dot com 2010-12-05 16:48:38 UTC --- (In reply to comment #36) $ touch empty.c $ gcc -nodefaultlibs -r -flto -fuse-linker-plugin empty.c /usr/local/bin/ld: BFD (GNU Binutils)

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-12-05 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #39 from H.J. Lu hjl.tools at gmail dot com 2010-12-05 18:23:55 UTC --- (In reply to comment #38) (In reply to comment #36) $ touch empty.c $ gcc -nodefaultlibs -r -flto -fuse-linker-plugin empty.c /usr/local/bin/ld: BFD (GNU

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-12-04 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #33 from H.J. Lu hjl.tools at gmail dot com 2010-12-04 17:37:39 UTC --- This bug should be fixed with the 2 stage BFD linker patch: http://sourceware.org/ml/binutils/2010-12/msg00182.html No changes to GCC are needed.

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-12-04 Thread d.g.gorbachev at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #34 from Dmitry Gorbachev d.g.gorbachev at gmail dot com 2010-12-04 22:29:59 UTC --- Created attachment 22633 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=22633 Testcase for ld.bfd with Hongjiu Lu's patch (In reply to comment

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-12-04 Thread d.g.gorbachev at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #35 from Dmitry Gorbachev d.g.gorbachev at gmail dot com 2010-12-04 22:31:01 UTC --- Created attachment 22634 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=22634 Backtrace from ld.bfd with Hongjiu Lu's patch

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-12-04 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #36 from H.J. Lu hjl.tools at gmail dot com 2010-12-05 00:44:37 UTC --- (In reply to comment #34) Created attachment 22633 [details] Testcase for ld.bfd with Hongjiu Lu's patch (In reply to comment #33) Received SIGSEGV on

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-12-02 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #32 from H.J. Lu hjl.tools at gmail dot com 2010-12-02 17:15:52 UTC --- Another testcase: [...@gnu-6 pr12245-6]$ cat y.c #include stdio.h #include stdlib.h #include math.h int main (int argc, char **argv) { int d = atoi (argv[1]);

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-11-25 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 Richard Guenther rguenth at gcc dot gnu.org changed: What|Removed |Added CC||dann at ics

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-11-24 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #30 from H.J. Lu hjl.tools at gmail dot com 2010-11-24 15:07:17 UTC --- Goal: We should preserve the same linker command line order as if there are no IR. Problem: a. LTO may generate extra symbol references which aren't in IR.

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-11-23 Thread davek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #27 from Dave Korn davek at gcc dot gnu.org 2010-11-23 19:08:45 UTC --- (In reply to comment #25) The current linker plugin scheme may be flawed. The order of linking libraries (archive and DSO) is very important. They have to be

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-11-23 Thread davek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #28 from Dave Korn davek at gcc dot gnu.org 2010-11-23 19:18:46 UTC --- Author: davek Date: Tue Nov 23 19:18:39 2010 New Revision: 167091 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=167091 Log: PR driver/42690 * gcc.c

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-11-23 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #29 from H.J. Lu hjl.tools at gmail dot com 2010-11-23 23:43:55 UTC --- Please note that -pass-through is a hack, not a real solution. See http://www.sourceware.org/bugzilla/show_bug.cgi?id=12248 for a testcase to show why it

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-11-22 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #25 from H.J. Lu hjl.tools at gmail dot com 2010-11-22 18:02:47 UTC --- The current linker plugin scheme may be flawed. The order of linking libraries (archive and DSO) is very important. They have to be placed between crti.o and

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-11-22 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #26 from H.J. Lu hjl.tools at gmail dot com 2010-11-22 18:27:58 UTC --- One approach for linker plugin support may be: 1. GCC driver marks crtbegin.o and crtend.o. 2. Linker processes everything between crtbegin.o and crtend.o with

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-11-20 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 H.J. Lu hjl.tools at gmail dot com changed: What|Removed |Added CC||hjl.tools at gmail

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-11-20 Thread davek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #21 from Dave Korn davek at gcc dot gnu.org 2010-11-20 20:52:38 UTC --- (In reply to comment #20) If we have to pass libgcc archive in GCC driver, what happens to random archives on command line? Will LTO ignore them? It sounds

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-11-20 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 Jan Hubicka hubicka at gcc dot gnu.org changed: What|Removed |Added CC||hubicka at gcc

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-11-20 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #23 from Jan Hubicka hubicka at gcc dot gnu.org 2010-11-20 21:06:50 UTC --- BTW I really think both gold and GNU ld will need to do two stage linking (i.e. fully re-link after LTO step). Other problems involved in this include the

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-11-20 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #24 from H.J. Lu hjl.tools at gmail dot com 2010-11-20 21:14:01 UTC --- Can we do 1. GCC calls ld with -r to generate a .o file first. 2. GCC calls ld with the single .o input?

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-11-16 Thread davek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 Dave Korn davek at gcc dot gnu.org changed: What|Removed |Added Status|NEW |ASSIGNED

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-11-16 Thread davek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 Dave Korn davek at gcc dot gnu.org changed: What|Removed |Added Keywords||patch

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-11-09 Thread davek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 Dave Korn davek at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |NEW Last

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-01-18 Thread d dot g dot gorbachev at gmail dot com
--- Comment #15 from d dot g dot gorbachev at gmail dot com 2010-01-18 18:48 --- Created an attachment (id=19649) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19649action=view) Simple patch It leaves -plugin-opt in LINK_COMMAND_SPEC, but I think it is not quite right, as

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-01-16 Thread d dot g dot gorbachev at gmail dot com
--- Comment #13 from d dot g dot gorbachev at gmail dot com 2010-01-16 16:55 --- (In reply to comment #12) What options other than -nostdlib prevent gcc from linking libgcc and libc in the produced binary? I know of -nodefaultlibs. To implement this we should always pass

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-01-16 Thread espindola at gcc dot gnu dot org
--- Comment #14 from espindola at gcc dot gnu dot org 2010-01-17 05:47 --- I don't think that in general we can support things like -nodefaultlibs -lc -lgcc. Doing that with static libraries and lto is such an uncommon case that it is probably OK to ask the user to also pass

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-01-15 Thread d dot g dot gorbachev at gmail dot com
--- Comment #11 from d dot g dot gorbachev at gmail dot com 2010-01-15 11:03 --- GCC was configured with --disable-shared option. It seems that the driver does not understand that --disable-shared implies static libgcc -- d dot g dot gorbachev at gmail dot com changed:

[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin

2010-01-15 Thread espindola at gcc dot gnu dot org
--- Comment #12 from espindola at gcc dot gnu dot org 2010-01-15 15:28 --- (In reply to comment #11) GCC was configured with --disable-shared option. It seems that the driver does not understand that --disable-shared implies static libgcc That is correct. Currently we have