File tree Expand file tree Collapse file tree 3 files changed +5
-12
lines changed Expand file tree Collapse file tree 3 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -328,20 +328,15 @@ extension GenericUnixToolchain {
328328 commandLine. appendPath ( outputFile)
329329 return try resolvedTool ( clangTool, pathOverride: clangPath)
330330 case . staticLibrary:
331- // We're using 'ar' as a linker
331+ // We're using 'llvm- ar' as a linker
332332 commandLine. appendFlag ( " crs " )
333333 commandLine. appendPath ( outputFile)
334334
335335 commandLine. append ( contentsOf: inputs. lazy. filter {
336336 lto == nil ? $0. type == . object
337337 : $0. type == . object || $0. type == . llvmBitcode
338338 } . map { . path( $0. file) } )
339- if targetTriple. environment == . android {
340- // Always use the LTO archiver llvm-ar for Android
341- return try resolvedTool ( . staticLinker( . llvmFull) )
342- } else {
343- return try resolvedTool ( . staticLinker( lto) )
344- }
339+ return try resolvedTool ( . staticLinker( . llvmFull) )
345340 }
346341
347342 }
Original file line number Diff line number Diff line change @@ -94,10 +94,7 @@ public final class GenericUnixToolchain: Toolchain {
9494 switch tool {
9595 case . swiftCompiler:
9696 return try lookup ( executable: " swift-frontend " )
97- case . staticLinker( nil ) :
98- return try lookup ( executable: " ar " )
99- case . staticLinker( . llvmFull) ,
100- . staticLinker( . llvmThin) :
97+ case . staticLinker:
10198 return try lookup ( executable: " llvm-ar " )
10299 case . dynamicLinker:
103100 // FIXME: This needs to look in the tools_directory first.
Original file line number Diff line number Diff line change @@ -2356,7 +2356,8 @@ final class SwiftDriverTests: XCTestCase {
23562356
23572357 let linkJob = plannedJobs [ 3 ]
23582358 let cmd = linkJob. commandLine
2359- // we'd expect "ar crs libTest.a foo.o bar.o"
2359+ // we'd expect "llvm-ar crs libTest.a foo.o bar.o"
2360+ XCTAssertTrue ( linkJob. tool. name. contains ( " llvm-ar " ) )
23602361 XCTAssertTrue ( cmd. contains ( . flag( " crs " ) ) )
23612362 XCTAssertTrue ( commandContainsTemporaryPath ( cmd, " foo.o " ) )
23622363 XCTAssertTrue ( commandContainsTemporaryPath ( cmd, " bar.o " ) )
You can’t perform that action at this time.
0 commit comments