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

Rob Landley rob at landley.net
Mon Oct 14 14:09:34 PDT 2019


On 10/1/19 12:58 PM, Denys Nykula wrote:
>> 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.

Ah.

>> 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.

Passing through HOSTCC makes sense, but passing through CFLAGS... is it
HOSTCFLAGS or CROSS_CFLAGS?

>> 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.

Yeah, you've got a point.

I've hit more than one build with things like HOSTCC="gcc --static" because it
was the only way to specify what I ^#&@^!* MEANT.

>> 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.

Of course it does. Why wouldn't it?

> Their build scripts want make and autotools on
> the host,

So they include awk but expect autotools as an environment dependency.

> 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.

I've got a tar error queued up that's been holding up the release. I should just
cut a release and fix it next version, it's getting silly...

Rob



More information about the Toybox mailing list