Re: [PATCH] rust: fix regexp in scripts/is_rust_module.sh

From: Vincenzo Palazzo
Date: Sat Feb 11 2023 - 04:25:26 EST


> 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@xxxxxxxxxxxxx>

Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@xxxxxxxxx>