scons: Revert "Enable LTO for opt, perf and prof builds."

This reverts
https://gem5-review.googlesource.com/c/public/gem5/+/40815

Change-Id: I7dbd2b555570c90c98f38c7c02eb052571f7b6bd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44886
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Bobby R. Bruce
2021-04-27 11:51:27 -07:00
parent 89a95c1f7a
commit 679c698c56
2 changed files with 8 additions and 3 deletions

View File

@@ -328,7 +328,9 @@ if main['GCC']:
error('gcc version 5 or newer required.\n'
'Installed version:', main['CXXVERSION'])
# If not disabled, set the Link-Time Optimization (LTO) flags.
# Add the appropriate Link-Time Optimization (LTO) flags
# unless LTO is explicitly turned off. Note that these flags
# are only used by the fast target.
if not GetOption('no_lto'):
# g++ uses "make" to parallelize LTO. The program can be overriden with
# the environment variable "MAKE", but we currently make no attempt to

View File

@@ -1435,8 +1435,11 @@ if env['GCC']:
# the optimization to the ldflags as LTO defers the optimization
# to link time
for target in ['opt', 'fast', 'prof', 'perf']:
ccflags[target] += ['-O3'] + env['LTO_CCFLAGS']
ldflags[target] += ['-O3'] + env['LTO_LDFLAGS']
ccflags[target] += ['-O3']
ldflags[target] += ['-O3']
ccflags['fast'] += env['LTO_CCFLAGS']
ldflags['fast'] += env['LTO_LDFLAGS']
elif env['CLANG']:
ccflags['debug'] += ['-g', '-O0']
# opt, fast, prof and perf all share the same cc flags