http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52362
--- Comment #7 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2012-05-14 11:14:28 UTC --- When there are many files to link, gnatlink passes a file containing the file names, instead of the file names directly, on the GCC link line. There is a bad interaction with LTO: eric@atlantis:~/build/gcc-4_7-branch/native32> cat t.c int main (void) { return 0; } eric@atlantis:~/build/gcc-4_7-branch/native32> gcc/xgcc -Bgcc -c t.c -flto eric@atlantis:~/build/gcc-4_7-branch/native32> cat FILE INPUT (./t.o) eric@atlantis:~/build/gcc-4_7-branch/native32> gcc/xgcc -Bgcc -o t FILE eric@atlantis:~/build/gcc-4_7-branch/native32> ./t eric@atlantis:~/build/gcc-4_7-branch/native32> gcc/xgcc -Bgcc -o t FILE -flto /tmp/ccTBohVP.ltrans0.ltrans.o: In function `main': ccTBohVP.ltrans0.o:(.text+0x0): multiple definition of `main' ./t.o:t.c:(.text+0x0): first defined here ./t.o: In function `main': t.c:(.text+0x0): multiple definition of `main' ./t.o:t.c:(.text+0x0): first defined here collect2: error: ld returned 1 exit status We should probably use a regular response file instead: eric@atlantis:~/build/gcc-4_7-branch/native32> cat FILE2 ./t.o eric@atlantis:~/build/gcc-4_7-branch/native32> gcc/xgcc -Bgcc -o t -Wl,@FILE2 -flto eric@atlantis:~/build/gcc-4_7-branch/native32> ./t