Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1926495pxy; Mon, 2 Aug 2021 14:07:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymeOiih63C134A/eacR4kr1t3ayyR6yIGhkBBfqWp9f8vDVVcKseCto6DDwKsW/PEKcLoK X-Received: by 2002:a05:6402:cae:: with SMTP id cn14mr21758982edb.31.1627938421359; Mon, 02 Aug 2021 14:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627938421; cv=none; d=google.com; s=arc-20160816; b=v+X++9P7lyEex+MwCCJ9S8e8NYHQ4WbuX6XOL4bEqxM8mWeETGdkjyFBn1FYgsViDu w5EHas6u76+oM/t0hjVz+MWN5SaIDCBvBnlsFrTg3lUJi3pzS+2UC7O4vhL7OEKm6GUE IMqqel53XQDhCQ+zsRp0Z4FVP2BcHXfcFIR+Np6O2AC5v9mQeadpo5gd0iMXjYogU09e zz0IQ2lG54XGzFD10g92vnqkCIs/WhT0kqFIS68aSnAXotXZ1A8osyqzYb0pTqo+27Fa OI85zfbCgRf3q8Vsi1TmHPSINwdChplNZYARxVKJZG0SE8eG2VRxfU7ZzTrRni3AqI3T gIqQ== 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=YT/X7psCIeWzZDScWjeW/C3v96Wl1P+CDtRt4wafWvk=; b=jTbzclgoXH+2Eq30Q1sdOZBsZThw+kRuQgfg/sEKnP28Fjw8TTaCMWVySgvxfNf0NX UmhrN9QFIYkv+XdsSVQ9zEbXlRzjVXtR8ymy7A/FEOU6IkWyNF5AFSbUdmZOE29YO+Hs mGlC6E0KjKWK1qMv0u/JA6Fhz7VKWJWWgv+6/jSefUyB8nXG/3js05XzTcFepSTjhgkU cFKzAXiFra5V714i73io+m71F5zdYvuN2GER4wu9OnkDHMg/sVQNUc0b/lQtaE5azXdT vc3CGgfuGLpYtfJ0AlJJl3SzccF+tZF6Re4H75y+1WZMREChcaq2PNGaeKIZ1HCrrax5 R0Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VyF3R1c8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nd19si10631773ejc.48.2021.08.02.14.06.36; Mon, 02 Aug 2021 14:07:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VyF3R1c8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231623AbhHBVFU (ORCPT + 99 others); Mon, 2 Aug 2021 17:05:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:35998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231194AbhHBVFT (ORCPT ); Mon, 2 Aug 2021 17:05:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6DCC360F11; Mon, 2 Aug 2021 21:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627938310; bh=1CC6Xn8O5VfdL27ctk5p97kfsc4n9bixRSyPS7rPUAM=; h=From:To:Cc:Subject:Date:From; b=VyF3R1c8Gmz23NgeJ0vyufxaFMjNfiQhrTo2aEMtosyT3vRvkXigYjX5Yo2fc5HTs x+2C2iv4JcZ9R1cLc6kz3t44/XFoJIFq5fihMdX9eTW4q0huu5b+JGAZvrMf7MYUpO Ufi1JghQnvQVLR2IjFgeZFGVDXC328Bp4ANQKuLYttb3X3bB0vOv+fMQSENMxoT5P3 r5oW3QsRf71XMcfM9yy4Rpjy0r1Ll9BBSFHdROLLJgWM7OHV/TNiQy62Lkds+AE+5s GlsNysvoZWDk3vb/4pei5LiHRezJKM09zO7NS7kNzw+9ts5GM2Um7fzCpOMKniFYbV 5jKlU9IN6mIxQ== From: Nathan Chancellor To: "Steven Rostedt (VMware)" , Andrew Morton , Masahiro Yamada Cc: Nick Desaulniers , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH] scripts/recordmcount.pl: Remove check_objcopy() and $can_use_local Date: Mon, 2 Aug 2021 14:03:07 -0700 Message-Id: <20210802210307.3202472-1-nathan@kernel.org> X-Mailer: git-send-email 2.32.0.264.g75ae10bc75 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When building ARCH=riscv allmodconfig with llvm-objcopy, the objcopy version warning from this script appears: WARNING: could not find objcopy version or version is less than 2.17. Local function references are disabled. The check_objcopy() function in scripts/recordmcount.pl is set up to parse GNU objcopy's version string, not llvm-objcopy's, which triggers the warning. Commit 799c43415442 ("kbuild: thin archives make default for all archs") made binutils 2.20 mandatory and commit ba64beb17493 ("kbuild: check the minimum assembler version in Kconfig") enforces this at configuration time so just remove check_objcopy() and $can_use_local instead, assuming --globalize-symbol is always available. llvm-objcopy has supported --globalize-symbol since LLVM 7.0.0 in 2018 and the minimum version for building the kernel with LLVM is 10.0.1 so there is no issue introduced: https://github.com/llvm/llvm-project/commit/ee5be798dae30d5f9414b01f76ff807edbc881aa Signed-off-by: Nathan Chancellor --- Makefile | 1 - scripts/recordmcount.pl | 40 ---------------------------------------- 2 files changed, 41 deletions(-) diff --git a/Makefile b/Makefile index 27a072cffcb9..b6ee64dd435e 100644 --- a/Makefile +++ b/Makefile @@ -546,7 +546,6 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \ PHONY += scripts_basic scripts_basic: $(Q)$(MAKE) $(build)=scripts/basic - $(Q)rm -f .tmp_quiet_recordmcount PHONY += outputmakefile ifdef building_out_of_srctree diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index c17e48020ec3..8f6b13ae46bf 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -173,39 +173,6 @@ my $mcount_regex; # Find the call site to mcount (return offset) my $mcount_adjust; # Address adjustment to mcount offset my $alignment; # The .align value to use for $mcount_section my $section_type; # Section header plus possible alignment command -my $can_use_local = 0; # If we can use local function references - -# Shut up recordmcount if user has older objcopy -my $quiet_recordmcount = ".tmp_quiet_recordmcount"; -my $print_warning = 1; -$print_warning = 0 if ( -f $quiet_recordmcount); - -## -# check_objcopy - whether objcopy supports --globalize-symbols -# -# --globalize-symbols came out in 2.17, we must test the version -# of objcopy, and if it is less than 2.17, then we can not -# record local functions. -sub check_objcopy -{ - open (IN, "$objcopy --version |") or die "error running $objcopy"; - while () { - if (/objcopy.*\s(\d+)\.(\d+)/) { - $can_use_local = 1 if ($1 > 2 || ($1 == 2 && $2 >= 17)); - last; - } - } - close (IN); - - if (!$can_use_local && $print_warning) { - print STDERR "WARNING: could not find objcopy version or version " . - "is less than 2.17.\n" . - "\tLocal function references are disabled.\n"; - open (QUIET, ">$quiet_recordmcount"); - printf QUIET "Disables the warning from recordmcount.pl\n"; - close QUIET; - } -} if ($arch =~ /(x86(_64)?)|(i386)/) { if ($bits == 64) { @@ -434,8 +401,6 @@ if ($filename =~ m,^(.*)(\.\S),) { my $mcount_s = $dirname . "/.tmp_mc_" . $prefix . ".s"; my $mcount_o = $dirname . "/.tmp_mc_" . $prefix . ".o"; -check_objcopy(); - # # Step 1: find all the local (static functions) and weak symbols. # 't' is local, 'w/W' is weak @@ -473,11 +438,6 @@ sub update_funcs # is this function static? If so, note this fact. if (defined $locals{$ref_func}) { - - # only use locals if objcopy supports globalize-symbols - if (!$can_use_local) { - return; - } $convert{$ref_func} = 1; } base-commit: c500bee1c5b2f1d59b1081ac879d73268ab0ff17 -- 2.32.0.264.g75ae10bc75