scripts: waifulib: add asan-only build type

This commit is contained in:
Alibek Omarov 2025-01-23 10:11:20 +03:00
parent 1e075d25b7
commit e5d80878b8
2 changed files with 13 additions and 2 deletions

View file

@ -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 = {
'common': {
@ -42,6 +42,11 @@ LINKFLAGS = {
'clang': ['-fsanitize=memory', '-pthread'],
'default': ['NO_MSAN_HERE']
},
'asan': {
'clang': ['-fsanitize=address', '-pthread'],
'gcc': ['-fsanitize=address', '-pthread'],
'msvc': ['/SAFESEH:NO']
},
'sanitize': {
'clang': ['-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'],
'default': ['NO_MSAN_HERE']
},
'asan': {
'msvc': ['/Od', '/RTC1', '/Zi', '/fsanitize=address'],
'gcc': ['-Og', '-fsanitize=address', '-pthread'],
'clang': ['-Og', '-fsanitize=address', '-pthread'],
'default': ['-O0']
},
'sanitize': {
'msvc': ['/Od', '/RTC1', '/Zi', '/fsanitize=address'],
'gcc': ['-O0', '-fsanitize=undefined', '-fsanitize=address', '-pthread'],

View file

@ -6,7 +6,7 @@ def options(opt):
pass
def configure(conf):
if conf.options.BUILD_TYPE != 'sanitize':
if conf.options.BUILD_TYPE not in ['sanitize', 'asan']:
conf.fatal('useless without -T sanitize')
if conf.env.COMPILER_CC != 'clang':