diff options
author | Ciro Santilli <ciro.santilli@arm.com> | 2018-11-07 00:00:00 +0000 |
---|---|---|
committer | Ciro Santilli <ciro.santilli@arm.com> | 2018-11-15 13:19:06 +0000 |
commit | fafe4e80b76e93e3d0d05797904c19928587f5b5 (patch) | |
tree | 426cd566c9ad7eca8ee7f11d4bc858c3ee73e8f8 /SConstruct | |
parent | a4a5fa7fa591e91be86223f1fc8936d88255ac13 (diff) | |
download | gem5-fafe4e80b76e93e3d0d05797904c19928587f5b5.tar.xz |
scons: add --gold-linker to link with the gold linker
This option can significantly speedup link time on Linux systems, which is
the main bottleneck to rebuild after small changes.
Change-Id: I3b0bdd61f7dcef0d73629c8ee2ee98091953fec3
Reviewed-on: https://gem5-review.googlesource.com/c/14075
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'SConstruct')
-rwxr-xr-x | SConstruct | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct index d81c5abd9..0a8cd0edc 100755 --- a/SConstruct +++ b/SConstruct @@ -145,6 +145,8 @@ AddLocalOption('--default', dest='default', type='string', action='store', help='Override which build_opts file to use for defaults') AddLocalOption('--ignore-style', dest='ignore_style', action='store_true', help='Disable style checking hooks') +AddLocalOption('--gold-linker', dest='gold_linker', action='store_true', + help='Use the gold linker') AddLocalOption('--no-lto', dest='no_lto', action='store_true', help='Disable Link-Time Optimization for fast') AddLocalOption('--force-lto', dest='force_lto', action='store_true', @@ -357,6 +359,8 @@ if main['GCC'] or main['CLANG']: main['FILTER_PSHLINKFLAGS'] = lambda x: str(x).replace(' -shared', '') main['PSHLINKFLAGS'] = main.subst('${FILTER_PSHLINKFLAGS(SHLINKFLAGS)}') + if GetOption('gold_linker'): + main.Append(LINKFLAGS='-fuse-ld=gold') main['PLINKFLAGS'] = main.subst('${LINKFLAGS}') shared_partial_flags = ['-r', '-nostdlib'] main.Append(PSHLINKFLAGS=shared_partial_flags) |