diff options
author | Marcel Hlopko <hlopko@google.com> | 2017-01-26 15:00:41 +0000 |
---|---|---|
committer | Laszlo Csomor <laszlocsomor@google.com> | 2017-01-26 15:15:49 +0000 |
commit | ae1b706de9b324134e9aca74fecb6bcee53b0315 (patch) | |
tree | 8b8da0d7b33c3bbd464afa3cdfcf0c84446b7b2e /src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java | |
parent | 00ac342f386be8b8ce1bdb11515c7828e86903c0 (diff) |
Rename thinlto_param_file to thinlto_indexing_param_file for indexing actions
My assumption in commit 4cb32a994308e1b4921471e32a02c49d8ceffb84 was that lto-indexing action doesn't expand
linking features. This was wrong, and lto-indexing was broken since then as
-Wl,@thinlto_param_file was added to the command line.
This cl changes the situation by actually exposing 2 different build variables,
thinlto_indexing_param_file for lto-indexing actions, and thinlto_param_file
for normal linking actions.
--
PiperOrigin-RevId: 145669124
MOS_MIGRATED_REVID=145669124
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java | 9 |
1 files changed, 7 insertions, 2 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", ""); } |