Skip to content

Commit baf18cf

Browse files
authored
Merge pull request #1821 from al45tair/eng/PR-145549541-6.1
[SDK Support] Make sure to look in `swift_static` rather than just `swift`.
2 parents d4f9e81 + 7156812 commit baf18cf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift

+7-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,13 @@ extension GenericUnixToolchain {
171171
let rsrc: VirtualPath
172172
// Prefer the swiftrt.o runtime file from the SDK if it's specified.
173173
if let sdk = targetInfo.sdkPath {
174-
rsrc = VirtualPath.lookup(sdk.path).appending(components: "usr", "lib", "swift")
174+
let swiftDir: String
175+
if staticStdlib || staticExecutable {
176+
swiftDir = "swift_static"
177+
} else {
178+
swiftDir = "swift"
179+
}
180+
rsrc = VirtualPath.lookup(sdk.path).appending(components: "usr", "lib", swiftDir)
175181
} else {
176182
rsrc = VirtualPath.lookup(targetInfo.runtimeResourcePath.path)
177183
}

0 commit comments

Comments
 (0)