]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
UBUNTU: SAUCE: scripts: rust: drop is_rust_module.sh
authorAndrea Righi <andrea.righi@canonical.com>
Mon, 13 Feb 2023 16:29:14 +0000 (17:29 +0100)
committerAndrea Righi <andrea.righi@canonical.com>
Thu, 9 Mar 2023 14:58:34 +0000 (15:58 +0100)
BugLink: https://bugs.launchpad.net/bugs/2007654
With the constraint "!DEBUG_INFO_BTF || PAHOLE_HAS_LANG_EXCLUDE" to
enable Rust we don't need is_rust_module.sh anymore, since
'pahole --lang_exclude=rust' has already the capability to exclude Rust
compilation units, so let's just drop this script.

Link: https://lore.kernel.org/bpf/20230111152050.559334-1-yakoyoku@gmail.com/
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
rust/macros/module.rs
scripts/Makefile.modfinal
scripts/is_rust_module.sh [deleted file]

index a7e363c2b04442af3e88adf85ca3da0d51861b83..608406f33a7064497c5191cf9e0c4e23eec5c1df 100644 (file)
@@ -179,7 +179,7 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
             /// Used by the printing macros, e.g. [`info!`].
             const __LOG_PREFIX: &[u8] = b\"{name}\\0\";
 
-            /// The \"Rust loadable module\" mark, for `scripts/is_rust_module.sh`.
+            /// The \"Rust loadable module\" mark.
             //
             // This may be best done another way later on, e.g. as a new modinfo
             // key or a new section. For the moment, keep it simple.
index a30d5b08eee94515aadea51422c084355ac9dd38..5bbae821baf4358743522457c5249ed98f330704 100644 (file)
@@ -41,8 +41,6 @@ quiet_cmd_btf_ko = BTF [M] $@
       cmd_btf_ko =                                                     \
        if [ ! -f vmlinux ]; then                                       \
                printf "Skipping BTF generation for %s due to unavailability of vmlinux\n" $@ 1>&2; \
-       elif [ -n "$(CONFIG_RUST)" ] && $(srctree)/scripts/is_rust_module.sh $@; then           \
-               printf "Skipping BTF generation for %s because it's a Rust module\n" $@ 1>&2; \
        else                                                            \
                LLVM_OBJCOPY="$(OBJCOPY)" $(PAHOLE) -J $(PAHOLE_FLAGS) --btf_base vmlinux $@; \
                $(RESOLVE_BTFIDS) -b vmlinux $@;                        \
diff --git a/scripts/is_rust_module.sh b/scripts/is_rust_module.sh
deleted file mode 100755 (executable)
index 464761a..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-2.0
-#
-# is_rust_module.sh module.ko
-#
-# Returns `0` if `module.ko` is a Rust module, `1` otherwise.
-
-set -e
-
-# Using the `16_` prefix ensures other symbols with the same substring
-# are not picked up (even if it would be unlikely). The last part is
-# used just in case LLVM decides to use the `.` suffix.
-#
-# 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]+ [Rr] _R[^[:space:]]+16___IS_RUST_MODULE[^[:space:]]*$'