When you build with a combined tree and use -flto, the driver thinks the ld which is being used is ld-new which is not correct. The correct ld to be used here is really ld.
Created attachment 28608 [details] Patch which fixes the problem
Just recording this bug so I don't forget to submit this patch. I have ran into this twice now. Once when I was working on MIPS64 and now with AARCH64.
[cannot find ld] -plugin /home/pinskia/src/toolchain-cavium/thunder-tools/bin/../libexec/gcc/aarch64-thunder-elf/4.8.0/liblto_plugin.so -plugin-opt=/home/pinskia/src/toolchain-cavium/thunder-tools/bin/../libexec/gcc/aarch64-thunder-elf/4.8.0/lto-wrapper -plugin-opt=-fresolution=/tmp/cc8Il24U.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -X /home/pinskia/src/toolchain-cavium/thunder-tools/bin/../lib/gcc/aarch64-thunder-elf/4.8.0/crti.o /home/pinskia/src/toolchain-cavium/thunder-tools/bin/../lib/gcc/aarch64-thunder-elf/4.8.0/crtbegin.o /home/pinskia/src/toolchain-cavium/thunder-tools/bin/../lib/gcc/aarch64-thunder-elf/4.8.0/../../../../aarch64-thunder-elf/lib/crt0.o -L/home/pinskia/src/toolchain-cavium/thunder-tools/bin/../lib/gcc/aarch64-thunder-elf/4.8.0 -L/home/pinskia/src/toolchain-cavium/thunder-tools/bin/../lib/gcc -L/home/pinskia/src/toolchain-cavium/thunder-tools/bin/../lib/gcc/aarch64-thunder-elf/4.8.0/../../../../aarch64-thunder-elf/lib /tmp/ccBZOKuH.o -v -lgcc -lc -lgcc /home/pinskia/src/toolchain-cavium/thunder-tools/bin/../lib/gcc/aarch64-thunder-elf/4.8.0/crtend.o /home/pinskia/src/toolchain-cavium/thunder-tools/bin/../lib/gcc/aarch64-thunder-elf/4.8.0/crtn.o I have no patches installed either. The patch above does not work.
(In reply to comment #3) > I have no patches installed either. The patch above does not work. That is because I was porting the patch from 4.7 to 4.8 and the variable changed named so I had a typo in it.
Author: pinskia Date: Sat Nov 10 18:32:23 2012 New Revision: 193393 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193393 Log: 2012-11-10 Andrew Pinski <apinski@cavium.com> PR bootstrap/55202 * configure.ac: Set PLUGIN_LD_SUFFIX to just "ld" if it was "ld-new" or "collect-ld". * configure: Regenerate. Modified: trunk/gcc/ChangeLog trunk/gcc/configure trunk/gcc/configure.ac
Fixed.
Author: tschwinge Date: Thu Dec 20 15:57:18 2012 New Revision: 194637 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194637 Log: PR bootstrap/55202 * configure.ac <PLUGIN_LD_SUFFIX>: Use POSIX shell syntax. * configure: Regenerate. Modified: trunk/gcc/ChangeLog trunk/gcc/configure trunk/gcc/configure.ac