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 @@ -315,20 +315,15 @@ extension GenericUnixToolchain {
315
315
commandLine. appendPath ( outputFile)
316
316
return try resolvedTool ( clangTool, pathOverride: clangPath)
317
317
case . staticLibrary:
318
- // We're using 'ar' as a linker
318
+ // We're using 'llvm- ar' as a linker
319
319
commandLine. appendFlag ( " crs " )
320
320
commandLine. appendPath ( outputFile)
321
321
322
322
commandLine. append ( contentsOf: inputs. lazy. filter {
323
323
lto == nil ? $0. type == . object
324
324
: $0. type == . object || $0. type == . llvmBitcode
325
325
} . 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) )
332
327
}
333
328
334
329
}
Original file line number Diff line number Diff line change @@ -66,10 +66,7 @@ public final class GenericUnixToolchain: Toolchain {
66
66
switch tool {
67
67
case . swiftCompiler:
68
68
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:
73
70
return try lookup ( executable: " llvm-ar " )
74
71
case . dynamicLinker:
75
72
// 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 {
2015
2015
2016
2016
let linkJob = plannedJobs [ 3 ]
2017
2017
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 " ) )
2019
2020
XCTAssertTrue ( cmd. contains ( . flag( " crs " ) ) )
2020
2021
XCTAssertTrue ( commandContainsTemporaryPath ( cmd, " foo.o " ) )
2021
2022
XCTAssertTrue ( commandContainsTemporaryPath ( cmd, " bar.o " ) )
You can’t perform that action at this time.
0 commit comments