================
@@ -293,6 +255,19 @@ if (NOT(CLANG_DEFAULT_CXX_STDLIB STREQUAL "" OR
"Default C++ stdlib to use (\"libstdc++\" or \"libc++\", empty for
platform default" FORCE)
endif()
+set(CLANG_DEFAULT_C_STDLIB "" CACHE STRING
+ "Default C stdlib to use (\"newlib\", \"newlib-nano\", \"picolibc\",
\"llvm-libc\", or \"system\", empty for platform default)")
+if (NOT(CLANG_DEFAULT_C_STDLIB STREQUAL "" OR
+ CLANG_DEFAULT_C_STDLIB STREQUAL "newlib" OR
+ CLANG_DEFAULT_C_STDLIB STREQUAL "newlib-nano" OR
+ CLANG_DEFAULT_C_STDLIB STREQUAL "picolibc" OR
+ CLANG_DEFAULT_C_STDLIB STREQUAL "llvm-libc" OR
+ CLANG_DEFAULT_C_STDLIB STREQUAL "system"))
+ message(WARNING "Resetting default C stdlib to use platform default")
+ set(CLANG_DEFAULT_C_STDLIB "" CACHE STRING
+ "Default C stdlib to use (\"newlib\", \"newlib-nano\", \"picolibc\",
\"llvm-libc\", or \"system\", empty for platform default)" FORCE)
+endif()
----------------
voltur01 wrote:
I can think of two other ways:
1. Add a file with the name of the default library under `lib/clang-runtimes/`,
however this will need to read that file in the driver, which is not great.
2. Try to pre-set `--cstdlib` in the default config files: `clang.cfg` and
`clang++.cfg` by generating them during the build.
https://github.com/llvm/llvm-project/pull/185870
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits