summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorEarl Ou <shunhsingou@google.com>2018-09-07 15:16:53 +0800
committerEarl Ou <shunhsingou@google.com>2018-09-13 13:57:46 +0000
commita1e5fccd64d5693d6209dbc5a9fc406648d74a5d (patch)
tree7121f5acadf92ab2d26d0faa7ef9e66d803dc2c9 /SConstruct
parent91295ff980c17efb3ad013b9636017b58e49c071 (diff)
downloadgem5-a1e5fccd64d5693d6209dbc5a9fc406648d74a5d.tar.xz
Fix SConstruct for asan build
Sometimes it's easier to debug gem5 built with ASan enabled. This CL fixes some build error when using --with-asan. Bug: None Test: ./scripts/build_gem5 --with-asan --with-ubsan build/ARM/gem5.debug Change-Id: Iaaaaebc3f25749e11f97bf454ddd0153b3de56e7 Reviewed-on: https://gem5-review.googlesource.com/12511 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com> Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Diffstat (limited to 'SConstruct')
-rwxr-xr-xSConstruct16
1 files changed, 8 insertions, 8 deletions
diff --git a/SConstruct b/SConstruct
index 79522e46f..f689b556a 100755
--- a/SConstruct
+++ b/SConstruct
@@ -484,11 +484,11 @@ if main['GCC']:
compareVersions(main['GCC_VERSION'], '4.9') >= 0:
main.Append(CCFLAGS=['-fsanitize=address,undefined',
'-fno-omit-frame-pointer'],
- LINKFLAGS='-fsanitize=address,undefined')
+ LINKFLAGS='-fsanitize=address,undefined')
else:
main.Append(CCFLAGS=['-fsanitize=address',
'-fno-omit-frame-pointer'],
- LINKFLAGS='-fsanitize=address')
+ 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.
@@ -541,16 +541,16 @@ elif main['CLANG']:
# versions here.
if GetOption('with_ubsan'):
if GetOption('with_asan'):
- env.Append(CCFLAGS=['-fsanitize=address,undefined',
- '-fno-omit-frame-pointer'],
+ main.Append(CCFLAGS=['-fsanitize=address,undefined',
+ '-fno-omit-frame-pointer'],
LINKFLAGS='-fsanitize=address,undefined')
else:
- env.Append(CCFLAGS='-fsanitize=undefined',
- LINKFLAGS='-fsanitize=undefined')
+ main.Append(CCFLAGS='-fsanitize=undefined',
+ LINKFLAGS='-fsanitize=undefined')
elif GetOption('with_asan'):
- env.Append(CCFLAGS=['-fsanitize=address',
- '-fno-omit-frame-pointer'],
+ main.Append(CCFLAGS=['-fsanitize=address',
+ '-fno-omit-frame-pointer'],
LINKFLAGS='-fsanitize=address')
else: