File tree 3 files changed +5
-12
lines changed
3 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -322,20 +322,15 @@ extension GenericUnixToolchain {
322
322
commandLine. appendPath ( outputFile)
323
323
return try resolvedTool ( clangTool, pathOverride: clangPath)
324
324
case . staticLibrary:
325
- // We're using 'ar' as a linker
325
+ // We're using 'llvm- ar' as a linker
326
326
commandLine. appendFlag ( " crs " )
327
327
commandLine. appendPath ( outputFile)
328
328
329
329
commandLine. append ( contentsOf: inputs. lazy. filter {
330
330
lto == nil ? $0. type == . object
331
331
: $0. type == . object || $0. type == . llvmBitcode
332
332
} . 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) )
339
334
}
340
335
341
336
}
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 @@ -2296,7 +2296,8 @@ final class SwiftDriverTests: XCTestCase {
2296
2296
2297
2297
let linkJob = plannedJobs [ 3 ]
2298
2298
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 " ) )
2300
2301
XCTAssertTrue ( cmd. contains ( . flag( " crs " ) ) )
2301
2302
XCTAssertTrue ( commandContainsTemporaryPath ( cmd, " foo.o " ) )
2302
2303
XCTAssertTrue ( commandContainsTemporaryPath ( cmd, " bar.o " ) )
You can’t perform that action at this time.
0 commit comments