From: Miguel Ojeda <ojeda@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Miguel Ojeda <ojeda@kernel.org>,
Alex Gaynor <alex.gaynor@gmail.com>
Cc: "Mark Rutland" <mark.rutland@arm.com>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <benno.lossin@proton.me>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
rust-for-linux@vger.kernel.org, patches@lists.linux.dev,
"Stephen Rothwell" <sfr@canb.auug.org.au>,
"Linux Next Mailing List" <linux-next@vger.kernel.org>
Subject: [PATCH v2] samples: rust: fix `rust_print` build making it a combined module
Date: Mon, 11 Nov 2024 23:08:05 +0100 [thread overview]
Message-ID: <20241111220805.708889-1-ojeda@kernel.org> (raw)
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>
---
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/20241109165520.1461400-1-ojeda@kernel.org/
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%)
diff --git a/samples/rust/Makefile b/samples/rust/Makefile
index f29280ec4820..c1a5c1655395 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_main.o rust_print_events.o
subdir-$(CONFIG_SAMPLE_RUST_HOSTPROGS) += hostprogs
diff --git a/samples/rust/rust_print.rs b/samples/rust/rust_print_main.rs
similarity index 100%
rename from samples/rust/rust_print.rs
rename to samples/rust/rust_print_main.rs
base-commit: 91d39024e1b02914cc5e2dbc137908e29b269ce4
--
2.47.0
reply other threads:[~2024-11-11 22:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241111220805.708889-1-ojeda@kernel.org \
--to=ojeda@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=patches@lists.linux.dev \
--cc=rostedt@goodmis.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=tmgross@umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.