[lkml]   [2014]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Updated Link-Time-Optimization patchkit
On Sat, Feb 15, 2014 at 10:24:43PM +0100, Sam Ravnborg wrote:
> Hi Andi.
> On Sat, Feb 15, 2014 at 06:44:24PM +0100, Andi Kleen wrote:
> > On Sat, Feb 15, 2014 at 02:38:14PM +0100, Markus Trippelsdorf wrote:
> > > On 2014.02.14 at 22:21 +0100, Andi Kleen wrote:
> > > > This is the updated LTO patchkit for 3.14-rc2. LTO allows
> > > > the compiler to do global optimization over the whole kernel.
> > >
> > > It is mildly annoying that one couldn't use vanilla binutils. Have you
> > > already opened bugs on to get this fixed for
> > > gold and ld.bfd?
> >
> > The problem is supporting "pass through" of both pure (.S) assembler code and
> > LTO through ld -r, because the kernel makefiles use ld -r heavily.
> > Standard binutils would throw all the assembler away when in plugin LTO
> > mode.
> Long time ago I looked at eliminating the use of -r in the kernel build.
> I lost the patch - but the attached patch managed to build
> a "make defconfig; make" kernel.
> I have not event tried boot with this - it only managed to build!
> What the patch does is for each directory visited a file is created
> which is really a linker script.
> It uses INPUT (file file file) to specify all the object files.
> And in the final link the files are all read and the link is performed.
> This limit the depth to 10 levels due to a restriction in ld.
> The binutils people have suggested some other methods that I did not look into.
> Half of the patch is fixes to the security makefiles which I
> will submit anyway as this needs to be cleaned up indendent on
> this patch.
> The patch drops $(cmd_secanalysis) because I did not look into this.
> If this could make it easier to enable LTO then this would be
> a nice win.

I gave it a quick try and it failed like below with LTO

Right now using the Linux binutils is ok for me.


+ ld -m elf_x86_64 -r -o vmlinux.o arch/x86/kernel/head_64.o
arch/x86/kernel/head64.o arch/x86/kernel/head.o init/
--start-group usr/ arch/x86/
kernel/ mm/ fs/ ipc/
security/ crypto/ block/
lib/lib.a arch/x86/lib/lib.a lib/
arch/x86/lib/ drivers/ sound/
firmware/ arch/x86/pci/
arch/x86/oprofile/ arch/x86/power/
arch/x86/video/ net/ --end-group
lib/lib.a: could not read symbols: Bad value

 \ /
  Last update: 2014-02-16 05:21    [W:0.050 / U:3.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site