From 25620a7ee6b80f705a9f99942807e1e2019bf166 Mon Sep 17 00:00:00 2001 From: Nikos Nikoleris Date: Thu, 23 Apr 2020 20:07:51 +0100 Subject: [PATCH] scons: Disable unsupported -Wl,--as-needed in MacOS Change-Id: Id6f8199b818217c4fcf4b80efdb7cc9e1d14e32b Signed-off-by: Nikos Nikoleris Reviewed-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28173 Reviewed-by: Jason Lowe-Power Maintainer: Gabe Black Tested-by: kokoro --- SConstruct | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 215c0b61d..334514812 100755 --- a/SConstruct +++ b/SConstruct @@ -359,7 +359,10 @@ if main['GCC'] or main['CLANG']: main.Append(CCFLAGS=['-I/usr/local/include']) main.Append(CXXFLAGS=['-I/usr/local/include']) - main.Append(LINKFLAGS='-Wl,--as-needed') + # On Mac OS X/Darwin the default linker doesn't support the + # option --as-needed + if sys.platform != "darwin": + main.Append(LINKFLAGS='-Wl,--as-needed') main['FILTER_PSHLINKFLAGS'] = lambda x: str(x).replace(' -shared', '') main['PSHLINKFLAGS'] = main.subst('${FILTER_PSHLINKFLAGS(SHLINKFLAGS)}') if GetOption('gold_linker'): -- 2.30.2