Skip to content

Symlink libclang_rt.builtins.a for Embedded Swift for WASI #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ package struct WebAssemblyRecipe: SwiftSDKRecipe {
)
}

let autolinkExtractPath = generator.pathsConfiguration.toolchainBinDirPath.appending(
let autolinkExtractPath = pathsConfiguration.toolchainBinDirPath.appending(
"swift-autolink-extract"
)

Expand All @@ -195,6 +195,13 @@ package struct WebAssemblyRecipe: SwiftSDKRecipe {
try await generator.createSymlink(at: autolinkExtractPath, pointingTo: "swift")
}

// Embedded Swift looks up clang compiler-rt in a different path.
let embeddedCompilerRTPath = pathsConfiguration.toolchainDirPath.appending(
"usr/lib/swift/clang/lib/wasip1"
)

try await generator.createSymlink(at: embeddedCompilerRTPath, pointingTo: "wasi")

// Copy the WASI sysroot into the SDK bundle.
let sdkDirPath = pathsConfiguration.swiftSDKRootPath.appending("WASI.sdk")
try await generator.rsyncContents(from: self.wasiSysroot, to: sdkDirPath)
Expand Down