Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Clang builtins for threads targets #494

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cmake/wasi-sdk-sysroot.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
abrown marked this conversation as resolved.
Show resolved Hide resolved
# 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

Expand Down
10 changes: 10 additions & 0 deletions tests/general/builtin-floatdidf.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Primarily check that `libclang_rt.builtins-wasm32.a` functions are present
// and work as expected on all tested targets, not the builtin functionality.

#include <assert.h>

int main() {
double f = __floatdidf(0);
assert(f == 0.0);
return 0;
}
Loading