Add --sanetizer to run with gcc sanitation

This commit is contained in:
Nils O. Selåsdal
2016-03-09 00:31:54 +01:00
parent 21703ded30
commit 57e8bfb156
+11
View File
@@ -66,6 +66,13 @@ AddOption('--stack-protection',
help = 'Build with stack protection support' help = 'Build with stack protection support'
) )
AddOption('--sanitizer',
dest = 'sanitizer',
action='store_true',
default=False,
help = 'Build with gcc sanitizer'
)
AddOption('--32', AddOption('--32',
dest='force32bit', dest='force32bit',
action='store_true', action='store_true',
@@ -126,6 +133,10 @@ if GetOption('coverage'):
env.Append(CFLAGS = ['--coverage']) env.Append(CFLAGS = ['--coverage'])
env.Append(LINKFLAGS = ['--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 # Generate substitute dictionary
subst_info = dict(('@' + key + '@', version_info[key]) for key in version_info) subst_info = dict(('@' + key + '@', version_info[key]) for key in version_info)
subst_info['@prefix@'] = prefix subst_info['@prefix@'] = prefix