summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Moody <daniel.moody@mongodb.com>2020-08-05 20:45:20 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-15 02:57:58 +0000
commit3bfeaa9d487709a2169aa57d33ebbe7055444c1f (patch)
tree5843ac9c06715603951093dd59370936437aabf8
parentf6e8864256e82900629db044fb0b2cf4b5a81861 (diff)
downloadmongo-3bfeaa9d487709a2169aa57d33ebbe7055444c1f.tar.gz
SERVER-49457 Ninja tool static links should delete existing archive before linking"
-rw-r--r--site_scons/site_tools/ninja_next.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/site_scons/site_tools/ninja_next.py b/site_scons/site_tools/ninja_next.py
index 157eb1911bf..aff20498b60 100644
--- a/site_scons/site_tools/ninja_next.py
+++ b/site_scons/site_tools/ninja_next.py
@@ -462,8 +462,16 @@ class NinjaState:
"rspfile_content": "$rspc",
"pool": "local_pool",
},
+ # Ninja does not automatically delete the archive before
+ # invoking ar. The ar utility will append to an existing archive, which
+ # can cause duplicate symbols if the symbols moved between object files.
+ # Native SCons will perform this operation so we need to force ninja
+ # to do the same. See related for more info:
+ # https://jira.mongodb.org/browse/SERVER-49457
"AR": {
- "command": "$env$AR @$out.rsp",
+ "command": "{}$env$AR @$out.rsp".format(
+ '' if sys.platform == "win32" else "rm -f $out && "
+ ),
"description": "Archiving $out",
"rspfile": "$out.rsp",
"rspfile_content": "$rspc",