[Toybox] [mkroot] Issue with mcm-buildall.sh

Riccardo Paolo Bestetti pbl at bestov.io
Sun Mar 28 08:06:46 PST 2021


On Sat Mar 27, 2021 at 10:43 AM CET, Rob Landley wrote:
> The standalone mkroot is obsolete now, I merged it into toybox (under
> the
> "scripts" directory) a while back:
>
> https://github.com/landley/toybox/blob/master/scripts/mcm-buildall.sh
>
> https://github.com/landley/toybox/blob/master/scripts/mkroot.sh
>
> There's even something almost documentation-like at:
>
> https://landley.net/toybox/faq.html#cross
Thanks. I shall use the version from toybox from now on.

>
> > This:
> > 
> > 1) afaics successfully builds the i686 bootstrap compiler in
> >    $MCM/host-i686-linux-musl
>
> Not unless you ask it to? (Or it's left over from a previous run.) Let's
> see...
>
> https://github.com/landley/toybox/blob/master/scripts/mcm-buildall.sh#L235
>
> Looks like the two tuple indicators these days would be:
>
> scripts/mcm-buildall.sh i686:: x86_64::--with-mtune=nocona
>

As far as I can see, the bootstrap toolchain is always built:

https://github.com/landley/toybox/blob/master/scripts/mcm-buildall.sh#L224

> > 2) fails to build x86_64-linux-musl-cross (see below)
>
> Presumably because its ./configure falls back to using your host gcc,
> because it
> can't find the i686:: cross compiler that didn't get built.

As it turns out, that's correct, even though the i686 cross compiler
/did/ get built. However, for some reason I'm not corageous enough to
investigate, it got placed into $MCM/ instead of $MCM/output.

Manually copying it to the output directory (and renaming it) was
sufficient to get step 2, and step 3 after that, to succeed.

> And the actual error is in the file "config.log", not in the console
> output,
> because gcc was written by the FSF and was thus actively user-hostile.
> (Only
> special people who proved their worthiness could be allowed inside
> Richard
> Stallman's Cathedral of white beardy men. This is why LLVM happened.)

Ugh.

>
> However what we _do_ know is that the i686 cross compiler is borked, and
> possibly what it's complaining about is your host toolchain can't create
> static
> binaries (because libc.a isn't installed by your distro, because it
> listened to
> glibc maintainer Ulrich Drepper being loudly wrong several years back.)
> Building
> the i686 compiler first should fix it, the rest try to use that as their
> host
> compiler because:
>
> https://github.com/landley/toybox/blob/master/scripts/mcm-buildall.sh#L18
>
> says to.

My distribution ships libc.a, apparently. So it must have been something
different.

>
> > Riccardo
>
> Rob.

Nice to meet you! I appreciate your help. I'm attempting kernel
development for the first time & I'm currently trying to get a hang of
the avaiable tooling.

I also appreciate the references to the socio-historical
(socio-hysterical? :) context of software development. I found some of
your conferences interesting for this reason, as well as the technical
content.

Riccardo



More information about the Toybox mailing list