From 9096f4b16f56ea6f6d3b1a5d9997873a029d47d0 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 10 Oct 2024 10:27:25 -0700 Subject: [PATCH] Add Clang builtins for threads targets This change adds the `libclang_rt.builtins-wasm32.a` to the appropriate Clang directory for the threaded variants of the WASI targets (`lib/wasi-threads`, `lib/wasip1-threads`). This fixes #543. --- cmake/wasi-sdk-sysroot.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/wasi-sdk-sysroot.cmake b/cmake/wasi-sdk-sysroot.cmake index 127ca62d3..7df4c731d 100644 --- a/cmake/wasi-sdk-sysroot.cmake +++ b/cmake/wasi-sdk-sysroot.cmake @@ -93,10 +93,14 @@ add_custom_target(compiler-rt-post-build COMMAND ${CMAKE_COMMAND} -E copy_directory ${clang_resource_dir}/include ${wasi_resource_dir}/include - # Copy the `lib/wasi` folder to `libc/wasi{p1,p2}` to ensure that those - # OS-strings also work for looking up the compiler-rt.a file. + # Copy the `lib/wasi` folder to `libc/wasi{p1,p2}{-threads}?` to ensure that + # those OS-strings also work for looking up the compiler-rt.a file. + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${wasi_resource_dir}/lib/wasi ${wasi_resource_dir}/lib/wasi-threads COMMAND ${CMAKE_COMMAND} -E copy_directory ${wasi_resource_dir}/lib/wasi ${wasi_resource_dir}/lib/wasip1 + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${wasi_resource_dir}/lib/wasi ${wasi_resource_dir}/lib/wasip1-threads COMMAND ${CMAKE_COMMAND} -E copy_directory ${wasi_resource_dir}/lib/wasi ${wasi_resource_dir}/lib/wasip2