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

Denys Nykula nykula at ukr.net
Tue Oct 1 10:58:37 PDT 2019


> The string HOSTCC does not occur in scripts/mkroot.sh?

HOSTCC appears in kconfig/Makefile, change.sh, install.sh, and make.sh called by
Makefile on make calls from mkroot.sh called from the same Makefile on a make
launched by the shell user. Effectively always equal to cc lookup in host PATH.

> Yeah, it's confusing. I pass through _some_ variables from the environment
> because they're mandatory ($PATH) and other because it's convenient
> ($CROSS_COMPILE), but...

Nah it makes perfect sense now. Config scripts are somewhat spaghetti but mkroot
gets close to a right abstraction level.

> Except I'm not downloading anything in the current version, or using the host
> toolchain for anything, and mcm doesn't have distcc or ccache...

Host usage is implicit. By not manually overriding everywhere, you get the cc
from host PATH building the config artifacts, and the host libc interpreter for
the dynamic toybox in the airlock dir. It becomes apparent at runtime, when
cc or libc aren't at default paths, on for hypothetical example a statically
linked system without a toolchain in own firmware.

> haven't added "make" to toybox yet
> (which comes after the shell), and it'll need an awk too...
> 
> I take it you're cross compiling more stuff? There isn't really plumbing fo rtha
> tin the merged version. (There was in the seperate version...)

Pkgsrc sources include a reference shell and awk capable of a bootstrapping its
bmake to build other software. Their build scripts want make and autotools on
the host, so I read their debug output on a system that has all that, and write
a few lines of shell enough to build the shell with musl headers, chroot there
to make the awk and continue. The fun is in attachment. Haven't run all the
built tools yet. Wanted to see how many familiar things one can proceed to build
without fatal errors after minimal patching. Next goal is to investigate zcat
and tar errors and fix them to remove a few lines from this script. And to wait
on your toysh, removing more.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Airlock-XFCE.patch
Type: application/x-patch
Size: 5419 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20191001/0d7dfc0c/attachment-0002.bin>


More information about the Toybox mailing list