Skip to content

Commit c081c9b

Browse files
committed
Jobs: permit bitcode items when building with LTO
When building an archive, permit the LLVM bitcode content into the archive as the LTO path will add those. This should ensure that we can continue to experiment with the LTO optimizations.
1 parent 607df61 commit c081c9b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,10 @@ extension GenericUnixToolchain {
297297
commandLine.appendFlag("crs")
298298
commandLine.appendPath(outputFile)
299299

300-
commandLine.append(contentsOf: inputs.filter { $0.type == .object }
301-
.map { .path($0.file) })
300+
commandLine.append(contentsOf: inputs.lazy.filter {
301+
lto == nil ? $0.type == .object
302+
: $0.type == .object || $0.type == .llvmBitcode
303+
}.map { .path($0.file) })
302304
return try getToolPath(.staticLinker(lto))
303305
}
304306

0 commit comments

Comments
 (0)