diff options
author | Daniel Moody <daniel.moody@mongodb.com> | 2020-08-05 20:45:20 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-08-14 05:07:11 +0000 |
commit | a78139a155bedfd8200e155db66f59837d5796c9 (patch) | |
tree | 2b03d9555361f60cc013a3eba3a42413401859bd /site_scons | |
parent | 01cdb5943fe82be6972d6601d1c8e645e223ed3a (diff) | |
download | mongo-a78139a155bedfd8200e155db66f59837d5796c9.tar.gz |
SERVER-49457 Ninja tool static links should delete existing archive before linking"
Diffstat (limited to 'site_scons')
-rw-r--r-- | site_scons/site_tools/ninja_next.py | 10 |
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 21473119a4a..1317c8a28a0 100644 --- a/site_scons/site_tools/ninja_next.py +++ b/site_scons/site_tools/ninja_next.py @@ -471,8 +471,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", |