samples: rust: fix `rust_print` build making it a combined module
Subsystems (3)
Miguel Ojeda
maintainerPATCH v2 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.
---
v2:
- Instead of renaming the module name, rename the main source file. This avoids changing other places (e.g. Kconfig) and, most importantly, minimizes the impact to developers/users (e.g. CIs out there).
v1: https://lore.kernel.org/rust-for-linux/[email protected]/
samples/rust/Makefile | 4 +++-
samples/rust/{rust_print.rs => rust_print_main.rs} | 0
2 files changed, 3 insertions(+), 1 deletion(-)
rename samples/rust/{rust_print.rs => rust_print_main.rs} (100%)samples/rust/Makefile +3 -1
@@ -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_main.o rust_print_events.o subdir-$(CONFIG_SAMPLE_RUST_HOSTPROGS) += hostprogs
samples/rust/rust_print_main.rs renamed from samples/rust/rust_print.rs +0 -0
base-commit: 91d39024e1b02914cc5e2dbc137908e29b269ce4 --
2.47.0