From 8901470a9a33d29059352bfddbc1187b046ebc4b Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 11 Aug 2026 07:55:56 -0700 Subject: [PATCH] Try again to fix things... --- cmake/wasi-sdk-sysroot.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/wasi-sdk-sysroot.cmake b/cmake/wasi-sdk-sysroot.cmake index 721d5b8..568be80 100644 --- a/cmake/wasi-sdk-sysroot.cmake +++ b/cmake/wasi-sdk-sysroot.cmake @@ -291,6 +291,10 @@ function(define_libcxx_sub sysroot target target_suffix extra_target_flags extra set(exnsuffix "") if (exceptions) + # Building with `-fPIC` requires fixes in LLVM 23-and-later. + if(CMAKE_C_COMPILER_VERSION VERSION_LESS 23.0.0) + set(pic OFF) + endif() set(runtimes "libunwind;${runtimes}") list(APPEND extra_flags -fwasm-exceptions -mllvm -wasm-use-legacy-eh=false) if (WASI_SDK_EXCEPTIONS STREQUAL "DUAL")