From a0faf1ec8b410f059ce16981c93143eb8c42d8d9 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 30 Jun 2025 17:29:33 -0700 Subject: [PATCH] Pass BUILTINS_LIB to wasi-libc build --- cmake/wasi-sdk-sysroot.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/wasi-sdk-sysroot.cmake b/cmake/wasi-sdk-sysroot.cmake index 37fa118..735f02a 100644 --- a/cmake/wasi-sdk-sysroot.cmake +++ b/cmake/wasi-sdk-sysroot.cmake @@ -164,6 +164,8 @@ function(define_wasi_libc_sub target target_suffix lto) "${CMAKE_C_FLAGS} ${directory_cflags} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UPPER}}") list(JOIN extra_cflags_list " " extra_cflags) + set(libcompiler_rt_a ${wasi_resource_dir}/lib/wasm32-unknown-wasi/libclang_rt.builtins.a) + ExternalProject_Add(wasi-libc-${target}${target_suffix}-build # Currently wasi-libc doesn't support out-of-tree builds so feign a # "download command" which copies the source tree to a different location @@ -180,6 +182,7 @@ function(define_wasi_libc_sub target target_suffix lto) SYSROOT=${wasi_sysroot} EXTRA_CFLAGS=${extra_cflags} TARGET_TRIPLE=${target} + BUILTINS_LIB=${libcompiler_rt_a} ${extra_make_flags} INSTALL_COMMAND "" DEPENDS compiler-rt