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 @@ -322,20 +322,15 @@ extension GenericUnixToolchain {
322322 commandLine. appendPath ( outputFile)
323323 return try resolvedTool ( clangTool, pathOverride: clangPath)
324324 case . staticLibrary:
325- // We're using 'ar' as a linker
325+ // We're using 'llvm- ar' as a linker
326326 commandLine. appendFlag ( " crs " )
327327 commandLine. appendPath ( outputFile)
328328
329329 commandLine. append ( contentsOf: inputs. lazy. filter {
330330 lto == nil ? $0. type == . object
331331 : $0. type == . object || $0. type == . llvmBitcode
332332 } . map { . path( $0. file) } )
333- if targetTriple. environment == . android {
334- // Always use the LTO archiver llvm-ar for Android
335- return try resolvedTool ( . staticLinker( . llvmFull) )
336- } else {
337- return try resolvedTool ( . staticLinker( lto) )
338- }
333+ return try resolvedTool ( . staticLinker( . llvmFull) )
339334 }
340335
341336 }
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 @@ -2296,7 +2296,8 @@ final class SwiftDriverTests: XCTestCase {
22962296
22972297 let linkJob = plannedJobs [ 3 ]
22982298 let cmd = linkJob. commandLine
2299- // we'd expect "ar crs libTest.a foo.o bar.o"
2299+ // we'd expect "llvm-ar crs libTest.a foo.o bar.o"
2300+ XCTAssertTrue ( linkJob. tool. name. contains ( " llvm-ar " ) )
23002301 XCTAssertTrue ( cmd. contains ( . flag( " crs " ) ) )
23012302 XCTAssertTrue ( commandContainsTemporaryPath ( cmd, " foo.o " ) )
23022303 XCTAssertTrue ( commandContainsTemporaryPath ( cmd, " bar.o " ) )
You can’t perform that action at this time.
0 commit comments