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 @@ -334,20 +334,15 @@ extension GenericUnixToolchain {
334
334
commandLine. appendPath ( outputFile)
335
335
return try resolvedTool ( clangTool, pathOverride: clangPath)
336
336
case . staticLibrary:
337
- // We're using 'ar' as a linker
337
+ // We're using 'llvm- ar' as a linker
338
338
commandLine. appendFlag ( " crs " )
339
339
commandLine. appendPath ( outputFile)
340
340
341
341
commandLine. append ( contentsOf: inputs. lazy. filter {
342
342
lto == nil ? $0. type == . object
343
343
: $0. type == . object || $0. type == . llvmBitcode
344
344
} . map { . path( $0. file) } )
345
- if targetTriple. environment == . android {
346
- // Always use the LTO archiver llvm-ar for Android
347
- return try resolvedTool ( . staticLinker( . llvmFull) )
348
- } else {
349
- return try resolvedTool ( . staticLinker( lto) )
350
- }
345
+ return try resolvedTool ( . staticLinker( . llvmFull) )
351
346
}
352
347
353
348
}
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 @@ -2151,7 +2151,8 @@ final class SwiftDriverTests: XCTestCase {
2151
2151
2152
2152
let linkJob = plannedJobs [ 3 ]
2153
2153
let cmd = linkJob. commandLine
2154
- // we'd expect "ar crs libTest.a foo.o bar.o"
2154
+ // we'd expect "llvm-ar crs libTest.a foo.o bar.o"
2155
+ XCTAssertTrue ( linkJob. tool. name. contains ( " llvm-ar " ) )
2155
2156
XCTAssertTrue ( cmd. contains ( . flag( " crs " ) ) )
2156
2157
XCTAssertTrue ( commandContainsTemporaryPath ( cmd, " foo.o " ) )
2157
2158
XCTAssertTrue ( commandContainsTemporaryPath ( cmd, " bar.o " ) )
You can’t perform that action at this time.
0 commit comments