diff --git a/cmake/modules/SwiftConfigureSDK.cmake b/cmake/modules/SwiftConfigureSDK.cmake index 4ea95a63ff3d6..7e87711feac0c 100644 --- a/cmake/modules/SwiftConfigureSDK.cmake +++ b/cmake/modules/SwiftConfigureSDK.cmake @@ -466,7 +466,7 @@ macro(configure_sdk_unix name architectures) if(SWIFT_ENABLE_WASI_THREADS) set(SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasip1-threads") else() - set(SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasi") + set(SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasip1") endif() elseif("${prefix}" STREQUAL "EMSCRIPTEN") set(SWIFT_SDK_EMSCRIPTEN_ARCH_${arch}_TRIPLE "${arch}-unknown-emscripten") diff --git a/utils/swift_build_support/swift_build_support/products/wasisysroot.py b/utils/swift_build_support/swift_build_support/products/wasisysroot.py index 4430ab9c2a342..cedf1f90751d0 100644 --- a/utils/swift_build_support/swift_build_support/products/wasisysroot.py +++ b/utils/swift_build_support/swift_build_support/products/wasisysroot.py @@ -44,11 +44,12 @@ def should_install(self, host_target): return False def build(self, host_target): - self._build(host_target) + self._build(host_target, thread_model='single', + target_triple='wasm32-wasip1') self._build(host_target, thread_model='posix', target_triple='wasm32-wasip1-threads') - def _build(self, host_target, thread_model='single', target_triple='wasm32-wasi'): + def _build(self, host_target, thread_model, target_triple): build_root = os.path.dirname(self.build_dir) if self.args.build_runtime_with_host_compiler: @@ -84,18 +85,6 @@ def _build(self, host_target, thread_model='single', target_triple='wasm32-wasi' 'TARGET_TRIPLE=' + target_triple, ]) - if target_triple == "wasm32-wasi": - # Alias wasm32-wasip1 to wasm32-wasi as Embedded modules use - # wasm32-unknown-wasip1 as the target triple. - for subpath in ["lib", "include"]: - dest_path = os.path.join(sysroot_install_path, subpath, "wasm32-wasip1") - if not os.path.exists(dest_path): - shell.symlink("wasm32-wasi", dest_path) - - dest_path = os.path.join(sysroot_install_path, "lib", "wasip1") - if not os.path.exists(dest_path): - shell.symlink("wasi", dest_path) - @classmethod def get_dependencies(cls): return [llvm.LLVM] @@ -145,7 +134,7 @@ def should_install(self, host_target): def build(self, host_target): self._build(host_target, enable_wasi_threads=False, - compiler_rt_os_dir='wasi', target_triple='wasm32-wasi') + compiler_rt_os_dir='wasip1', target_triple='wasm32-wasip1') self._build(host_target, enable_wasi_threads=True, compiler_rt_os_dir='wasip1', target_triple='wasm32-wasip1-threads') diff --git a/utils/swift_build_support/swift_build_support/products/wasmstdlib.py b/utils/swift_build_support/swift_build_support/products/wasmstdlib.py index 64516ad59293f..a12509b645ee5 100644 --- a/utils/swift_build_support/swift_build_support/products/wasmstdlib.py +++ b/utils/swift_build_support/swift_build_support/products/wasmstdlib.py @@ -41,7 +41,7 @@ def should_test(self, host_target): return self.args.test_wasmstdlib def build(self, host_target): - self._build(host_target, 'wasm32-wasi', 'wasi-wasm32') + self._build(host_target, 'wasm32-wasip1', 'wasip1-wasm32') def _build(self, host_target, target_triple, short_triple): llvm_build_dir = self._configure_llvm(target_triple, short_triple) @@ -181,10 +181,10 @@ def _build_stdlib(self, host_target, target_triple, llvm_cmake_dir): 'SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING', 'TRUE') self.cmake_options.define( 'SWIFT_SDK_embedded_ARCH_wasm32_PATH:PATH', - self._wasi_sysroot_path("wasm32-wasi")) + self._wasi_sysroot_path("wasm32-wasip1")) self.cmake_options.define( 'SWIFT_SDK_embedded_ARCH_wasm32-unknown-wasip1_PATH:PATH', - self._wasi_sysroot_path("wasm32-wasi")) + self._wasi_sysroot_path("wasm32-wasip1")) self.add_extra_cmake_options() diff --git a/utils/swift_build_support/swift_build_support/products/wasmswiftsdk.py b/utils/swift_build_support/swift_build_support/products/wasmswiftsdk.py index 9e3a0c27754fa..a2da0276b3817 100644 --- a/utils/swift_build_support/swift_build_support/products/wasmswiftsdk.py +++ b/utils/swift_build_support/swift_build_support/products/wasmswiftsdk.py @@ -231,7 +231,7 @@ def build(self, host_target): # and header paths from the sysroot # https://github.com/llvm/llvm-project/blob/73ef397fcba35b7b4239c00bf3e0b4e689ca0add/clang/lib/Driver/ToolChains/WebAssembly.cpp#L29-L36 for swift_host_triple, clang_multiarch_triple, build_basename, build_sdk, has_pthread in [ - ('wasm32-unknown-wasi', 'wasm32-wasi', 'wasmstdlib', True, False), + ('wasm32-unknown-wasip1', 'wasm32-wasip1', 'wasmstdlib', True, False), # TODO: Include p1-threads in the Swift SDK once sdk-generator supports multi-target SDK ('wasm32-unknown-wasip1-threads', 'wasm32-wasip1-threads', 'wasmthreadsstdlib', False, True),