diff options
Diffstat (limited to 'rust')
-rw-r--r-- | rust/Makefile | 7 | ||||
-rw-r--r-- | rust/macros/module.rs | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/rust/Makefile b/rust/Makefile index 28ba3b9ee18d..ec737bad7fbb 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -344,8 +344,11 @@ quiet_cmd_rustc_library = $(if $(skip_clippy),RUSTC,$(RUSTC_OR_CLIPPY_QUIET)) L $(if $(rustc_objcopy),;$(OBJCOPY) $(rustc_objcopy) $@) rust-analyzer: - $(Q)$(srctree)/scripts/generate_rust_analyzer.py $(srctree) $(objtree) \ - $(RUST_LIB_SRC) > $(objtree)/rust-project.json + $(Q)$(srctree)/scripts/generate_rust_analyzer.py \ + --cfgs='core=$(core-cfgs)' --cfgs='alloc=$(alloc-cfgs)' \ + $(abs_srctree) $(abs_objtree) \ + $(RUST_LIB_SRC) $(KBUILD_EXTMOD) > \ + $(if $(KBUILD_EXTMOD),$(extmod_prefix),$(objtree))/rust-project.json $(obj)/core.o: private skip_clippy = 1 $(obj)/core.o: private skip_flags = -Dunreachable_pub diff --git a/rust/macros/module.rs b/rust/macros/module.rs index 94a92ab82b6b..eeca6b2d5160 100644 --- a/rust/macros/module.rs +++ b/rust/macros/module.rs @@ -229,6 +229,7 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream { #[cfg(MODULE)] #[doc(hidden)] #[no_mangle] + #[link_section = \".exit.text\"] pub extern \"C\" fn cleanup_module() {{ // SAFETY: // - This function is inaccessible to the outside due to the double |