Skip to content

Commit 7cfecf3

Browse files
build: Rename wasi-threads to wasip1-threads
The WASI community is transitioning to a new naming for the "preview" version in the target triple: wasm32-wasi -> wasm32-wasip1. At this moment, we keep the old triple wasm32-wasi because it's already widely used, but we should start using the new triple threaded target. LLVM checks only if the OS field *starts* with "wasi", so "wasip1" is still considered a valid `isOSWASI()` target. See: WebAssembly/wasi-libc#478
1 parent 4d1b3b7 commit 7cfecf3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cmake/modules/SwiftConfigureSDK.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ macro(configure_sdk_unix name architectures)
423423
endif()
424424
set(SWIFT_SDK_WASI_ARCH_wasm32_PATH "${SWIFT_WASI_SYSROOT_PATH}")
425425
if(SWIFT_ENABLE_WASI_THREADS)
426-
set(SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasi-threads")
426+
set(SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasip1-threads")
427427
else()
428428
set(SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasi")
429429
endif()

utils/swift_build_support/swift_build_support/products/wasisysroot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def _build(self, host_target, enable_wasi_threads=False):
143143
'libcxx;libcxxabi;compiler-rt')
144144
libdir_suffix = '/wasm32-wasi'
145145
if enable_wasi_threads:
146-
libdir_suffix = '/wasm32-wasi-threads'
146+
libdir_suffix = '/wasm32-wasip1-threads'
147147
self.cmake_options.define('LIBCXX_LIBDIR_SUFFIX:STRING', libdir_suffix)
148148
self.cmake_options.define('LIBCXXABI_LIBDIR_SUFFIX:STRING', libdir_suffix)
149149
self.cmake_options.define('CMAKE_STAGING_PREFIX:PATH', '/')
@@ -183,7 +183,7 @@ def _build(self, host_target, enable_wasi_threads=False):
183183
self.cmake_options.define('CMAKE_C_FLAGS:STRING', ' '.join(c_flags))
184184
self.cmake_options.define('CMAKE_CXX_FLAGS:STRING', ' '.join(cxx_flags))
185185

186-
target_triple = 'wasm32-wasi-threads' if enable_wasi_threads else 'wasm32-wasi'
186+
target_triple = 'wasm32-wasip1-threads' if enable_wasi_threads else 'wasm32-wasi'
187187
self.cmake_options.define('CMAKE_C_COMPILER_TARGET:STRING', target_triple)
188188
self.cmake_options.define('CMAKE_CXX_COMPILER_TARGET:STRING', target_triple)
189189

0 commit comments

Comments
 (0)