Skip to content

Commit ca5e7a6

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 ee0839a commit ca5e7a6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-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: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def _build(self, host_target, enable_wasi_threads=False):
150150

151151
libdir_suffix = '/wasm32-wasi'
152152
if enable_wasi_threads:
153-
libdir_suffix = '/wasm32-wasi-threads'
153+
libdir_suffix = '/wasm32-wasip1-threads'
154154
self.cmake_options.define('LIBCXX_LIBDIR_SUFFIX:STRING', libdir_suffix)
155155
self.cmake_options.define('LIBCXXABI_LIBDIR_SUFFIX:STRING', libdir_suffix)
156156
self.cmake_options.define('CMAKE_STAGING_PREFIX:PATH', '/')
@@ -190,7 +190,10 @@ def _build(self, host_target, enable_wasi_threads=False):
190190
self.cmake_options.define('CMAKE_C_FLAGS:STRING', ' '.join(c_flags))
191191
self.cmake_options.define('CMAKE_CXX_FLAGS:STRING', ' '.join(cxx_flags))
192192

193-
target_triple = 'wasm32-wasi-threads' if enable_wasi_threads else 'wasm32-wasi'
193+
if enable_wasi_threads:
194+
target_triple = 'wasm32-wasip1-threads'
195+
else:
196+
target_triple = 'wasm32-wasi'
194197
self.cmake_options.define('CMAKE_C_COMPILER_TARGET:STRING', target_triple)
195198
self.cmake_options.define('CMAKE_CXX_COMPILER_TARGET:STRING', target_triple)
196199

0 commit comments

Comments
 (0)