]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
samples: rust: fix `rust_print` build making it a combined module
authorMiguel Ojeda <ojeda@kernel.org>
Mon, 11 Nov 2024 22:08:05 +0000 (23:08 +0100)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 12 Nov 2024 14:21:48 +0000 (09:21 -0500)
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.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alex Gaynor <alex.gaynor@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Gary Guo <gary@garyguo.net>
Cc: Björn Roy Baron <bjorn3_gh@protonmail.com>
Cc: Benno Lossin <benno.lossin@proton.me>
Cc: Andreas Hindborg <a.hindborg@kernel.org>
Cc: Alice Ryhl <aliceryhl@google.com>
Cc: Trevor Gross <tmgross@umich.edu>
Cc: "Linux Next Mailing List" <linux-next@vger.kernel.org>
Link: https://lore.kernel.org/20241111220805.708889-1-ojeda@kernel.org
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/all/20241108152149.28459a72@canb.auug.org.au/
Fixes: 91d39024e1b0 ("rust: samples: add tracepoint to Rust sample")
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
samples/rust/Makefile
samples/rust/rust_print_main.rs [moved from samples/rust/rust_print.rs with 100% similarity]

index f29280ec482083aad1b52227305d58d2a6accda2..c1a5c16553955b1cfc59d77e85e1d60b06242967 100644 (file)
@@ -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