summaryrefslogtreecommitdiff
path: root/source4/heimdal_build
diff options
context:
space:
mode:
authorGary Lockyer <gary@catalyst.net.nz>2019-05-06 13:12:33 +1200
committerAndrew Bartlett <abartlet@samba.org>2019-05-06 07:12:18 +0000
commit63ae5e5f82bcc8f7f2c345f8b78170c5d2139684 (patch)
treefa46c2e3346b09501be20df49cf0ef0dad16a292 /source4/heimdal_build
parent3e5a2749db94930d06bf63b62136ecf49ac09e9c (diff)
downloadsamba-63ae5e5f82bcc8f7f2c345f8b78170c5d2139684.tar.gz
s4 heimdal_build: disable leak checks for asn1 compiler
Disable Address Sanitizer leak checking for the heimdal asn1 compiler, this allows a samba build with Address Sanitizer enabled. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/heimdal_build')
-rw-r--r--source4/heimdal_build/wscript_build11
1 files changed, 10 insertions, 1 deletions
diff --git a/source4/heimdal_build/wscript_build b/source4/heimdal_build/wscript_build
index 871db6b37fb..bedc130e07a 100644
--- a/source4/heimdal_build/wscript_build
+++ b/source4/heimdal_build/wscript_build
@@ -4,6 +4,7 @@ import os
from waflib import Context
from samba_utils import SET_TARGET_TYPE
from samba_autoconf import CURRENT_CFLAGS
+from samba_utils import LOAD_ENVIRONMENT
def to_list(str):
'''Split a list, preserving quoted strings and existing lists'''
@@ -57,7 +58,15 @@ def HEIMDAL_ASN1(name, source,
# source file. Note that in the case of a option_file, we have more than
# one source file
cd_rule = 'cd "${TGT[0].parent.abspath(env)}"'
- asn1_rule = cd_rule + ' && "${ASN1_COMPILE}" ${OPTION_FILE} ${ASN1OPTIONS} --one-code-file "${SRC[0].abspath(env)}" ${ASN1NAME}'
+ env = LOAD_ENVIRONMENT()
+ if env.ADDRESS_SANITIZER:
+ # If address sanitizer is enabled, we need to suppress leak checking
+ # in the asn1 tool.
+ no_leak_check = " && export ASAN_OPTIONS=detect_leaks=0"
+ else:
+ no_leak_check = ""
+
+ asn1_rule = cd_rule + no_leak_check + ' && "${ASN1_COMPILE}" ${OPTION_FILE} ${ASN1OPTIONS} --one-code-file "${SRC[0].abspath(env)}" ${ASN1NAME}'
source = to_list(source)