[libcxx] [llvm] [libc++] Add support for picolibc and newlib in RUNTIMES_USE_LIBC (PR #147956)
Volodymyr Turanskyy via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 16 06:55:12 PDT 2025
================
@@ -481,6 +481,21 @@ include(config-ix)
include(HandleLibC) # Setup the C library flags
include(HandleLibCXXABI) # Setup the ABI library flags
+# Set C library in use to define respective macro in __config_site
+# RUNTIMES_USE_LIBC was checked in HandleLibC to be one of accepted values
+if (RUNTIMES_USE_LIBC STREQUAL "llvm-libc")
+ set(LIBCXX_LIBC_LLVMLIBC 1)
+elseif (RUNTIMES_USE_LIBC STREQUAL "picolibc")
+ set(LIBCXX_LIBC_PICOLIBC 1)
+ # picolibc is derived from newlib and behaves the same in regards to libc++
+ # so setting both here:
+ # * LIBCXX_LIBC_NEWLIB is used now
+ # * LIBCXX_LIBC_PICOLIBC can be used for further customizations later
+ set(LIBCXX_LIBC_NEWLIB 1)
----------------
voltur01 wrote:
It was for completeness only - removed now.
https://github.com/llvm/llvm-project/pull/147956
More information about the llvm-commits
mailing list