-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
Area: toolchainArea: toolchains; everything related to compilation, libc, linking, …Area: toolchains; everything related to compilation, libc, linking, …Type: trackingThe issue tracks and organizes the sub-tasks of a larger effortThe issue tracks and organizes the sub-tasks of a larger effort
Description
Description
Currently, RIOT has limited LLVM support - it allows compiling with LLVM. Linking is still using the gnu toolchain.
Also, our libcs (newlib, picolibc) are gcc compiles, and thus depend on libgcc.
Those dependencies have several drawbacks:
- LLVM+LTO doesn't work (as GNU ld doesn't understand clang's bitcode)
- LLVM+LTO can't do LTO between libc/libgcc and RIOT code
- There's a GCC toolchain per architecture, those are maintenance heavy and fragmented. Pure LLVM would reduce this to a single toolchain for most architectures (well, maybe xtensa would still need another build...). With pure-LLVM support, we could have a (possibly alternative) much thinner riotdocker image.
- Rust code (incl. RIOT-rs) is built using LLVM, the gcc linker prevents cross-language LTO
This is issue will track work necessary for LLVM-only builds.
- make linker scripts compatible with lld
- provide llvm-built libcs
- picolibc allows building using llvm -> provide builds
- while LLVM / clang usually support compiling for all architectures, they generate code that requires compiler-rt. -> provide builds of that
- gcc has a working multilib mechanism to select the correct libc for a (sub-)architecture when linking. llvm doesn't, so this needs to be worked around
- lld doesn't support spec files. directly select the correct libs
nmeum
Metadata
Metadata
Assignees
Labels
Area: toolchainArea: toolchains; everything related to compilation, libc, linking, …Area: toolchains; everything related to compilation, libc, linking, …Type: trackingThe issue tracks and organizes the sub-tasks of a larger effortThe issue tracks and organizes the sub-tasks of a larger effort