Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit bcf68d0

Browse files
ojedaDarksonn
authored andcommitted
FROMLIST: kbuild: rust: replace proc macros dependency on core.o with the version text
With the `RUSTC_VERSION_TEXT` rebuild support in place, now proc macros can depend on that instead of `core.o`. This means that both the `core` and `macros` crates can be built in parallel, and that touching `core.o` does not trigger a rebuild of the proc macros. Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Link: https://lore.kernel.org/r/20240808221138.873750-6-ojeda@kernel.org Change-Id: I9c5c16cc4fb826c4f70823b36f9a47a1197fd47c Signed-off-by: Alice Ryhl <aliceryhl@google.com>
1 parent 03c4391 commit bcf68d0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

rust/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,8 @@ quiet_cmd_rustc_procmacro = $(RUSTC_OR_CLIPPY_QUIET) P $@
329329
--crate-name $(patsubst lib%.so,%,$(notdir $@)) $<
330330

331331
# Procedural macros can only be used with the `rustc` that compiled it.
332-
# Therefore, to get `libmacros.so` automatically recompiled when the compiler
333-
# version changes, we add `core.o` as a dependency (even if it is not needed).
334-
$(obj)/libmacros.so: $(src)/macros/lib.rs $(obj)/core.o FORCE
332+
$(obj)/libmacros.so: $(src)/macros/lib.rs \
333+
$(wildcard $(objtree)/include/config/RUSTC_VERSION_TEXT) FORCE
335334
+$(call if_changed_dep,rustc_procmacro)
336335

337336
quiet_cmd_rustc_library = $(if $(skip_clippy),RUSTC,$(RUSTC_OR_CLIPPY_QUIET)) L $@

0 commit comments

Comments
 (0)