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 @@ -315,20 +315,15 @@ extension GenericUnixToolchain {
315315 commandLine. appendPath ( outputFile)
316316 return try resolvedTool ( clangTool, pathOverride: clangPath)
317317 case . staticLibrary:
318- // We're using 'ar' as a linker
318+ // We're using 'llvm- ar' as a linker
319319 commandLine. appendFlag ( " crs " )
320320 commandLine. appendPath ( outputFile)
321321
322322 commandLine. append ( contentsOf: inputs. lazy. filter {
323323 lto == nil ? $0. type == . object
324324 : $0. type == . object || $0. type == . llvmBitcode
325325 } . map { . path( $0. file) } )
326- if targetTriple. environment == . android {
327- // Always use the LTO archiver llvm-ar for Android
328- return try resolvedTool ( . staticLinker( . llvmFull) )
329- } else {
330- return try resolvedTool ( . staticLinker( lto) )
331- }
326+ return try resolvedTool ( . staticLinker( . llvmFull) )
332327 }
333328
334329 }
Original file line number Diff line number Diff line change @@ -66,10 +66,7 @@ public final class GenericUnixToolchain: Toolchain {
6666 switch tool {
6767 case . swiftCompiler:
6868 return try lookup ( executable: " swift-frontend " )
69- case . staticLinker( nil ) :
70- return try lookup ( executable: " ar " )
71- case . staticLinker( . llvmFull) ,
72- . staticLinker( . llvmThin) :
69+ case . staticLinker:
7370 return try lookup ( executable: " llvm-ar " )
7471 case . dynamicLinker:
7572 // FIXME: This needs to look in the tools_directory first.
Original file line number Diff line number Diff line change @@ -2015,7 +2015,8 @@ final class SwiftDriverTests: XCTestCase {
20152015
20162016 let linkJob = plannedJobs [ 3 ]
20172017 let cmd = linkJob. commandLine
2018- // we'd expect "ar crs libTest.a foo.o bar.o"
2018+ // we'd expect "llvm-ar crs libTest.a foo.o bar.o"
2019+ XCTAssertTrue ( linkJob. tool. name. contains ( " llvm-ar " ) )
20192020 XCTAssertTrue ( cmd. contains ( . flag( " crs " ) ) )
20202021 XCTAssertTrue ( commandContainsTemporaryPath ( cmd, " foo.o " ) )
20212022 XCTAssertTrue ( commandContainsTemporaryPath ( cmd, " bar.o " ) )
You can’t perform that action at this time.
0 commit comments