[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 changed: What|Removed |Added Status|ASSIGNED|RESOLVED See Also|

[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 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 Binutils) 2.21.51.201012

[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 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) 2.21.51.20101204 assertion fail ../../bin

[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 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-04 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #36 from H.J. Lu 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 this testcase. Please t

[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 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 d.g.gorbachev at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #34 from Dmitry Gorbachev 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 #33) Received SIGSEGV on this

[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 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-02 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #32 from H.J. Lu 2010-12-02 17:15:52 UTC --- Another testcase: [...@gnu-6 pr12245-6]$ cat y.c #include #include #include int main (int argc, char **argv) { int d = atoi (argv[1]); printf ("%f\n", sin (d)); return 0; } [...@

[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 changed: What|Removed |Added CC||dann at ics dot uci.edu --- Comment #3

[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 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. b. It was worked around

[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 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 doesn't work correctly.

[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 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=gcc&view=rev&rev=167091 Log: PR driver/42690 * gcc.c (LINK_COMMAND_SPEC): R

[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 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 placed between crti.o

[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 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 GCC LTO plugin. 3. Linker ge

[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 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 crtn.o. We may not link an arc

[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 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-20 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690 --- Comment #23 from Jan Hubicka 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 fact that we can optimize out

[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 changed: What|Removed |Added CC||hubicka at gcc dot gnu.org --- Comment #22

[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 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 > like a bad idea. I think

[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 changed: What|Removed |Added CC||hjl.tools at gmail dot com --- Comment #20 from

[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 changed: What|Removed |Added Keywords||patch URL|

[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 changed: What|Removed |Added Status|NEW |ASSIGNED AssignedTo|unassigned at gcc

[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 changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[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=19649&action=view) Simple patch It leaves -plugin-opt in LINK_COMMAND_SPEC, but I think it is not quite right, as LIBGCC

[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 -Wl,-pass-t

[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 -plugi

[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 %{

[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: W