scripts: waifulib: add asan-only build type
This commit is contained in:
parent
1e075d25b7
commit
e5d80878b8
2 changed files with 13 additions and 2 deletions
|
@ -30,7 +30,7 @@ compiler_optimizations.CFLAGS['gottagofast'] = {
|
||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
|
|
||||||
VALID_BUILD_TYPES = ['fastnative', 'fast', 'humanrights', 'debug', 'sanitize', 'msan', 'none']
|
VALID_BUILD_TYPES = ['fastnative', 'fast', 'humanrights', 'debug', 'sanitize', 'msan', 'asan', 'none']
|
||||||
|
|
||||||
LINKFLAGS = {
|
LINKFLAGS = {
|
||||||
'common': {
|
'common': {
|
||||||
|
@ -42,6 +42,11 @@ LINKFLAGS = {
|
||||||
'clang': ['-fsanitize=memory', '-pthread'],
|
'clang': ['-fsanitize=memory', '-pthread'],
|
||||||
'default': ['NO_MSAN_HERE']
|
'default': ['NO_MSAN_HERE']
|
||||||
},
|
},
|
||||||
|
'asan': {
|
||||||
|
'clang': ['-fsanitize=address', '-pthread'],
|
||||||
|
'gcc': ['-fsanitize=address', '-pthread'],
|
||||||
|
'msvc': ['/SAFESEH:NO']
|
||||||
|
},
|
||||||
'sanitize': {
|
'sanitize': {
|
||||||
'clang': ['-fsanitize=undefined', '-fsanitize=address', '-pthread'],
|
'clang': ['-fsanitize=undefined', '-fsanitize=address', '-pthread'],
|
||||||
'gcc': ['-fsanitize=undefined', '-fsanitize=address', '-pthread'],
|
'gcc': ['-fsanitize=undefined', '-fsanitize=address', '-pthread'],
|
||||||
|
@ -95,6 +100,12 @@ CFLAGS = {
|
||||||
'clang': ['-O2', '-g', '-fno-omit-frame-pointer', '-fsanitize=memory', '-pthread'],
|
'clang': ['-O2', '-g', '-fno-omit-frame-pointer', '-fsanitize=memory', '-pthread'],
|
||||||
'default': ['NO_MSAN_HERE']
|
'default': ['NO_MSAN_HERE']
|
||||||
},
|
},
|
||||||
|
'asan': {
|
||||||
|
'msvc': ['/Od', '/RTC1', '/Zi', '/fsanitize=address'],
|
||||||
|
'gcc': ['-Og', '-fsanitize=address', '-pthread'],
|
||||||
|
'clang': ['-Og', '-fsanitize=address', '-pthread'],
|
||||||
|
'default': ['-O0']
|
||||||
|
},
|
||||||
'sanitize': {
|
'sanitize': {
|
||||||
'msvc': ['/Od', '/RTC1', '/Zi', '/fsanitize=address'],
|
'msvc': ['/Od', '/RTC1', '/Zi', '/fsanitize=address'],
|
||||||
'gcc': ['-O0', '-fsanitize=undefined', '-fsanitize=address', '-pthread'],
|
'gcc': ['-O0', '-fsanitize=undefined', '-fsanitize=address', '-pthread'],
|
||||||
|
|
|
@ -6,7 +6,7 @@ def options(opt):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def configure(conf):
|
def configure(conf):
|
||||||
if conf.options.BUILD_TYPE != 'sanitize':
|
if conf.options.BUILD_TYPE not in ['sanitize', 'asan']:
|
||||||
conf.fatal('useless without -T sanitize')
|
conf.fatal('useless without -T sanitize')
|
||||||
|
|
||||||
if conf.env.COMPILER_CC != 'clang':
|
if conf.env.COMPILER_CC != 'clang':
|
||||||
|
|
Loading…
Add table
Reference in a new issue