summaryrefslogtreecommitdiffstats
path: root/common.py
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2016-04-09 20:26:42 +0100
committerJose Fonseca <jfonseca@vmware.com>2016-04-13 06:54:32 +0100
commitfa46848e51a619aba5a748316fe8fe4c2e17d243 (patch)
tree0e3beb3c36eb1940e31ff5aaacd7e39dc02b9a3f /common.py
parentd1c89f60050fa5acd0bd1faa993de902631482a0 (diff)
downloadexternal_mesa3d-fa46848e51a619aba5a748316fe8fe4c2e17d243.zip
external_mesa3d-fa46848e51a619aba5a748316fe8fe4c2e17d243.tar.gz
external_mesa3d-fa46848e51a619aba5a748316fe8fe4c2e17d243.tar.bz2
scons: Allow building with Address Sanitizer.
libasan is never linked to shared objects (which doesn't go well with -z,defs). It must either be linked to the main executable, or (more practically for OpenGL drivers) be pre-loaded via LD_PRELOAD. Otherwise works. I didn't find anything with llvmpipe. I suspect the fact that the JIT compiled code isn't instrumented means there are lots of errors it can't catch. But for non-JIT drivers, the Address/Leak Sanitizers seem like a faster alternative to Valgrind. Usage (Ubuntu 15.10): scons asan=1 libgl-xlib export LD_LIBRARY_PATH=$PWD/build/linux-x86_64-debug/gallium/targets/libgl-xlib LD_PRELOAD=libasan.so.2 any-opengl-application Acked-by: Roland Scheidegger <sroland@vmware.com>
Diffstat (limited to 'common.py')
-rw-r--r--common.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/common.py b/common.py
index 7a93941..70e6708 100644
--- a/common.py
+++ b/common.py
@@ -97,6 +97,7 @@ def AddOptions(opts):
opts.Add(BoolOption('embedded', 'embedded build', 'no'))
opts.Add(BoolOption('analyze',
'enable static code analysis where available', 'no'))
+ opts.Add(BoolOption('asan', 'enable Address Sanitizer', 'no'))
opts.Add('toolchain', 'compiler toolchain', default_toolchain)
opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support',
'no'))