Files
openwrt/include
Daniel Golle 96b07ffc67 build: pass the Rust flags of packages as RUSTFLAGS
Cargo packages get the rustc flags of the build system in
CARGO_TARGET_<TRIPLE>_RUSTFLAGS, the environment form of the
configuration key target.<triple>.rustflags. Cargo joins it with the
entries of that key and of target.<cfg>.rustflags in the
.cargo/config.toml of the sources. ripgrep sets
-Ctarget-feature=+crt-static there for x86_64-unknown-linux-musl, rustc
lets it win over -crt-static, and the static PIE link of rg fails on
the non-PIC libpcre2-8.a.

Pass the flags in RUSTFLAGS. Cargo takes the rustc flags from a single
source and prefers RUSTFLAGS to the target and build keys of the
configuration, so that a target crate is compiled with the flags of
the build system alone. Package builds name the target with --target
or CARGO_BUILD_TARGET, and cargo then keeps RUSTFLAGS off build scripts
and proc macros, also when the target triple is the build host's. A
package that needs a flag from the configuration of its sources adds
it to CARGO_RUSTFLAGS.

Fixes: 32f1c26eb6 ("build: add Rust package build helpers")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-11-27 00:58:39 +00:00
..
2021-02-05 14:54:47 +01:00
2026-11-14 14:26:19 +01:00
2022-11-27 00:52:06 +01:00
2025-10-20 00:55:06 +02:00
2026-10-21 18:46:59 +02:00