lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251219214252.GD1407372@ax162>
Date: Fri, 19 Dec 2025 14:42:52 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Carlos Llamas <cmllamas@...gle.com>,
	Josh Poimboeuf <jpoimboe@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Nicolas Schier <nsc@...nel.org>
Cc: Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
	Bill Wendling <morbo@...gle.com>,
	Justin Stitt <justinstitt@...gle.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	kernel-team@...roid.com, linux-kernel@...r.kernel.org,
	"open list:CLANG/LLVM BUILD SUPPORT:Keyword:b(?i:clang|llvm)b" <llvm@...ts.linux.dev>,
	linux-kbuild@...r.kernel.org
Subject: Re: [PATCH] kbuild: prefer ${NM} in check-function-names.sh

On Thu, Dec 18, 2025 at 05:58:06PM +0000, Carlos Llamas wrote:
> The check-function-names.sh scripts invokes 'nm' directly and this can
> be problematic during cross-compilation when the toolchain is different
> from the system's default (e.g. LLVM=1).
> 
>   scripts/check-function-names.sh: nm: not found
> 
> Let's prefer the ${NM} variable which is already set by kbuild. However,
> still fallback to plain 'nm' to ensure the script is still usable when
> called directly.
> 
> Fixes: 93863f3f859a ("kbuild: Check for functions with ambiguous -ffunction-sections section names")

I may have caught this during review if linux-kbuild or its maintainers
were CC'd on that change.

> Signed-off-by: Carlos Llamas <cmllamas@...gle.com>

Reviewed-by: Nathan Chancellor <nathan@...nel.org>

If Josh or Peter want to take this through a fixes branch in -tip, that
is fine with me. Otherwise, Nicolas can apply this to kbuild-fixes since
this change was merged in 6.19-rc1.

> ---
>  scripts/check-function-names.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/check-function-names.sh b/scripts/check-function-names.sh
> index 410042591cfc..08071133e5a5 100755
> --- a/scripts/check-function-names.sh
> +++ b/scripts/check-function-names.sh
> @@ -13,7 +13,7 @@ if [ ! -f "$objfile" ]; then
>  	exit 1
>  fi
>  
> -bad_symbols=$(nm "$objfile" | awk '$2 ~ /^[TtWw]$/ {print $3}' | grep -E '^(startup|exit|split|unlikely|hot|unknown)(\.|$)')
> +bad_symbols=$(${NM:-nm} "$objfile" | awk '$2 ~ /^[TtWw]$/ {print $3}' | grep -E '^(startup|exit|split|unlikely|hot|unknown)(\.|$)')
>  
>  if [ -n "$bad_symbols" ]; then
>  	echo "$bad_symbols" | while read -r sym; do
> -- 
> 2.52.0.351.gbe84eed79e-goog
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ