From a7ca86ddb11e2e4247a62d32cf3fa1c2293c743a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 10 Mar 2026 15:44:03 -0700 Subject: [PATCH] Review comments --- .github/workflows/main.yml | 4 ++-- CppExceptions.md | 6 +++--- cmake/wasi-sdk-sysroot.cmake | 6 ++++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d00dc91..83c2c8b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -172,10 +172,10 @@ jobs: - run: cargo install wasm-component-ld@0.5.21 - name: Install LLVM 22 run: | - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - v=22 rel=$(lsb_release -cs) - sudo apt-add-repository "deb http://apt.llvm.org/$rel/ llvm-toolchain-$rel-$v main" + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/keyrings/llvm.asc + echo "deb [signed-by=/etc/apt/keyrings/llvm.asc] http://apt.llvm.org/$rel/ llvm-toolchain-$rel-$v main" | sudo tee /etc/apt/sources.list.d/llvm-$v.list sudo apt-get update -y && sudo apt-get install -y clang-$v lld-$v - run: | cmake -G Ninja -B build -S . \ diff --git a/CppExceptions.md b/CppExceptions.md index f51e0ff..1ca79bf 100644 --- a/CppExceptions.md +++ b/CppExceptions.md @@ -3,7 +3,7 @@ > **Note**: this documentation does not cover wasi-sdk-31, the latest version > of wasi-sdk at this time. -From wasi-sdk-32 and onwards the artifacts produced by this repository support +From wasi-sdk-33 and onwards the artifacts produced by this repository support compiling C++ code both with and without exceptions. The sysroot for wasm targets contains two copies of the C++ standard library and headers -- one with exceptions enabled and one with exceptions disabled. These are automatically @@ -62,9 +62,9 @@ wasi-sdk at this time: issues in this repository itself as well as [resolving some upstream issues](https://github.com/llvm/llvm-project/issues/188077). * Currently `-fwasm-exceptions` is a required flag to enable C++ exceptions. - It's unclear whethe `-fexceptions` should also be supported as a substitute. + It's unclear whether `-fexceptions` should also be supported as a substitute. * Currently LLVM defaults to using the legacy exception-handling proposal and this will likely change in the future. Precompiled libraries for wasi-sdk are - all built with the standard exception-handlign proposal. + all built with the standard exception-handling proposal. * Currently `-lunwind` is required when linking, but this may become automatic in the future. diff --git a/cmake/wasi-sdk-sysroot.cmake b/cmake/wasi-sdk-sysroot.cmake index b29a5f4..d58afd2 100644 --- a/cmake/wasi-sdk-sysroot.cmake +++ b/cmake/wasi-sdk-sysroot.cmake @@ -377,6 +377,12 @@ endfunction() function(define_libcxx target) add_custom_target(libcxx-${target}) + # For dual-mode exceptions-and-not there are two versions of libcxx which are + # compiled and placed into the sysroot. They're named slightly differently to + # have unique CMake rules. + # + # Otherwise there's only one build of libcxx and it's either got exceptions for + # it doesn't depending on configuration. if (WASI_SDK_EXCEPTIONS STREQUAL "DUAL") define_libcxx_and_lto(${target} "" OFF) define_libcxx_and_lto(${target} "-exn" ON)