Skip to content

Commit 2421f37

Browse files
committed
Fix issues with the ar invocation
1 parent bdcac7f commit 2421f37

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

lib/Driver/Driver.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,12 +1959,10 @@ void Driver::buildActions(SmallVectorImpl<const Action *> &TopLevelActions,
19591959
if (OI.shouldLink() && !AllLinkerInputs.empty()) {
19601960
JobAction *LinkAction = nullptr;
19611961

1962-
if (OI.LinkAction == LinkKind::StaticLibrary) {
1962+
if (OI.LinkAction == LinkKind::StaticLibrary)
19631963
LinkAction = C.createAction<ArchiveJobAction>(AllLinkerInputs,
19641964
OI.LinkAction);
1965-
1966-
llvm::errs() << "LinkAction is an ArchiveJobAction\n";
1967-
} else
1965+
else
19681966
LinkAction = C.createAction<LinkJobAction>(AllLinkerInputs,
19691967
OI.LinkAction);
19701968

lib/Driver/ToolChains.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,14 +1101,12 @@ ToolChain::constructInvocation(const ArchiveJobAction &job,
11011101
isLLVMAR = true;
11021102
}
11031103

1104-
// Look for binutils in the toolchain folder.
1105-
Arguments.push_back("-B");
1106-
Arguments.push_back(context.Args.MakeArgString(A->getValue()));
11071104
}
11081105
if (AR == nullptr) {
1109-
if (auto pathAR = llvm::sys::findProgramByName("llvm-ar", None))
1106+
if (auto pathAR = llvm::sys::findProgramByName("llvm-ar", None)) {
11101107
AR = context.Args.MakeArgString(pathAR.get());
11111108
isLLVMAR = true;
1109+
}
11121110
}
11131111
if (AR == nullptr) {
11141112
if (auto pathAR = llvm::sys::findProgramByName("ar", None))

0 commit comments

Comments
 (0)