diff --git a/Sources/SwiftSDKGenerator/SwiftSDKRecipes/WebAssemblyRecipe.swift b/Sources/SwiftSDKGenerator/SwiftSDKRecipes/WebAssemblyRecipe.swift index de9a8d9..8497f9b 100644 --- a/Sources/SwiftSDKGenerator/SwiftSDKRecipes/WebAssemblyRecipe.swift +++ b/Sources/SwiftSDKGenerator/SwiftSDKRecipes/WebAssemblyRecipe.swift @@ -181,7 +181,7 @@ package struct WebAssemblyRecipe: SwiftSDKRecipe { ) } - let autolinkExtractPath = generator.pathsConfiguration.toolchainBinDirPath.appending( + let autolinkExtractPath = pathsConfiguration.toolchainBinDirPath.appending( "swift-autolink-extract" ) @@ -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)