scons: Try to handle problems with gcc, lto and partial linking.
authorGabe Black <gabeblack@google.com>
Tue, 6 Jun 2017 05:23:18 +0000 (22:23 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 6 Jun 2017 17:07:19 +0000 (17:07 +0000)
commit670436b9cd7a23f03c9d7248abb8eb19939c83a6
treeab5196a5ebc651dcf782bdd5c2f04a9619fae4b4
parent4966fe4b0f17ba30cba3d3dbae02b6452b87a70a
scons: Try to handle problems with gcc, lto and partial linking.

gcc has had a lot of problems with incremental linking and partial linking
at the same time. Basically, the partial link assumes that it's the only
link that's going to happen, and it converts weak external symbols into
regular external symbols. Then when the real final link happens, those
symbols are duplicated and the link fails.

Versions of gcc 6 and greater add an option called -flinker-output which
lets you tell the linker to do an incremental link. Unfortunately, other
bugs make that fail, and so gcc 6 doesn't work either. Hopefully version
7 works better.

A --force-lto option was added so that, when only one of lto and partial
linking is available, you can switch from having partial linking to having
lto.

Change-Id: I5e293f5cfb07a14343dc74030d99cb161fb8bbbe
Reviewed-on: https://gem5-review.googlesource.com/3680
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
SConstruct
src/SConscript