Skip to content

Commit 3a0d5fd

Browse files
[wasm] Rename wasm32-unknown-wasi to wasm32-unknown-wasip1
1 parent a4ad806 commit 3a0d5fd

File tree

4 files changed

+9
-20
lines changed

4 files changed

+9
-20
lines changed

cmake/modules/SwiftConfigureSDK.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ macro(configure_sdk_unix name architectures)
466466
if(SWIFT_ENABLE_WASI_THREADS)
467467
set(SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasip1-threads")
468468
else()
469-
set(SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasi")
469+
set(SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasip1")
470470
endif()
471471
elseif("${prefix}" STREQUAL "EMSCRIPTEN")
472472
set(SWIFT_SDK_EMSCRIPTEN_ARCH_${arch}_TRIPLE "${arch}-unknown-emscripten")

utils/swift_build_support/swift_build_support/products/wasisysroot.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@ def should_install(self, host_target):
4444
return False
4545

4646
def build(self, host_target):
47-
self._build(host_target)
47+
self._build(host_target, thread_model='single',
48+
target_triple='wasm32-wasip1')
4849
self._build(host_target, thread_model='posix',
4950
target_triple='wasm32-wasip1-threads')
5051

51-
def _build(self, host_target, thread_model='single', target_triple='wasm32-wasi'):
52+
def _build(self, host_target, thread_model, target_triple):
5253
build_root = os.path.dirname(self.build_dir)
5354

5455
if self.args.build_runtime_with_host_compiler:
@@ -84,18 +85,6 @@ def _build(self, host_target, thread_model='single', target_triple='wasm32-wasi'
8485
'TARGET_TRIPLE=' + target_triple,
8586
])
8687

87-
if target_triple == "wasm32-wasi":
88-
# Alias wasm32-wasip1 to wasm32-wasi as Embedded modules use
89-
# wasm32-unknown-wasip1 as the target triple.
90-
for subpath in ["lib", "include"]:
91-
dest_path = os.path.join(sysroot_install_path, subpath, "wasm32-wasip1")
92-
if not os.path.exists(dest_path):
93-
shell.symlink("wasm32-wasi", dest_path)
94-
95-
dest_path = os.path.join(sysroot_install_path, "lib", "wasip1")
96-
if not os.path.exists(dest_path):
97-
shell.symlink("wasi", dest_path)
98-
9988
@classmethod
10089
def get_dependencies(cls):
10190
return [llvm.LLVM]
@@ -145,7 +134,7 @@ def should_install(self, host_target):
145134

146135
def build(self, host_target):
147136
self._build(host_target, enable_wasi_threads=False,
148-
compiler_rt_os_dir='wasi', target_triple='wasm32-wasi')
137+
compiler_rt_os_dir='wasip1', target_triple='wasm32-wasip1')
149138
self._build(host_target, enable_wasi_threads=True,
150139
compiler_rt_os_dir='wasip1', target_triple='wasm32-wasip1-threads')
151140

utils/swift_build_support/swift_build_support/products/wasmstdlib.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def should_test(self, host_target):
4141
return self.args.test_wasmstdlib
4242

4343
def build(self, host_target):
44-
self._build(host_target, 'wasm32-wasi', 'wasi-wasm32')
44+
self._build(host_target, 'wasm32-wasip1', 'wasip1-wasm32')
4545

4646
def _build(self, host_target, target_triple, short_triple):
4747
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):
181181
'SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING', 'TRUE')
182182
self.cmake_options.define(
183183
'SWIFT_SDK_embedded_ARCH_wasm32_PATH:PATH',
184-
self._wasi_sysroot_path("wasm32-wasi"))
184+
self._wasi_sysroot_path("wasm32-wasip1"))
185185
self.cmake_options.define(
186186
'SWIFT_SDK_embedded_ARCH_wasm32-unknown-wasip1_PATH:PATH',
187-
self._wasi_sysroot_path("wasm32-wasi"))
187+
self._wasi_sysroot_path("wasm32-wasip1"))
188188

189189
self.add_extra_cmake_options()
190190

utils/swift_build_support/swift_build_support/products/wasmswiftsdk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def build(self, host_target):
231231
# and header paths from the sysroot
232232
# https://github.com/llvm/llvm-project/blob/73ef397fcba35b7b4239c00bf3e0b4e689ca0add/clang/lib/Driver/ToolChains/WebAssembly.cpp#L29-L36
233233
for swift_host_triple, clang_multiarch_triple, build_basename, build_sdk, has_pthread in [
234-
('wasm32-unknown-wasi', 'wasm32-wasi', 'wasmstdlib', True, False),
234+
('wasm32-unknown-wasip1', 'wasm32-wasip1', 'wasmstdlib', True, False),
235235
# TODO: Include p1-threads in the Swift SDK once sdk-generator supports multi-target SDK
236236
('wasm32-unknown-wasip1-threads', 'wasm32-wasip1-threads',
237237
'wasmthreadsstdlib', False, True),

0 commit comments

Comments
 (0)