Comment 2 for bug 872687

Revision history for this message
In , Matthias Klose (doko) wrote :

seen with the 2.22 branch (and the fix for pr13250 applied), works with gold, gcc is 4.6 from the branch.

$ cat foo.cc
int main() {}

$ g++ -B/usr/lib/gold-ld/ -Wl,--as-needed -flto foo.cc
ok

$ $ gcc -Wl,--as-needed -flto foo.cc
ok

$ $ g++ -Wl,--as-needed -flto foo.cc
/lib/i386-linux-gnu/libc.so.6: undefined reference to `_dl_argv@GLIBC_PRIVATE'
/lib/i386-linux-gnu/libc.so.6: undefined reference to `__libc_stack_end@GLIBC_2.1'
/lib/i386-linux-gnu/libc.so.6: undefined reference to `__libc_enable_secure@GLIBC_PRIVATE'
/lib/i386-linux-gnu/libc.so.6: undefined reference to `_rtld_global@GLIBC_PRIVATE'
/lib/i386-linux-gnu/libc.so.6: undefined reference to `___tls_get_addr@GLIBC_2.3'
/lib/i386-linux-gnu/libc.so.6: undefined reference to `_rtld_global_ro@GLIBC_PRIVATE'
collect2: ld returned 1 exit status