Thread (15 messages) flat view 15 messages, 3 authors, 2026-04-03
STALE170d

Revision v7 of 17 in this series.

Revisions (17)
  1. v2 [diff vs current]
  2. v3 [diff vs current]
  3. v4 [diff vs current]
  4. v5 [diff vs current]
  5. v6 [diff vs current]
  6. v7 current
  7. v8 [diff vs current]
  8. v9 [diff vs current]
  9. v10 [diff vs current]
  10. v11 [diff vs current]
  11. v12 [diff vs current]
  12. v13 [diff vs current]
  13. v14 [diff vs current]
  14. v15 [diff vs current]
  15. v16 [diff vs current]
  16. v17 [diff vs current]
  17. v17 [diff vs current]

[PATCH V7 1/4] rust: Fix a race condition in Makefile

From: Mukesh Kumar Chaurasiya (IBM) <hidden>
Date: 2026-03-29 16:03:16
Also in: lkml, rust-for-linux
Subsystem: rust, the rest · Maintainers: Miguel Ojeda, Linus Torvalds

When compiling with -j1 flag in powerpc, the libproc_macro finds the
libcore.rmeta both in toolchain and local rust directory. libproc_macro
should use the toolchain provided libcore.rmeta.

So for this, make libproc_macro2 libquote and libsyn dependent on core.o
so that libcore.rmeta is generated after these 3 files are done
compiling.

Signed-off-by: Mukesh Kumar Chaurasiya (IBM) <redacted>
---
 rust/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/rust/Makefile b/rust/Makefile
index 9801af2e1e02..8e62f6fcf94f 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -650,7 +650,8 @@ $(obj)/core.o: private skip_flags = $(core-skip_flags)
 $(obj)/core.o: private rustc_objcopy = $(foreach sym,$(redirect-intrinsics),--redefine-sym $(sym)=__rust$(sym))
 $(obj)/core.o: private rustc_target_flags = $(core-flags)
 $(obj)/core.o: $(RUST_LIB_SRC)/core/src/lib.rs \
-    $(wildcard $(objtree)/include/config/RUSTC_VERSION_TEXT) FORCE
+    $(wildcard $(objtree)/include/config/RUSTC_VERSION_TEXT) FORCE \
+    | $(obj)/libproc_macro2.rlib $(obj)/libquote.rlib $(obj)/libsyn.rlib FORCE
 	+$(call if_changed_rule,rustc_library)
 ifneq ($(or $(CONFIG_X86_64),$(CONFIG_X86_32)),)
 $(obj)/core.o: scripts/target.json
-- 
2.53.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help