aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendArtifacts.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendArtifacts.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendArtifacts.java
index a7d59da23d..16d5a38eed 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendArtifacts.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendArtifacts.java
@@ -119,6 +119,10 @@ public final class LtoBackendArtifacts {
builder.addInput(bitcodeFile);
builder.addInput(index);
+ // Although the imports file is not used by the LTOBackendAction while the action is executing,
+ // it is needed during the input discovery phase, and we must list it as an input to the action
+ // in order for it to be preserved under --experimental_discard_orphaned_artifacts.
+ builder.addInput(imports);
builder.addTransitiveInputs(ccToolchain.getCompile());
builder.addOutput(objectFile);