[patch][cmake] Use -Wl,-O3 when linking

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sun Nov 2 04:28:53 PST 2014


On 2 November 2014 00:14, Chandler Carruth <chandlerc at google.com> wrote:
> The general idea here LGTM... I wonder, should it be behind a whitelist
> instead of a blacklist? I just don't want to break some random linker out
> there.

BFD has it for over a decade, I think gold "always" had it.

> What does lld do with this flag?

It ignores it for now.

> Feel free to commit once you've sorted out other linkers and how you want to
> handle them.

r221097. Thanks.

This all started with me trying to get us to always use gc-sections.
Unfortunately old versions of gnu ld would break our binaries. Doing
linker version checks in cmake seems to be incredibly painful, so what
I intend to no next is try to enable safe optimizations (like current
gc-sections) in -O3.

Cheers,
Rafael



More information about the llvm-commits mailing list