diff options
| -rw-r--r-- | rust/Makefile | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/rust/Makefile b/rust/Makefile index 8dfccf7399d9..df90fabefb70 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -48,10 +48,9 @@ endif ifdef CONFIG_RUST procmacro-name = $(shell MAKEFLAGS= $(RUSTC) --print file-names --crate-name $(1) --crate-type proc-macro - </dev/null) +procmacro-extension := $(patsubst libname.%,%,$(call procmacro-name,name)) libmacros_name := $(call procmacro-name,macros) -libmacros_extension := $(patsubst libmacros.%,%,$(libmacros_name)) - libpin_init_internal_name := $(call procmacro-name,pin_init_internal) always-$(CONFIG_RUST) += $(libmacros_name) $(libpin_init_internal_name) @@ -549,7 +548,7 @@ quiet_cmd_rustc_procmacro = $(RUSTC_OR_CLIPPY_QUIET) P $@ -Clink-args='$(call escsq,$(KBUILD_PROCMACROLDFLAGS))' \ --emit=dep-info=$(depfile) --emit=link=$@ --extern proc_macro \ --crate-type proc-macro -L$(objtree)/$(obj) \ - --crate-name $(patsubst lib%.$(libmacros_extension),%,$(notdir $@)) \ + --crate-name $(patsubst lib%.$(procmacro-extension),%,$(notdir $@)) \ @$(objtree)/include/generated/rustc_cfg $< # Procedural macros can only be used with the `rustc` that compiled it. |
