summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Nikoleris <nikos.nikoleris@arm.com>2018-12-23 11:16:27 +0000
committerNikos Nikoleris <nikos.nikoleris@arm.com>2019-01-07 14:52:00 +0000
commitdcc15d6d0764b08b9ab5d52d19f24072888c575a (patch)
treef7745fa2b916ace89873f9217b19893476b8c427
parent1a4a617c7e0728508d63a91a8534fbb4583f630c (diff)
downloadgem5-dcc15d6d0764b08b9ab5d52d19f24072888c575a.tar.xz
scons: Disable partial linking on Mac OS
Up until Apple LLVM version 10.0.0 (clang-1000.11.45.5), partial linked objects do not expose symbols that are marked with the hidden visibility and consequently building gem5 on Mac OS fails. As a workaround, we disable partial linking, however, we may want to revisit in the future. Change-Id: I0a26dae082bf723c2bd49d90e4497e44ecab9c41 Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/15235 Reviewed-by: Andrea Mondelli <andrea.mondelli@ucf.edu> Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
-rwxr-xr-xsrc/SConscript23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/SConscript b/src/SConscript
index 361479d57..dc284b104 100755
--- a/src/SConscript
+++ b/src/SConscript
@@ -1268,23 +1268,34 @@ needed_envs = [identifyTarget(target) for target in BUILD_TARGETS]
if 'all' in needed_envs:
needed_envs += target_types
+disable_partial = False
+if env['PLATFORM'] == 'darwin':
+ # Up until Apple LLVM version 10.0.0 (clang-1000.11.45.5), partial
+ # linked objects do not expose symbols that are marked with the
+ # hidden visibility and consequently building gem5 on Mac OS
+ # fails. As a workaround, we disable partial linking, however, we
+ # may want to revisit in the future.
+ disable_partial = True
+
# Debug binary
if 'debug' in needed_envs:
makeEnv(env, 'debug', '.do',
CCFLAGS = Split(ccflags['debug']),
CPPDEFINES = ['DEBUG', 'TRACING_ON=1'],
- LINKFLAGS = Split(ldflags['debug']))
+ LINKFLAGS = Split(ldflags['debug']),
+ disable_partial=disable_partial)
# Optimized binary
if 'opt' in needed_envs:
makeEnv(env, 'opt', '.o',
CCFLAGS = Split(ccflags['opt']),
CPPDEFINES = ['TRACING_ON=1'],
- LINKFLAGS = Split(ldflags['opt']))
+ LINKFLAGS = Split(ldflags['opt']),
+ disable_partial=disable_partial)
# "Fast" binary
if 'fast' in needed_envs:
- disable_partial = \
+ disable_partial = disable_partial and \
env.get('BROKEN_INCREMENTAL_LTO', False) and \
GetOption('force_lto')
makeEnv(env, 'fast', '.fo', strip = True,
@@ -1298,11 +1309,13 @@ if 'prof' in needed_envs:
makeEnv(env, 'prof', '.po',
CCFLAGS = Split(ccflags['prof']),
CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'],
- LINKFLAGS = Split(ldflags['prof']))
+ LINKFLAGS = Split(ldflags['prof']),
+ disable_partial=disable_partial)
# Profiled binary using google-pprof
if 'perf' in needed_envs:
makeEnv(env, 'perf', '.gpo',
CCFLAGS = Split(ccflags['perf']),
CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'],
- LINKFLAGS = Split(ldflags['perf']))
+ LINKFLAGS = Split(ldflags['perf']),
+ disable_partial=disable_partial)