scons: Enable LTO and partial linking with gcc >= 8.1.
authorGabe Black <gabe.black@gmail.com>
Thu, 26 Mar 2020 11:44:51 +0000 (04:44 -0700)
committerGabe Black <gabeblack@google.com>
Sat, 28 Mar 2020 00:12:19 +0000 (00:12 +0000)
commitf41abbdb5cf5c67233f3d730885d43517969afda
tree0e119fa56fe03403514c556debcf2f6c5ffc7ae1
parent1c59559ddb8be4fbad2c0e730df24f497c510283
scons: Enable LTO and partial linking with gcc >= 8.1.

The bug(s) which prevented LTO and partial linking from working with gcc
have been fixed in my local version (9.3), and according to one of the
original bug reports:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69866

A fix was committed in gcc version 8.1.

The original code left in the SConstruct describing the problem with
versions greated than 6.0 also enabled an -flinker-output option and set
it to "rel". That option doesn't show up in the gcc 8.4 documentation
even though it was added in 6.0, but in the 9.3 documentation it
describes it and says that it defaults to "rel" when the -r (partial
linking) option is used.

This *should* mean that LTO and partial linking can be used together
with no issues after version 8.1, and at most by version 9.3. If someone
finds that that isn't true, then the range of bad versions can be
expanded.

Change-Id: Ie0529d077a0042ef55e2af995d01430d1695c031
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27131
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
SConstruct