summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2015-10-01 23:08:28 -0400
committerAndrew Morrow <acm@mongodb.com>2015-10-19 17:10:35 -0400
commitb0c0ab7f4db9ca01e15baa3ae39246f18017524c (patch)
tree719334f5711318f335e9d399c209c549f3d4c2ee /SConstruct
parent670a573c2656d3f739deec5760bab7bf3efcca93 (diff)
downloadmongo-b0c0ab7f4db9ca01e15baa3ae39246f18017524c.tar.gz
SERVER-20974 Improve undefined behavior sanitizer integration
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct26
1 files changed, 15 insertions, 11 deletions
diff --git a/SConstruct b/SConstruct
index bb14ca10911..0868846dba8 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1114,17 +1114,21 @@ if link_model.startswith("dynamic"):
env['LIBDEPS_TAG_EXPANSIONS'].append(libdeps_tags_expand_incomplete)
else:
env.AppendUnique(SHLINKFLAGS=["-Wl,--no-as-needed"])
- if link_model == "dynamic-strict":
- env.AppendUnique(SHLINKFLAGS=["-Wl,-z,defs"])
- else:
- # On BFD/gold linker environments, which are not strict by
- # default, we need to add a flag when libraries are not
- # tagged incomplete.
- def libdeps_tags_expand_incomplete(source, target, env, for_signature):
- if 'incomplete' not in target[0].get_env().get("LIBDEPS_TAGS", []):
- return ["-Wl,-z,defs"]
- return []
- env['LIBDEPS_TAG_EXPANSIONS'].append(libdeps_tags_expand_incomplete)
+
+ # Using zdefs doesn't work at all with the sanitizers
+ if not has_option('sanitize'):
+
+ if link_model == "dynamic-strict":
+ env.AppendUnique(SHLINKFLAGS=["-Wl,-z,defs"])
+ else:
+ # On BFD/gold linker environments, which are not strict by
+ # default, we need to add a flag when libraries are not
+ # tagged incomplete.
+ def libdeps_tags_expand_incomplete(source, target, env, for_signature):
+ if 'incomplete' not in target[0].get_env().get("LIBDEPS_TAGS", []):
+ return ["-Wl,-z,defs"]
+ return []
+ env['LIBDEPS_TAG_EXPANSIONS'].append(libdeps_tags_expand_incomplete)
if optBuild:
env.SetConfigHeaderDefine("MONGO_CONFIG_OPTIMIZED_BUILD")