zephyr/cmake/toolchain/llvm
Torsten Rasmussen 0274bcbee4 cmake: detect LLVM picolibc and newlib support
Newlib or Picolibc libraries for LLVM may be compiled or installed from
pre-built sources independently of LLVM itself.

This means that always indicating that TOOLCHAIN_HAS_NEWLIB=OFF and
TOOLCHAIN_HAS_PICOLIBC=OFF are wrong. But it could be just as wrong to
always indicate suport for newlib or picolibc.

Some pre-built LLVM toolchains are provided with default picolibc
support, such as LLVM for Arm embedded, but can also be used with newlib
be installing newlib add-on package.

Unfortunately it's not possible to query LLVM regarding newlib or
picolibc support.

Developers have the option of `-DTOOLCHAIN_HAS_<NEWLIB|PICOLIBC>=ON`,
but this is not widely known and cumbersome to do for each build.

An indication of newlib or picolibc support is the presence of library
specific headers, so to improve current situation we check for library
specific headers, and if those are present we assume support for the
library.

This commit improves the current support for LLVM in Zephyr when
cross-compiling, especially for users of LLVM for Arm embedded.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-10-04 16:34:35 +01:00
..
clang_compiler_rt.cfg llvm: Add support for selecting runtime library 2023-08-03 19:35:11 +02:00
clang_libgcc.cfg llvm: Add support for selecting runtime library 2023-08-03 19:35:11 +02:00
generic.cmake cmake: detect LLVM picolibc and newlib support 2024-10-04 16:34:35 +01:00
Kconfig kconfig: llvm: arm64: Advertise TLS support when using llvm for arm64 2024-06-13 17:58:04 +02:00
target.cmake cmake: llvm: arm64: Set arm64 flags when building with clang 2024-06-13 17:58:04 +02:00