diff options
author | Andreas Schneider <asn@samba.org> | 2015-01-26 16:16:15 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2015-01-28 17:17:07 +0100 |
commit | cf68c1accb50f4d8449e993c630559a3d3e9dd36 (patch) | |
tree | a02bddef1bfccb53a389ab300e5e549da733411c /buildtools | |
parent | ab51f283e7a7f4fc82a94d39e7bb3a68e8aac554 (diff) | |
download | samba-cf68c1accb50f4d8449e993c630559a3d3e9dd36.tar.gz |
waf: Add address sanitizer configure option.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'buildtools')
-rw-r--r-- | buildtools/wafsamba/samba_autoconf.py | 5 | ||||
-rwxr-xr-x | buildtools/wafsamba/wscript | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index 8d84a5e4069..c13bfe76527 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -703,6 +703,11 @@ int main(void) { if Options.options.pedantic: conf.ADD_CFLAGS('-W', testflags=True) + if Options.options.address_sanitizer: + conf.ADD_CFLAGS('-fno-omit-frame-pointer -O1 -fsanitize=address', testflags=True) + conf.ADD_LDFLAGS('-fsanitize=address', testflags=True) + conf.env['ADDRESS_SANITIZER'] = True + # Let people pass an additional ADDITIONAL_{CFLAGS,LDFLAGS} # environment variables which are only used the for final build. diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript index c81a7b3b098..86224d4b4a6 100755 --- a/buildtools/wafsamba/wscript +++ b/buildtools/wafsamba/wscript @@ -117,6 +117,9 @@ def set_options(opt): gr.add_option('--git-local-changes', help=("mark version with + if local git changes"), action='store_true', dest='GIT_LOCAL_CHANGES', default=False) + gr.add_option('--address-sanitizer', + help=("Enable address sanitizer compile and liker flags"), + action="store_true", dest='address_sanitizer', default=False) gr.add_option('--abi-check', help=("Check ABI signatures for libraries"), |