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

2010-01-15 Thread d dot g dot gorbachev at gmail dot com
--- Comment #10 from d dot g dot gorbachev at gmail dot com 2010-01-15 11:02 --- Created an attachment (id=19613) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19613&action=view) 4. Configured with --disable-shared, linking with a static libgcc (with -static). -- http://gcc.g

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

2010-01-15 Thread d dot g dot gorbachev at gmail dot com
--- Comment #9 from d dot g dot gorbachev at gmail dot com 2010-01-15 11:02 --- Created an attachment (id=19612) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19612&action=view) 3. Configured with --disable-shared, linking with a static libgcc. -- http://gcc.gnu.org/bugzilla/

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

2010-01-15 Thread d dot g dot gorbachev at gmail dot com
--- Comment #8 from d dot g dot gorbachev at gmail dot com 2010-01-15 11:02 --- Created an attachment (id=19611) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19611&action=view) 2. Configured w/o --disable-shared, linking with a static libgcc (with -static). -- http://gcc.gnu

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

2010-01-15 Thread d dot g dot gorbachev at gmail dot com
--- Comment #7 from d dot g dot gorbachev at gmail dot com 2010-01-15 11:01 --- Created an attachment (id=19610) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19610&action=view) 1. Configured w/o --disable-shared, linking with a shared libgcc. Output of gcc -v -- http://gcc.

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

2010-01-14 Thread hjl dot tools at gmail dot com
--- Comment #6 from hjl dot tools at gmail dot com 2010-01-15 04:26 --- I got [...@gnu-6 gold-2]$ /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc -B./ -B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -B/export/build/gnu/gcc/build-x86_64-linux/gcc/../lto-plugin/.libs/ -flto -fuse-linker

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

2010-01-14 Thread espindola at gcc dot gnu dot org
--- Comment #5 from espindola at gcc dot gnu dot org 2010-01-15 03:54 --- Note that -plugin-opt=-pass-through=/foo/bar/libgcc.a is missing in the linker invocation. That is the problem. When BUG is not defined, the undefined reference is visible early on. You can check that with GNUTA

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

2010-01-14 Thread hjl dot tools at gmail dot com
--- Comment #4 from hjl dot tools at gmail dot com 2010-01-15 03:41 --- Works for me: [...@gnu-6 gold-2]$ vi pr42690.c [...@gnu-6 gold-2]$ cat pr42690.c int f(long long a, long long b) { #ifdef BUG return (int) (a / b); #else return (int) __divdi3(a, b); #endif } int main(void)

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

2010-01-14 Thread d dot g dot gorbachev at gmail dot com
--- Comment #3 from d dot g dot gorbachev at gmail dot com 2010-01-14 22:15 --- > Is the undefined reference to libgcc? Is it being linked statically? Yes. In both cases (with and without -DBUG), the ld command line is /usr/local/bin/ld -plugin /usr/local/libexec/gcc/i686-pc-linux-gnu

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

2010-01-12 Thread espindola at gcc dot gnu dot org
--- Comment #2 from espindola at gcc dot gnu dot org 2010-01-12 16:29 --- Is the undefined reference to libgcc? Is it being linked statically? When linking libgcc statically the driver has to pass -plugin-opt=-pass-through=/foo/bar/libgcc.a to ld. This is done in gcc.c: %{static|st

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

2010-01-11 Thread d dot g dot gorbachev at gmail dot com
--- Comment #1 from d dot g dot gorbachev at gmail dot com 2010-01-11 15:25 --- Created an attachment (id=19541) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19541&action=view) testcase GCC 4.5.0 20100107. gcc -flto -fuse-linker-plugin pr42690.c -DBUG -- http://gcc.gnu.org