Expand description
Release compiler flags for the vendored Aeron C build.
The choice lives here rather than in build_common.rs, which each crate’s
build script include!s and so cannot be unit-tested in place.
Enums§
- CpuTarget
- Which CPUs a release build of Aeron C must run on.
Functions§
- c_
lto_ flags - The
CMAKE_C_FLAGSfor cross-language LTO:-fltoforRUSTERON_C_LTO(full, the default, orthin), and--targetset to rustc’starget(cargo’sTARGET). Without it clang tags the bitcode with its own default triple (x86_64-pc-linux-gnuon Debian and Ubuntu), and lld warns on every C module linked into Rust’sx86_64-unknown-linux-gnu. The cmake crate would pass--targetitself, but skips its compiler flags onceCMAKE_C_FLAGSis defined. - llvm_
major - The LLVM major version in
rustc -vV(LLVM version: 22.1.2) orclang --version(clang version 22.1.8) output. - lto_
release_ c_ flags CMAKE_C_FLAGS_RELEASEunder cross-language LTO. LLVM inlines a C function into a Rust caller only when the C target features are a subset of Rust’s, so C targets exactly the CPU rustc does (rustc_cpu, from-Ctarget-cpu;Nonekeeps both on the target default).- release_
c_ flags CMAKE_C_FLAGS_RELEASEfor the Aeron C build ofarch(CARGO_CFG_TARGET_ARCH) andvendor(CARGO_CFG_TARGET_VENDOR) fortarget.march(RUSTERON_C_MARCH) overrides the target’s-march.- rustc_
target_ cpu - The last
-Ctarget-cpuinCARGO_ENCODED_RUSTFLAGS. - wants_
linker_ plugin_ lto - Whether the final binary links with
-Clinker-plugin-lto, fromCARGO_ENCODED_RUSTFLAGS(flags separated by0x1f). That flag is the switch for cross-language LTO: Aeron C is then compiled to LLVM bitcode so the linker can inline it into Rust callers.