Skip to content

Commit e7a283a

Browse files
authored
Fix broken libc.so symlink in RHEL SDK built from Docker (#40)
What looks like a search-replace error in 527128c added a spurious "await" in the target of the `rhel-ubi9.sdk/usr/lib64/libc.so` symlink: x86_64-unknown-linux-gnu/rhel-ubi9.sdk/usr/lib64/libc.so -> libc.await so.6 This causes the linker to be unable to find libc: % swift build --experimental-swift-sdk 5.9-RELEASE_rhel_ubi9_x86_64 Building for debugging... warning: Could not read SDKSettings.json for SDK at: /Users/euanh/Library/org.swift.swiftpm/swift-sdks/5.9-RELEASE_rhel_ubi9_x86_64.artifactbundle/5.9-RELEASE_rhel_ubi9_x86_64/x86_64-unknown-linux-gnu/rhel-ubi9.sdk <unknown>:0: warning: glibc not found for 'x86_64-unknown-linux-gnu'; C stdlib may be unavailable <unknown>:0: warning: glibc not found for 'x86_64-unknown-linux-gnu'; C stdlib may be unavailable warning: Could not read SDKSettings.json for SDK at: /Users/euanh/Library/org.swift.swiftpm/swift-sdks/5.9-RELEASE_rhel_ubi9_x86_64.artifactbundle/5.9-RELEASE_rhel_ubi9_x86_64/x86_64-unknown-linux-gnu/rhel-ubi9.sdk error: link command failed with exit code 1 (use -v to see invocation) ld.lld: error: unable to find library -lc clang-13: error: linker command failed with exit code 1 (use -v to see invocation) error: fatalError [5/6] Linking hello-world I don't see any other similar search-replace problems in 527128c.
1 parent 7e57543 commit e7a283a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Copy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ extension SwiftSDKGenerator {
6363
// `libc.so` is a linker script with absolute paths on RHEL, replace with a relative symlink
6464
let libcSO = sdkUsrLib64Path.appending("libc.so")
6565
try await removeFile(at: libcSO)
66-
try await createSymlink(at: libcSO, pointingTo: "libc.await so.6")
66+
try await createSymlink(at: libcSO, pointingTo: "libc.so.6")
6767
}
6868

6969
try await generator.createDirectoryIfNeeded(at: sdkUsrLibPath)

0 commit comments

Comments
 (0)