From 316ef3d9be995c3e625266386afeeb037a255180 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 20 Nov 2017 18:21:19 -0800 Subject: scons: Move some compiler flag setting code to the SConstruct. These settings are invariant, so there's no reason to apply them over and over again for the child environments used for various build products. Change-Id: Icb4053105e4f1c43008f2422ba30c7206b7ff365 Reviewed-on: https://gem5-review.googlesource.com/5981 Reviewed-by: Andreas Sandberg Reviewed-by: Nikos Nikoleris Maintainer: Andreas Sandberg --- src/SConscript | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 'src') diff --git a/src/SConscript b/src/SConscript index f9560afbc..a40955b68 100755 --- a/src/SConscript +++ b/src/SConscript @@ -952,44 +952,6 @@ def makeEnv(env, label, objsfx, strip=False, disable_partial=False, **kwargs): new_env.Label = label new_env.Append(**kwargs) - if env['GCC']: - # The address sanitizer is available for gcc >= 4.8 - if GetOption('with_asan'): - if GetOption('with_ubsan') and \ - compareVersions(env['GCC_VERSION'], '4.9') >= 0: - new_env.Append(CCFLAGS=['-fsanitize=address,undefined', - '-fno-omit-frame-pointer']) - new_env.Append(LINKFLAGS='-fsanitize=address,undefined') - else: - new_env.Append(CCFLAGS=['-fsanitize=address', - '-fno-omit-frame-pointer']) - new_env.Append(LINKFLAGS='-fsanitize=address') - # Only gcc >= 4.9 supports UBSan, so check both the version - # and the command-line option before adding the compiler and - # linker flags. - elif GetOption('with_ubsan') and \ - compareVersions(env['GCC_VERSION'], '4.9') >= 0: - new_env.Append(CCFLAGS='-fsanitize=undefined') - new_env.Append(LINKFLAGS='-fsanitize=undefined') - - - if env['CLANG']: - # We require clang >= 3.1, so there is no need to check any - # versions here. - if GetOption('with_ubsan'): - if GetOption('with_asan'): - new_env.Append(CCFLAGS=['-fsanitize=address,undefined', - '-fno-omit-frame-pointer']) - new_env.Append(LINKFLAGS='-fsanitize=address,undefined') - else: - new_env.Append(CCFLAGS='-fsanitize=undefined') - new_env.Append(LINKFLAGS='-fsanitize=undefined') - - elif GetOption('with_asan'): - new_env.Append(CCFLAGS=['-fsanitize=address', - '-fno-omit-frame-pointer']) - new_env.Append(LINKFLAGS='-fsanitize=address') - werror_env = new_env.Clone() # Treat warnings as errors but white list some warnings that we # want to allow (e.g., deprecation warnings). -- cgit v1.2.3