[Toybox] [PATCH] Use toolchain variables ($NM) instead of names (nm)

Avery Terrel averymt at proton.me
Sun Aug 30 21:04:02 UTC 2026


On Sunday, August 30th, 2026 at 12:39, Rob Landley via Toybox <toybox at lists.landley.net> wrote:
> On 8/29/26 00:40, Avery Terrel via Toybox wrote:
> > Empty Message
> >
> 
> ... why?
> 
> This script is a quick and dirty check that doesn't even use the cross
> compiler prefix...

This came about as a fix for cross compiling in a Nix devshell,
which sets up the toolchain via the environment variables expected
by autotools, cmake, etc.

In a Nix cross compilation environment, there's no nm in $PATH, and
it's instead exposed through $NM.  This patch would also be useful
in other environments, where only a cross compiler is available,
such as for x86_64-unknown-linux-gnu on a musl system, where the
toolchain is only available through prefixes.

scripts/make.sh already treats cross-only as valid, even when mkflags
pulls in $HOSTCC, because when the only "cross" part of the toolchain
is libc, you can safely HOSTCC="$CC".  As far as I can tell, this
only leaves bloatcheck's direct nm call. Excepting of course the
kconfig patch, which I'll just keep locally until it's replaced.


More information about the Toybox mailing list