Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp505533rwl; Fri, 7 Apr 2023 00:24:57 -0700 (PDT) X-Google-Smtp-Source: AKy350Y7YlhM2Qq4mNgF55OJrYXYZ+vopOK8JLQ+Q1gkpCnLW+4mNkaXT0jQncnA4heDuWsm79If X-Received: by 2002:aa7:d0d8:0:b0:501:d6d4:ef33 with SMTP id u24-20020aa7d0d8000000b00501d6d4ef33mr1519010edo.40.1680852296994; Fri, 07 Apr 2023 00:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680852296; cv=none; d=google.com; s=arc-20160816; b=m6hok6tgoQoWXL2kGqmLJC8O9xxs+lCh/Wx2X/1ttcxg3YPYJdZsV1/+rIhaNKESti jul9gXOq1HPjKLj2o7yWfWs7GEHnPCuA4m/y67BtkwxWl8QivCDLe0djWq63ZlLyt779 YjAKnPeNOK5Eo/yRhX8vAlotx4pygEkO3LRES9nd4E0erpPjbpngdrh73eG63uv3J47g 7yPRACibWnXuqAoB/Qd0nWplicsRwjOKtpdlrh5k6iksSiPT0keFFKJWMimhRAquSy4J jYm3DWDgQXiqgPVzXmtjTSCQdthQOio9iU6OKnBQoN+PxZlESW1Ezei9p6uoVeeDvhC/ HG/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=7wCvsU3M9Fv6Z9EHNIgdooWMu4RgxKEfVO+unBDF31s=; b=a97m63fjOp8If/gnGM6M2oJ+RGW7AalXCUbja3WYu1AdTLZlgtjup7X8ri8dEe8DJx idRKZZaBU3NZxDIbOZx3KXdPmResp0ygPhYxKnmHgE/cxBxSaAP5WMyNq8I0zdDpUNRc /ctfQl3GoMCt98yDeM/lfKR5bT9u6krey2Ui9qAhF4Vj3oWOjrvt9kO6m/5abNGEprDu R+UNMm4wQ0VsvM4eqqbGLTFQfkPdBfhF8qS1mY+QygIyZ4ZoNmcDLzyb1rlPuGWBu2yy Ieu1hctVGz9E13B8jxRj+oRzLcgZVbMt7u53ry6m6uxcP6XU5bYV52V2K77P15q1DuQi NzRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=lC8xunuf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r13-20020aa7d14d000000b004acc81d5053si2962086edo.616.2023.04.07.00.24.31; Fri, 07 Apr 2023 00:24:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=lC8xunuf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239063AbjDGHFf (ORCPT + 99 others); Fri, 7 Apr 2023 03:05:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239013AbjDGHFd (ORCPT ); Fri, 7 Apr 2023 03:05:33 -0400 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A3AF30F8 for ; Fri, 7 Apr 2023 00:05:32 -0700 (PDT) Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 86A093F244 for ; Fri, 7 Apr 2023 07:05:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1680851128; bh=7wCvsU3M9Fv6Z9EHNIgdooWMu4RgxKEfVO+unBDF31s=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=lC8xunuf5nDpUcF9gqRgREubdX6gixKI6Kii09wfQZ87Rjl51HCfHFepKhDN8ppPr i9Mj7ucYG3vKwa4geU5nnBexoiUCiQvsQe3dCtDrQYzCHM0uxPjHYo848wXFYPUwra TRd7LgyFWlEDdTOCIqlFbEsMtBxZ9VcKLml0XXPEMEH1dHX/uBBN+3FL1nfNuemb0k gcN0afSbhpsFmKPo3mpAc0lzuq5rTuOM4MiAF+3JyA445jdXU0+Do9OwixTr1o7vne Mh4VAmT43VGCRHhIivMkaYncmyy9mfJGKLHNmdQmS1PfUqF5oJ5XUefb0zlSl/OWY0 wLKLQ5oe4UoUg== Received: by mail-ed1-f72.google.com with SMTP id i17-20020a50d751000000b005045c08ca6dso2083482edj.7 for ; Fri, 07 Apr 2023 00:05:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680851126; x=1683443126; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7wCvsU3M9Fv6Z9EHNIgdooWMu4RgxKEfVO+unBDF31s=; b=k2sCPfb3F7HsUyjaM4Ajwl4xYroOFn6T+IAvPZf8vlsDRXSDmL8TqsSnwGgAGf9CC0 bcCZVJAoI4CFdHrS/EvSMlf+yURM5uKeI31TfYXRw5xWSRE+oZr70aCq7JdNBK8+E5tJ atGUdFSpu7+gCUd5ldLYyf7i1LoUcbApLf8LpBYbkrOQTJDNXRHAY/HpfLlDxJnPRUkv fgpeHwhAhRk/9JFrswmflPO8oD9AU4SRbN5bOHRf+HJjr7C027oBB8gH8b70NFv/RWhH 53ezKOPoiiDS8lv3X77Zgr/VqBAsSiNaekxxPjALyEO0v41Rnnd9oaKoRziGfdXh9ZQl Vn5Q== X-Gm-Message-State: AAQBX9f4MXHlDIunTRgFFe+J6PwPi918Ykx7B/oJ+CDk+PmEgXFkuXNj 5F755b62Zuc+oZsyBxNZXiWgmu4HMz/Y02VikRozDAvDzkgdO6hkGYlxLrUuzYf25Pr+aH0l92y dxHpJOiasLqSpN6uE0ozUbBxG5qfLJ6OZCWX96pClMQ== X-Received: by 2002:a17:906:66c1:b0:878:711d:9310 with SMTP id k1-20020a17090666c100b00878711d9310mr1273981ejp.1.1680851126443; Fri, 07 Apr 2023 00:05:26 -0700 (PDT) X-Received: by 2002:a17:906:66c1:b0:878:711d:9310 with SMTP id k1-20020a17090666c100b00878711d9310mr1273943ejp.1.1680851126066; Fri, 07 Apr 2023 00:05:26 -0700 (PDT) Received: from localhost.localdomain (host-79-33-132-140.retail.telecomitalia.it. [79.33.132.140]) by smtp.gmail.com with ESMTPSA id s7-20020a170906a18700b00929fc8d264dsm1766736ejy.17.2023.04.07.00.05.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 00:05:25 -0700 (PDT) From: Andrea Righi To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , Tom Rix , Eric Curtin , Martin Rodriguez Reboredo , Daniel Borkmann , Neal Gompa , Arnaldo Carvalho de Melo , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] scripts: rust: drop is_rust_module.sh Date: Fri, 7 Apr 2023 09:05:17 +0200 Message-Id: <20230407070517.204676-1-andrea.righi@canonical.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit c1177979af9c ("btf, scripts: Exclude Rust CUs with pahole") introduced the constraint "!DEBUG_INFO_BTF || PAHOLE_HAS_LANG_EXCLUDE" to enable RUST. With this constraint we don't need is_rust_module.sh anymore, because 'pahole --lang_exclude=rust' already has the capability to exclude Rust CUs. If pahole isn't recent enough (< 1.24) to support --lang_exclude, then DEBUG_INFO_BTF can't be enabled with RUST and is_rust_module.sh isn't used as well. In any case is_rust_module.sh is obsolete and we can just drop it. Link: https://lore.kernel.org/lkml/Y+p2xKIN6TJnQinK@righiandr-XPS-13-7390/ Signed-off-by: Andrea Righi --- rust/macros/module.rs | 2 +- scripts/Makefile.modfinal | 2 -- scripts/is_rust_module.sh | 16 ---------------- 3 files changed, 1 insertion(+), 19 deletions(-) delete mode 100755 scripts/is_rust_module.sh diff --git a/rust/macros/module.rs b/rust/macros/module.rs index a7e363c2b044..608406f33a70 100644 --- a/rust/macros/module.rs +++ b/rust/macros/module.rs @@ -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. diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal index 4703f652c009..e6f8fa3c9b8d 100644 --- a/scripts/Makefile.modfinal +++ b/scripts/Makefile.modfinal @@ -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 index 28b3831a7593..000000000000 --- a/scripts/is_rust_module.sh +++ /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]+ r _R[^[:space:]]+16___IS_RUST_MODULE[^[:space:]]*$' -- 2.39.2