Skip to content

Commit ce62988

Browse files
authored
Merge pull request #858 from compnerd/lto-bc
Jobs: permit bitcode items when building with LTO
2 parents c673072 + c081c9b commit ce62988

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)