aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Peter Schmitt <schmitt@google.com>2016-06-13 23:17:52 +0000
committerGravatar Yue Gan <yueg@google.com>2016-06-14 08:15:44 +0000
commitc1bfef68f9c444244b42284801a6024414c21f4a (patch)
treedb7f339eb247841ac63b87463b15b0a3d5097ac4 /src
parent64aced8ffde358eb30412bb14ae8386c04b117df (diff)
*** Reason for rollback *** Breaks linking for all objc targets. *** Original change description *** Wrap inputs to ObjcLink (via clang) invocations in an objlist, and pass the args as a -filelist arg. This prevents certain many-arg actions from making clang unhappy. -- MOS_MIGRATED_REVID=124781451
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java35
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java14
2 files changed, 17 insertions, 32 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java
index b4e8c87f6c..e65cd708e5 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java
@@ -779,8 +779,7 @@ public final class CompilationSupport {
private void registerArchiveActions(ImmutableList.Builder<Artifact> objFiles, Artifact archive) {
for (Action action :
- archiveActions(ruleContext, objFiles.build(), archive,
- intermediateArtifacts.archiveObjList())) {
+ archiveActions(ruleContext, objFiles.build(), archive, intermediateArtifacts.objList())) {
ruleContext.registerAction(action);
}
}
@@ -793,7 +792,11 @@ public final class CompilationSupport {
ImmutableList.Builder<Action> actions = new ImmutableList.Builder<>();
- actions.add(objFilelistAction(context, objFiles, objList));
+ actions.add(new FileWriteAction(
+ context.getActionOwner(),
+ objList,
+ Artifact.joinExecPaths("\n", objFiles),
+ /*makeExecutable=*/ false));
actions.add(ObjcRuleClasses.spawnAppleEnvActionBuilder(
ruleContext, appleConfiguration.getSingleArchPlatform())
@@ -814,15 +817,6 @@ public final class CompilationSupport {
return actions.build();
}
- private Action objFilelistAction(ActionConstructionContext context,
- Iterable<Artifact> objFiles, Artifact objList) {
- return new FileWriteAction(
- context.getActionOwner(),
- objList,
- Artifact.joinExecPaths("\n", objFiles),
- /*makeExecutable=*/ false);
- }
-
/**
* Registers an action to create an archive artifact by fully (statically) linking all
* transitive dependencies of this rule.
@@ -1052,7 +1046,6 @@ public final class CompilationSupport {
.addInputs(ccLibraries)
.addInputs(extraLinkInputs)
.addInputs(prunedJ2ObjcArchives)
- .addInput(intermediateArtifacts.linkerObjList())
.addInput(xcrunwrapper(ruleContext).getExecutable())
.build(ruleContext));
@@ -1166,14 +1159,11 @@ public final class CompilationSupport {
commandLine.add("-dead_strip").add("-no_dead_strip_inits_and_terms");
}
- Artifact inputFileList = intermediateArtifacts.linkerObjList();
- ruleContext.registerAction(
- objFilelistAction(ruleContext,
- Iterables.concat(bazelBuiltLibraries, objcProvider.get(IMPORTED_LIBRARY), ccLibraries),
- inputFileList));
-
if (objcConfiguration.shouldPrioritizeStaticLibs()) {
- commandLine.add("-filelist").add(inputFileList.getExecPathString());
+ commandLine
+ .addExecPaths(bazelBuiltLibraries)
+ .addExecPaths(objcProvider.get(IMPORTED_LIBRARY))
+ .addExecPaths(ccLibraries);
}
commandLine
@@ -1195,7 +1185,10 @@ public final class CompilationSupport {
.addFormatEach("-l%s", libraryNames);
if (!objcConfiguration.shouldPrioritizeStaticLibs()) {
- commandLine.add("-filelist").add(inputFileList.getExecPathString());
+ commandLine
+ .addExecPaths(bazelBuiltLibraries)
+ .addExecPaths(objcProvider.get(IMPORTED_LIBRARY))
+ .addExecPaths(ccLibraries);
}
Iterable<Artifact> ccLibrariesToForceLoad =
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java b/src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java
index ec5c05564f..099db303ce 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java
@@ -149,19 +149,11 @@ public final class IntermediateArtifacts {
}
/**
- * The .objlist file, which contains a list of paths of object files to archive and is read by
- * clang (via -filelist flag) in the link action (for binary creation).
- */
- public Artifact linkerObjList() {
- return appendExtension("-linker.objlist");
- }
-
- /**
* The .objlist file, which contains a list of paths of object files to archive and is read by
- * libtool (via -filelist flag) in the archive action.
+ * libtool in the archive action.
*/
- public Artifact archiveObjList() {
- return appendExtension("-archive.objlist");
+ public Artifact objList() {
+ return appendExtension(".objlist");
}
/**