From bd90bafce057b732792976d5b5357f1169d661d9 Mon Sep 17 00:00:00 2001 From: Andrew Morrow Date: Mon, 18 May 2020 12:59:09 -0400 Subject: SERVER-48267 Don't apply export file in non-SDK builds --- src/mongo/embedded/SConscript | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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' -- cgit v1.2.1