Skip to content

Commit 67a9249

Browse files
committed
fix module recognition for rust modules
This is currenlty hacky Signed-off-by: Finn Behrens <[email protected]>
1 parent c5cfab4 commit 67a9249

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/Makefile.build

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,20 +307,22 @@ $(obj)/%.lst: $(src)/%.c FORCE
307307
# ---------------------------------------------------------------------------
308308

309309
quiet_cmd_cargo = CARGO $(quiet_modtag) $@
310-
cmd_cargo = export RUST_BINDGEN_FILE=$(shell readlink -f rust_bindings.rs) && $(CARGO) build $(cargo_flags) -p $(shell basename $(basename $(src))) --out-dir $(src)
310+
cmd_cargo = export RUST_BINDGEN_FILE=$(shell readlink -f rust_bindings.rs) && $(CARGO) build -p $(shell basename $(basename $(src))) --out-dir $(src) $(cargo_flags)
311311

312312
rust_bindings.rs: FORCE
313-
$(Q)$(BINDGEN) $(srctree)/rust/kernel/src/bindings_helper.h --opaque-type xregs_state --opaque-type desc_struct --use-core --ctypes-prefix c_types -o rust_bindings.rs --size_t-is-usize -- $(c_flags)
313+
$(Q)$(BINDGEN) $(srctree)/rust/kernel/src/bindings_helper.h --no-rustfmt-bindings --opaque-type xregs_state --opaque-type desc_struct --use-core --ctypes-prefix c_types -o rust_bindings.rs --size_t-is-usize -- $(c_flags)
314314

315315
# The .o from the Rust staticlib
316316
#$(obj)/%.o: $(src)/out/lib%.a
317-
$(obj)/%.o: $(obj)/lib%.a
317+
$(obj)/%.o: $(obj)/lib%.a $(obj)/%.a
318318
$(Q)$(LD) -r -o $@ --whole-archive $<
319319

320320
# The Rust staticlib from cargo
321-
$(obj)/lib%.a: FORCE rust_bindings.rs
321+
$(obj)/%.a: rust_bindings.rs FORCE
322322
$(call cmd,cargo)
323323

324+
$(obj)/lib%.a:
325+
324326
# Compile assembler sources (.S)
325327
# ---------------------------------------------------------------------------
326328

0 commit comments

Comments
 (0)