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]);
printf ("%f\n", sin (d));
return 0;
}
[...@gnu-6 pr12245-6]$ make
/usr/gcc-4.6/bin/gcc -O2 -fwhole-program -flto=jobserver -fuse-linker-plugin
-c -o y.o y.c
/usr/gcc-4.6/bin/gcc -static -o foo -O2 -fwhole-program -flto=jobserver
-fuse-linker-plugin y.o -lm
/tmp/ccrHdm25.ltrans0.ltrans.o: In function `main':
ccrHdm25.ltrans0.o:(.text.startup+0x19): undefined reference to `sin'
collect2: ld returned 1 exit status
make: *** [foo] Error 1
[...@gnu-6 pr12245-6]$