Add --sanetizer to run with gcc sanitation
This commit is contained in:
+11
@@ -66,6 +66,13 @@ AddOption('--stack-protection',
|
||||
help = 'Build with stack protection support'
|
||||
)
|
||||
|
||||
AddOption('--sanitizer',
|
||||
dest = 'sanitizer',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help = 'Build with gcc sanitizer'
|
||||
)
|
||||
|
||||
AddOption('--32',
|
||||
dest='force32bit',
|
||||
action='store_true',
|
||||
@@ -126,6 +133,10 @@ if GetOption('coverage'):
|
||||
env.Append(CFLAGS = ['--coverage'])
|
||||
env.Append(LINKFLAGS = ['--coverage'])
|
||||
|
||||
if GetOption('sanitizer'):
|
||||
env.Append(CFLAGS = ['-fsanitize=undefined', '-fsanitize=address'])
|
||||
env.Append(LINKFLAGS = ['-fsanitize=undefined', '-fsanitize=address'])
|
||||
|
||||
# Generate substitute dictionary
|
||||
subst_info = dict(('@' + key + '@', version_info[key]) for key in version_info)
|
||||
subst_info['@prefix@'] = prefix
|
||||
|
||||
Reference in New Issue
Block a user