Opened 11 years ago

Closed 11 years ago

#1755 closed enhancement (invalid)

[PATCH] gcc LTO support

Reported by: fabio Owned by:
Priority: Should Have Milestone:
Component: Build & Packages Keywords: patch
Cc: Patch:

Description

The attached patch add optional gcc LTO (Link Time Optimization) support with the --enable-lto option. Only tested with gcc 4.7, probably not working on previous gcc so it will disabled. Currently it doesn't make a great difference, some binaries are even bigger, hopefully it will improve with future gcc.

Attachments (1)

lto.patch (1.8 KB ) - added by fabio 11 years ago.

Download all attachments as: .zip

Change History (4)

by fabio, 11 years ago

Attachment: lto.patch added

comment:1 by historic_bruno, 11 years ago

Couldn't this be passed in as a flag? I don't see the need for us to add a bunch of optimization options that most people won't use, having a good default set of them is fine.

About this patch specifically, it would be enough to mention in the option's description: "Experimental - may not work with GCC older than 4.7". We do the version check for PCH because it's used by default, but mostly the user should be responsible for knowing what works and what doesn't.

in reply to:  1 comment:2 by fabio, 11 years ago

Replying to historic_bruno:

Couldn't this be passed in as a flag? I don't see the need for us to add a bunch of optimization options that most people won't use, having a good default set of them is fine.

Probably yes, I have not tried it.

About this patch specifically, it would be enough to mention in the option's description: "Experimental - may not work with GCC older than 4.7". We do the version check for PCH because it's used by default, but mostly the user should be responsible for knowing what works and what doesn't.

This can be handy if one want to enable it only when supported, this way the same package can be compiled on different Linux version without changing the flag (e.g. the 0 A.D. PPA).

comment:3 by historic_bruno, 11 years ago

Keywords: review removed
Milestone: Alpha 13
Resolution: invalid
Status: newclosed

Closing as invalid, since it's easy to add any experimental optimization flags with CFLAGS.

Note: See TracTickets for help on using tickets.