From 57e8bfb1560b2b3beeb54750e5377509977f525a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Wed, 9 Mar 2016 00:31:54 +0100 Subject: [PATCH] Add --sanetizer to run with gcc sanitation --- SConstruct | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SConstruct b/SConstruct index aad42de..1e0aaca 100644 --- a/SConstruct +++ b/SConstruct @@ -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