summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/samba_autoconf.py5
-rwxr-xr-xbuildtools/wafsamba/wscript3
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"),