diff options
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java | 9 | ||||
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java index e0a9929138..f99191da6b 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java @@ -86,6 +86,11 @@ public class CppLinkActionBuilder { */ public static final String THINLTO_PARAM_FILE_VARIABLE = "thinlto_param_file"; + /** + * A build variable to let thinlto know where it should write linker flags when indexing. + */ + public static final String THINLTO_INDEXING_PARAM_FILE_VARIABLE = "thinlto_indexing_param_file"; + public static final String THINLTO_PREFIX_REPLACE_VARIABLE = "thinlto_prefix_replace"; /** @@ -1349,12 +1354,12 @@ public class CppLinkActionBuilder { if (thinltoParamFile != null) { // This is a lto-indexing action and we want it to populate param file. buildVariables.addStringVariable( - THINLTO_PARAM_FILE_VARIABLE, thinltoParamFile.getExecPathString()); + THINLTO_INDEXING_PARAM_FILE_VARIABLE, thinltoParamFile.getExecPathString()); // TODO(b/33846234): Remove once all the relevant crosstools don't depend on the variable. buildVariables.addStringVariable( "thinlto_optional_params_file", "=" + thinltoParamFile.getExecPathString()); } else { - buildVariables.addStringVariable(THINLTO_PARAM_FILE_VARIABLE, ""); + buildVariables.addStringVariable(THINLTO_INDEXING_PARAM_FILE_VARIABLE, ""); // TODO(b/33846234): Remove once all the relevant crosstools don't depend on the variable. buildVariables.addStringVariable("thinlto_optional_params_file", ""); } diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java b/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java index 7f18629ce9..fbb4964e95 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java +++ b/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java @@ -220,7 +220,7 @@ public abstract class MockCcSupport { + " flag_set {" + " action: 'lto-indexing'" + " flag_group {" - + " flag: 'param_file=%{thinlto_param_file}'" + + " flag: 'param_file=%{thinlto_indexing_param_file}'" + " flag: 'prefix_replace=%{thinlto_prefix_replace}'" + " }" + " }" |