Skip to content

Commit bfb4b9b

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 86eca88 commit bfb4b9b

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
@@ -148,7 +148,7 @@ def _build(self, host_target, enable_wasi_threads=False):
148148

149149
libdir_suffix = '/wasm32-wasi'
150150
if enable_wasi_threads:
151-
libdir_suffix = '/wasm32-wasi-threads'
151+
libdir_suffix = '/wasm32-wasip1-threads'
152152
self.cmake_options.define('LIBCXX_LIBDIR_SUFFIX:STRING', libdir_suffix)
153153
self.cmake_options.define('LIBCXXABI_LIBDIR_SUFFIX:STRING', libdir_suffix)
154154
self.cmake_options.define('CMAKE_STAGING_PREFIX:PATH', '/')
@@ -188,7 +188,7 @@ def _build(self, host_target, enable_wasi_threads=False):
188188
self.cmake_options.define('CMAKE_C_FLAGS:STRING', ' '.join(c_flags))
189189
self.cmake_options.define('CMAKE_CXX_FLAGS:STRING', ' '.join(cxx_flags))
190190

191-
target_triple = 'wasm32-wasi-threads' if enable_wasi_threads else 'wasm32-wasi'
191+
target_triple = 'wasm32-wasip1-threads' if enable_wasi_threads else 'wasm32-wasi'
192192
self.cmake_options.define('CMAKE_C_COMPILER_TARGET:STRING', target_triple)
193193
self.cmake_options.define('CMAKE_CXX_COMPILER_TARGET:STRING', target_triple)
194194

0 commit comments

Comments
 (0)