summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2020-02-06 17:24:44 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-07 16:33:45 +0000
commit01074b45187e60e365218a28d832f9000e37b047 (patch)
tree51c37707f090f79c856672ca5a883930dcabec1c
parent3b5e1c0e2148496a0fd39e7fea8fafb67e3ba06b (diff)
downloadmongo-01074b45187e60e365218a28d832f9000e37b047.tar.gz
SERVER-46021 Improve Ninja generator escaping for origin processing
-rw-r--r--site_scons/site_tools/ninja.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/site_scons/site_tools/ninja.py b/site_scons/site_tools/ninja.py
index a3326907c87..7e2d61ecb6a 100644
--- a/site_scons/site_tools/ninja.py
+++ b/site_scons/site_tools/ninja.py
@@ -843,6 +843,11 @@ def gen_get_response_file_command(env, rule, tool, tool_is_dynamic=False):
raise Exception("Could not find tool {} in {} generated from {}".format(tool, cmd_list, get_comstr(env, action, targets, sources)))
cmd, rsp_content = cmd_list[:tool_idx], cmd_list[tool_idx:]
+
+ # Some commands may have a need to pass a literal $ to a tool
+ # like ld (think $ORIGIN). We need to protect that $ from
+ # Ninja by using $$.
+ rsp_content = " ".join(rsp_content).replace('$', '$$')
variables = {"rspc": rsp_content}
variables[rule] = cmd
if use_command_env: