summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2020-05-18 12:59:09 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-18 22:05:37 +0000
commitbd90bafce057b732792976d5b5357f1169d661d9 (patch)
treecfb34fafe73a3e92dc58cace6d18eda1a4d7c475
parenta29647888b6d8c50612c1609522302b3ac16071e (diff)
downloadmongo-bd90bafce057b732792976d5b5357f1169d661d9.tar.gz
SERVER-48267 Don't apply export file in non-SDK builds
-rw-r--r--src/mongo/embedded/SConscript8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/embedded/SConscript b/src/mongo/embedded/SConscript
index bcb3a7aaa8e..8e969f70b21 100644
--- a/src/mongo/embedded/SConscript
+++ b/src/mongo/embedded/SConscript
@@ -29,7 +29,13 @@ def mongo_export_file_generator(target, source, env, for_signature):
return script.get_csig() if for_signature else "-Wl,--version-script," + str(script)
else:
pass
-frameworksEnv['MONGO_EXPORT_FILE_SHLINKFLAGS'] = mongo_export_file_generator
+
+# We really only want to use the mapfile if we are doing an SDK build. In an ordinary
+# dynamic build, we would end up building the normal library with an export map
+# but many of its symbols should in fact be coming from other libraries, and we
+# get odd ODR-esque violations. UBSAN caught this. Thanks UBSAN!
+if get_option('link-model') == 'dynamic-sdk':
+ frameworksEnv['MONGO_EXPORT_FILE_SHLINKFLAGS'] = mongo_export_file_generator
# We need to set our bundle version in the plist file, but the format
# is contrained to major.minor.patch. So trim off any '-pre' or '-rc'