* [PATCH RESEND] samples: rust: fix `rust_print` build making it a combined module
@ 2024-11-09 16:55 Miguel Ojeda
2024-11-10 10:56 ` Alice Ryhl
2024-11-11 19:59 ` Miguel Ojeda
0 siblings, 2 replies; 3+ messages in thread
From: Miguel Ojeda @ 2024-11-09 16:55 UTC (permalink / raw)
To: Steven Rostedt, Masami Hiramatsu, Miguel Ojeda, Alex Gaynor
Cc: Mark Rutland, linux-kernel, linux-trace-kernel, Boqun Feng,
Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Alice Ryhl, Trevor Gross, rust-for-linux, patches,
Stephen Rothwell, Linux Next Mailing List
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.
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>
---
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(-)
diff --git a/samples/rust/Makefile b/samples/rust/Makefile
index f29280ec4820..17017115657d 100644
--- a/samples/rust/Makefile
+++ b/samples/rust/Makefile
@@ -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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH RESEND] samples: rust: fix `rust_print` build making it a combined module
2024-11-09 16:55 [PATCH RESEND] samples: rust: fix `rust_print` build making it a combined module Miguel Ojeda
@ 2024-11-10 10:56 ` Alice Ryhl
2024-11-11 19:59 ` Miguel Ojeda
1 sibling, 0 replies; 3+ messages in thread
From: Alice Ryhl @ 2024-11-10 10:56 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Steven Rostedt, Masami Hiramatsu, Alex Gaynor, Mark Rutland,
linux-kernel, linux-trace-kernel, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, rust-for-linux, patches, Stephen Rothwell,
Linux Next Mailing List
On Sat, Nov 9, 2024 at 5:55 PM Miguel Ojeda <ojeda@kernel.org> wrote:
>
> 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.
>
> 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>
Thanks for fixing this, Miguel!
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH RESEND] samples: rust: fix `rust_print` build making it a combined module
2024-11-09 16:55 [PATCH RESEND] samples: rust: fix `rust_print` build making it a combined module Miguel Ojeda
2024-11-10 10:56 ` Alice Ryhl
@ 2024-11-11 19:59 ` Miguel Ojeda
1 sibling, 0 replies; 3+ messages in thread
From: Miguel Ojeda @ 2024-11-11 19:59 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Steven Rostedt, Masami Hiramatsu, Alex Gaynor, Mark Rutland,
linux-kernel, linux-trace-kernel, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, rust-for-linux, patches, Stephen Rothwell,
Linux Next Mailing List
On Sat, Nov 9, 2024 at 5:55 PM Miguel Ojeda <ojeda@kernel.org> wrote:
>
> 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
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-11 20:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-09 16:55 [PATCH RESEND] samples: rust: fix `rust_print` build making it a combined module Miguel Ojeda
2024-11-10 10:56 ` Alice Ryhl
2024-11-11 19:59 ` Miguel Ojeda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).