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 {
328
328
commandLine. appendPath ( outputFile)
329
329
return try resolvedTool ( clangTool, pathOverride: clangPath)
330
330
case . staticLibrary:
331
- // We're using 'ar' as a linker
331
+ // We're using 'llvm- ar' as a linker
332
332
commandLine. appendFlag ( " crs " )
333
333
commandLine. appendPath ( outputFile)
334
334
335
335
commandLine. append ( contentsOf: inputs. lazy. filter {
336
336
lto == nil ? $0. type == . object
337
337
: $0. type == . object || $0. type == . llvmBitcode
338
338
} . 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) )
345
340
}
346
341
347
342
}
Original file line number Diff line number Diff line change @@ -94,10 +94,7 @@ public final class GenericUnixToolchain: Toolchain {
94
94
switch tool {
95
95
case . swiftCompiler:
96
96
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:
101
98
return try lookup ( executable: " llvm-ar " )
102
99
case . dynamicLinker:
103
100
// 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 {
2356
2356
2357
2357
let linkJob = plannedJobs [ 3 ]
2358
2358
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 " ) )
2360
2361
XCTAssertTrue ( cmd. contains ( . flag( " crs " ) ) )
2361
2362
XCTAssertTrue ( commandContainsTemporaryPath ( cmd, " foo.o " ) )
2362
2363
XCTAssertTrue ( commandContainsTemporaryPath ( cmd, " bar.o " ) )
You can’t perform that action at this time.
0 commit comments