Bug 55202 - Building a combined tree is broken for LTO
Summary: Building a combined tree is broken for LTO
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: driver (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Andrew Pinski
URL: http://gcc.gnu.org/ml/gcc-patches/201...
Keywords: patch
Depends on:
Blocks:
 
Reported: 2012-11-04 08:27 UTC by Andrew Pinski
Modified: 2012-12-20 15:57 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-11-04 00:00:00


Attachments
Patch which fixes the problem (356 bytes, patch)
2012-11-04 08:29 UTC, Andrew Pinski
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2012-11-04 08:27:56 UTC
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.
Comment 1 Andrew Pinski 2012-11-04 08:29:02 UTC
Created attachment 28608 [details]
Patch which fixes the problem
Comment 2 Andrew Pinski 2012-11-04 08:30:17 UTC
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.
Comment 3 Andrew Pinski 2012-11-04 08:36:08 UTC
[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.
Comment 4 Andrew Pinski 2012-11-04 08:37:29 UTC
(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.
Comment 5 Andrew Pinski 2012-11-10 18:32:27 UTC
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
Comment 6 Andrew Pinski 2012-11-10 18:32:51 UTC
Fixed.
Comment 7 Thomas Schwinge 2012-12-20 15:57:21 UTC
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