From cafc657f06443e21afaae67daa4e0ea1fb3707fe Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Sun, 9 Aug 2026 11:02:33 +0300 Subject: [PATCH] build: rebuild the Rust archive when the Kconfig changes The cargo feature set is derived from Kconfig (CONFIG_APPELFLOADER_ELF_BINFMT selects the `binfmt` feature), but the archive only depended on the Rust sources. Toggling that symbol therefore left the previously built archive in place, and the link failed on the binfmt entry points that glue/shim.c had just started referencing: appelfloader.o: in function `binfmt_load': undefined reference to `elfrs_binfmt_load' Add $(UK_CONFIG) as a prerequisite so any Kconfig change re-runs cargo, which then does its own up-to-date check. --- Makefile.uk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile.uk b/Makefile.uk index b59b6de..9e3cfc7 100644 --- a/Makefile.uk +++ b/Makefile.uk @@ -48,10 +48,15 @@ APPELFLOADER_RUST_FEATURES-$(CONFIG_APPELFLOADER_ELF_BINFMT) += binfmt APPELFLOADER_RUST_FEATURE_FLAGS := $(if $(APPELFLOADER_RUST_FEATURES-y), \ --features $(subst $(space),$(comma),$(strip $(APPELFLOADER_RUST_FEATURES-y)))) +# $(UK_CONFIG) is a prerequisite because the *feature set* is derived from +# Kconfig: without it, toggling CONFIG_APPELFLOADER_ELF_BINFMT leaves the +# previously built archive in place and the link fails on the binfmt entry +# points that glue/shim.c has just started referencing. APPELFLOADER_RUST_SRCS := \ $(wildcard $(APPELFLOADER_RUST_DIR)/src/*.rs) \ $(APPELFLOADER_RUST_DIR)/Cargo.toml \ - $(APPELFLOADER_RUST_DIR)/rust-toolchain.toml + $(APPELFLOADER_RUST_DIR)/rust-toolchain.toml \ + $(UK_CONFIG) # CARGO can be overridden for a pinned toolchain (`make CARGO="cargo +1.83"`). CARGO ?= cargo -- 2.51.2