Skip to content

Commit 98e41d0

Browse files
authored
Merge pull request #897 from buttaface/ar
Android: switch the archiver for static libraries over to llvm-ar
2 parents 29f41f7 + 39dc648 commit 98e41d0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,12 @@ extension GenericUnixToolchain {
301301
lto == nil ? $0.type == .object
302302
: $0.type == .object || $0.type == .llvmBitcode
303303
}.map { .path($0.file) })
304-
return try getToolPath(.staticLinker(lto))
304+
if targetTriple.environment == .android {
305+
// Always use the LTO archiver llvm-ar for Android
306+
return try getToolPath(.staticLinker(.llvmFull))
307+
} else {
308+
return try getToolPath(.staticLinker(lto))
309+
}
305310
}
306311

307312
}

0 commit comments

Comments
 (0)