[CMake][Fuchsia] Include libunwind and libc++abi in baremetal build#206293
Open
petrhosek wants to merge 1 commit into
Open
[CMake][Fuchsia] Include libunwind and libc++abi in baremetal build#206293petrhosek wants to merge 1 commit into
petrhosek wants to merge 1 commit into
Conversation
These are needed for baremetal targets as well.
|
@llvm/pr-subscribers-clang Author: Petr Hosek (petrhosek) ChangesThese are needed for baremetal targets as well. Full diff: https://github.com/llvm/llvm-project/pull/206293.diff 1 Files Affected:
diff --git a/clang/cmake/caches/Fuchsia-stage2.cmake b/clang/cmake/caches/Fuchsia-stage2.cmake
index 401258e9ae70e..934083fe4574d 100644
--- a/clang/cmake/caches/Fuchsia-stage2.cmake
+++ b/clang/cmake/caches/Fuchsia-stage2.cmake
@@ -9,6 +9,7 @@ set(PACKAGE_VENDOR Fuchsia CACHE STRING "")
set(_FUCHSIA_ENABLE_PROJECTS "bolt;clang;clang-tools-extra;lld;llvm;polly")
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
+set(LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "")
set(LLVM_ENABLE_DIA_SDK OFF CACHE BOOL "")
set(LLVM_ENABLE_FATLTO ON CACHE BOOL "")
@@ -359,11 +360,26 @@ foreach(target armv6m-none-eabi;armv7m-none-eabi;armv7em-none-eabi;armv8m.main-n
endforeach()
set(RUNTIMES_${target}_LLVM_LIBC_FULL_BUILD ON CACHE BOOL "")
set(RUNTIMES_${target}_LIBC_ENABLE_USE_BY_CLANG ON CACHE BOOL "")
- set(RUNTIMES_${target}_LIBCXX_ABI_UNSTABLE ON CACHE STRING "")
- set(RUNTIMES_${target}_LIBCXX_CXX_ABI none CACHE STRING "")
+ set(RUNTIMES_${target}_LIBUNWIND_IS_BAREMETAL ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBUNWIND_ENABLE_ASSERTIONS OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBUNWIND_ENABLE_THREADS OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBUNWIND_SHARED_OUTPUT_NAME "libunwind-shared" CACHE STRING "")
+ set(RUNTIMES_${target}_LIBUNWIND_ENABLE_STATIC ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBUNWIND_IS_BAREMETAL ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXXABI_BAREMETAL ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXXABI_ENABLE_ASSERTIONS OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXXABI_SHARED_OUTPUT_NAME "libc++abi-shared" CACHE STRING "")
+ set(RUNTIMES_${target}_LIBCXXABI_ENABLE_STATIC ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXXABI_ENABLE_THREADS OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_ABI_UNSTABLE ON CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC ON CACHE BOOL "")
- set(RUNTIMES_${target}_LIBCXX_SHARED_OUTPUT_NAME "c++-shared" CACHE STRING "")
+ set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_RANDOM_DEVICE OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_LOCALIZATION OFF CACHE BOOL "")
@@ -376,10 +392,11 @@ foreach(target armv6m-none-eabi;armv7m-none-eabi;armv7em-none-eabi;armv8m.main-n
set(RUNTIMES_${target}_LIBCXX_HAS_PTHREAD_LIB OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_HAS_RT_LIB OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_HAS_TERMINAL_AVAILABLE OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_SHARED_OUTPUT_NAME "c++-shared" CACHE STRING "")
set(RUNTIMES_${target}_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
set(RUNTIMES_${target}_LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
- set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "libc;libcxx" CACHE STRING "")
+ set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "libc;libunwind;libcxxabi;libcxx" CACHE STRING "")
set(RUNTIMES_${target}_RUNTIMES_USE_LIBC "llvm-libc" CACHE STRING "")
# Enable FatLTO for baremetal runtimes
@@ -417,11 +434,26 @@ foreach(target riscv32-unknown-elf)
endforeach()
set(RUNTIMES_${target}_LLVM_LIBC_FULL_BUILD ON CACHE BOOL "")
set(RUNTIMES_${target}_LIBC_ENABLE_USE_BY_CLANG ON CACHE BOOL "")
- set(RUNTIMES_${target}_LIBCXX_ABI_UNSTABLE ON CACHE STRING "")
- set(RUNTIMES_${target}_LIBCXX_CXX_ABI none CACHE STRING "")
+ set(RUNTIMES_${target}_LIBUNWIND_IS_BAREMETAL ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBUNWIND_ENABLE_ASSERTIONS OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBUNWIND_ENABLE_THREADS OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBUNWIND_SHARED_OUTPUT_NAME "libunwind-shared" CACHE STRING "")
+ set(RUNTIMES_${target}_LIBUNWIND_ENABLE_STATIC ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBUNWIND_IS_BAREMETAL ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXXABI_BAREMETAL ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXXABI_ENABLE_ASSERTIONS OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXXABI_SHARED_OUTPUT_NAME "libc++abi-shared" CACHE STRING "")
+ set(RUNTIMES_${target}_LIBCXXABI_ENABLE_STATIC ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXXABI_ENABLE_THREADS OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_ABI_UNSTABLE ON CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC ON CACHE BOOL "")
- set(RUNTIMES_${target}_LIBCXX_SHARED_OUTPUT_NAME "c++-shared" CACHE STRING "")
+ set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_RANDOM_DEVICE OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_LOCALIZATION OFF CACHE BOOL "")
@@ -434,10 +466,11 @@ foreach(target riscv32-unknown-elf)
set(RUNTIMES_${target}_LIBCXX_HAS_PTHREAD_LIB OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_HAS_RT_LIB OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_HAS_TERMINAL_AVAILABLE OFF CACHE BOOL "")
+ set(RUNTIMES_${target}_LIBCXX_SHARED_OUTPUT_NAME "c++-shared" CACHE STRING "")
set(RUNTIMES_${target}_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
set(RUNTIMES_${target}_LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
- set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "libc;libcxx" CACHE STRING "")
+ set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "libc;libunwind;libcxxabi;libcxx" CACHE STRING "")
set(RUNTIMES_${target}_RUNTIMES_USE_LIBC "llvm-libc" CACHE STRING "")
# Enable FatLTO for baremetal runtimes
|
Prabhuk
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These are needed for baremetal targets as well.