Skip to content

Commit

Permalink
build: Rename wasi-threads to wasip1-threads
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kateinoigakukun committed Mar 28, 2024
1 parent 4d1b3b7 commit 7cfecf3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmake/modules/SwiftConfigureSDK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ macro(configure_sdk_unix name architectures)
endif()
set(SWIFT_SDK_WASI_ARCH_wasm32_PATH "${SWIFT_WASI_SYSROOT_PATH}")
if(SWIFT_ENABLE_WASI_THREADS)
set(SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasi-threads")
set(SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasip1-threads")
else()
set(SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasi")
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def _build(self, host_target, enable_wasi_threads=False):
'libcxx;libcxxabi;compiler-rt')
libdir_suffix = '/wasm32-wasi'
if enable_wasi_threads:
libdir_suffix = '/wasm32-wasi-threads'
libdir_suffix = '/wasm32-wasip1-threads'
self.cmake_options.define('LIBCXX_LIBDIR_SUFFIX:STRING', libdir_suffix)
self.cmake_options.define('LIBCXXABI_LIBDIR_SUFFIX:STRING', libdir_suffix)
self.cmake_options.define('CMAKE_STAGING_PREFIX:PATH', '/')
Expand Down Expand Up @@ -183,7 +183,7 @@ def _build(self, host_target, enable_wasi_threads=False):
self.cmake_options.define('CMAKE_C_FLAGS:STRING', ' '.join(c_flags))
self.cmake_options.define('CMAKE_CXX_FLAGS:STRING', ' '.join(cxx_flags))

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

Expand Down

0 comments on commit 7cfecf3

Please sign in to comment.