[Toybox] [PATCH] Pass cflags and hostcc in mkroot.

Denys Nykula nykula at ukr.net
Thu Sep 26 13:53:35 PDT 2019


Nevermind, the very next line in the mkroot script explains how I needn't
have patched it, I just needed to pass variables this way:

make CROSS_COMPILE=$cc HOSTCC="${cc}cc -static" PATH="`dirname $cc`:$PATH" \
  defconfig
...
make CROSS_COMPILE=$cc PATH="`dirname $cc`:$PATH" root \
  CFLAGS="$CFLAGS -static" HOSTCC="${cc}cc -static"

While initially my script didn't work because it called like this:

make CROSS_COMPILE=$cc HOSTCC="${cc}cc -static" PATH="`dirname $cc`:$PATH" \
  defconfig
...
make CFLAGS="$CFLAGS -static" CROSS_COMPILE=$cc HOSTCC="${cc}cc -static" \
  PATH="`dirname $cc`:$PATH" root

For this thread to be less of a waste, I'll try to better explain the use
case. A hosting provider has an old system image that broke own toolchain
when I tried upgrading it. So I download toybox and a musl toolchain, and
use the remaining host bash, coreutils and gmake to build from them a
complete new musl image and replace the host's glibc system with it.



More information about the Toybox mailing list