rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rust: fix regexp in scripts/is_rust_module.sh
@ 2023-02-10 15:26 Andrea Righi
  2023-02-11  9:25 ` Vincenzo Palazzo
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Andrea Righi @ 2023-02-10 15:26 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho
  Cc: Boqun Feng, Gary Guo, bjorn3_gh, rust-for-linux, linux-kernel

nm can use "R" or "r" to show read-only data sections, but
scripts/is_rust_module.sh can only recognize "r", so with some versions
of binutils it can fail to detect if a module is a Rust module or not.

Right now we're using this script only to determine if we need to skip
BTF generation (that is disabled globally if CONFIG_RUST is enabled),
but it's still nice to fix this script to do the proper job.

Moreover, with this patch applied I can also relax the constraint of
"RUST depends on !DEBUG_INFO_BTF" and build a kernel with Rust and BTF
enabled at the same time (of course BTF generation is still skipped for
Rust modules).

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
---
 scripts/is_rust_module.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/is_rust_module.sh b/scripts/is_rust_module.sh
index 28b3831a7593..464761a7cf7f 100755
--- a/scripts/is_rust_module.sh
+++ b/scripts/is_rust_module.sh
@@ -13,4 +13,4 @@ set -e
 #
 # In the future, checking for the `.comment` section may be another
 # option, see https://github.com/rust-lang/rust/pull/97550.
-${NM} "$*" | grep -qE '^[0-9a-fA-F]+ r _R[^[:space:]]+16___IS_RUST_MODULE[^[:space:]]*$'
+${NM} "$*" | grep -qE '^[0-9a-fA-F]+ [Rr] _R[^[:space:]]+16___IS_RUST_MODULE[^[:space:]]*$'
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-04-06 22:57 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <'CANiq72=FZtNmYvbb-YPHmQ=bm8rH8VO3M9nemT4i03g9A2PD2Q@mail.gmail.com'>
2023-02-13 15:13 ` [PATCH] rust: fix regexp in scripts/is_rust_module.sh Martin Rodriguez Reboredo
2023-02-13 15:48   ` Andrea Righi
2023-02-13 16:03     ` Eric Curtin
2023-02-13 17:43       ` Andrea Righi
2023-02-10 15:26 Andrea Righi
2023-02-11  9:25 ` Vincenzo Palazzo
2023-02-13 13:19 ` Miguel Ojeda
2023-02-13 14:27   ` Eric Curtin
2023-02-13 15:01   ` Andrea Righi
2023-02-13 15:45     ` Miguel Ojeda
2023-02-13 14:56 ` Martin Rodriguez Reboredo
2023-04-06 22:56 ` 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).