Open sosthene-nitrokey opened 1 week ago
The CC
environment variable is not set to in the CI docker container, so the cc
crate should default to the cc
binary AFAIS which is gcc
in the container.
https://github.com/rust-lang/cc-rs/blob/5835783f0e3a02cc343ed02e272b54988ee8a423/src/lib.rs#L2625
I tried to build the firmware with CC=clang
but ran into some linker errors – requires some more investigation.
On my machine, the
cc
crate used to compilelittlefs
usesgcc
by default, but we would probably benefit from usingclang
instead, as it would allow us to reduce the need for multiple toolchains, and also it might allow cross-language LTO, meaning more inlining/optimizations.When changing
littlefs2-sys
's build system to use clang instead it fails to find the definitions for the C standard functions it relies upon (whilegcc
bundles them with the custom compiler toolchain).