cmake/tools: Fix panic_immediate_abort deprecation in Rust build

Replace deprecated -Zbuild-std-features=panic_immediate_abort with
-Cpanic=immediate-abort compiler flag via RUSTFLAGS.

The panic_immediate_abort feature has been stabilized as a real panic
strategy in recent Rust nightly versions. The old method of enabling
it via -Zbuild-std-features is no longer supported and triggers a
compile error in core/src/panicking.rs.

Changes:
* cmake/nuttx_add_rust.cmake: Use RUSTFLAGS with -Cpanic=immediate-abort
* tools/Rust.mk: Use RUSTFLAGS with -Cpanic=immediate-abort

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi 2026-03-10 09:45:33 +08:00 committed by Alan C. Assis
parent 8579459bb0
commit b5d151f73f
2 changed files with 6 additions and 6 deletions

View file

@ -90,8 +90,8 @@ endef
ifeq ($(CONFIG_DEBUG_FULLOPT),y)
define RUST_CARGO_BUILD
NUTTX_INCLUDE_DIR=$(TOPDIR)/include:$(TOPDIR)/include/arch \
RUSTFLAGS="-Zunstable-options -Cpanic=immediate-abort" \
cargo build --release -Zbuild-std=std,panic_abort \
-Zbuild-std-features=panic_immediate_abort \
--manifest-path $(2)/$(1)/Cargo.toml \
--target $(call RUST_TARGET_TRIPLE)
endef