Skip to contentSkip to conversation

samples: rust: fix `rust_print` build making it a combined module

PATCH RESEND Superseded Miguel Ojeda 3 participants 3 messages Nov 9, 2024 – Nov 11, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Miguel Ojeda

author maintainer
#0 lore raw

PATCH RESEND 1/1 samples: rust: fix `rust_print` build making it a combined module

The rust_print module, when built as a module, fails to build with:

ERROR: modpost: missing MODULE_LICENSE() in samples/rust/rust_print_events.o
ERROR: modpost: "__tracepoint_rust_sample_loaded" [samples/rust/rust_print.ko] undefined!
ERROR: modpost: "rust_do_trace_rust_sample_loaded" [samples/rust/rust_print.ko] undefined!

Fix it by building it as a combined one.

Fixes 91d39024e1b0 ("rust: samples: add tracepoint to Rust sample")

---
Steven: please feel free to rebase the original if that is better for you, but in case you prefer a formal patch on top, here it is. Thanks!

 samples/rust/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
samples/rust/Makefile +3 -1
index f29280ec4820..17017115657d 100644
@@ -2,6 +2,8 @@
 ccflags-y += -I$(src)				# needed for trace events
 
 obj-$(CONFIG_SAMPLE_RUST_MINIMAL)		+= rust_minimal.o
-obj-$(CONFIG_SAMPLE_RUST_PRINT)			+= rust_print.o rust_print_events.o
+obj-$(CONFIG_SAMPLE_RUST_PRINT)			+= rust-print.o
+
+rust-print-y := rust_print.o rust_print_events.o
 
 subdir-$(CONFIG_SAMPLE_RUST_HOSTPROGS)		+= hostprogs

base-commit: 91d39024e1b02914cc5e2dbc137908e29b269ce4 --
2.47.0

reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Miguel Ojeda

The rust_print module, when built as a module, fails to build with:

ERROR: modpost: missing MODULE_LICENSE() in samples/rust/rust_print_events.o
ERROR: modpost: "__tracepoint_rust_sample_loaded" [samples/rust/rust_print.ko] undefined!
ERROR: modpost: "rust_do_trace_rust_sample_loaded" [samples/rust/rust_print.ko] undefined!

Quoted 6 lines

Fix it by building it as a combined one.

Fixes 91d39024e1b0 ("rust: samples: add tracepoint to Rust sample")

Thanks for fixing this, Miguel!

#2 lore raw
In reply to Miguel Ojeda

samples/rust/Makefile line 7

Quoted 6 lines · Miguel Ojeda

obj-$(CONFIG_SAMPLE_RUST_MINIMAL) += rust_minimal.o

samples/rust/Makefile +3 -1
-obj-$(CONFIG_SAMPLE_RUST_PRINT)                        += rust_print.o rust_print_events.o
+obj-$(CONFIG_SAMPLE_RUST_PRINT)                        += rust-print.o
+
+rust-print-y := rust_print.o rust_print_events.o

Steven: if you have not applied this one yet (I think you didn't), I think it would be best to rename the main source file instead of the module name, since we already have users and a couple other places we should rename.

I am sending v2 in case you can pick that one instead.

Cheers,
Miguel