[J-core] [musl] Re: musl-cross-make / litecross improvements

Rich Felker dalias at libc.org
Wed May 4 13:54:11 EDT 2016

On Wed, May 04, 2016 at 12:33:29PM -0400, Rich Felker wrote:
> On Wed, May 04, 2016 at 04:28:18AM -0500, Rob Landley wrote:
> > On 05/02/2016 11:48 PM, Rich Felker wrote:
> > > I've made a number of improvements and fixes to musl-cross-make which
> > > are in the upstream repo now, based on bug reports I got:
> > > 
> > > - Spurious dependency on flex (upstream's fault, worked around)
> > > - Spurious dependency on texinfo (ditto)
> > > - Ability to use pre-installed gmp/mpc/mpfr libs
> > > - Config examples for static linking, no-debug builds.
> > > 
> > > https://github.com/richfelker/musl-cross-make
> > >
> > > A few things I still plan to add at some point:
> > 
> > Still no native toolchains. :)
> In theory all you have to do to get a native toolchain is first build
> and install the cross toolchain so that the cross tools are in your
> path, then COMMON_CONFIG += --host=$(TARGET). I can test and see if it
> works.

Actually it's easier than that -- the whole point of litecross/mcmx is
to automate building musl (which is effectively one of the target
libs, and which the other target libs depend on) in the middle of the
gcc build process so that it can complete in one pass. For
cross-compiling a native compiler for the target system, however, your
existing cross toolchain is what's used to build target libs, and it
already has musl. Actually it already has all the target libs which
you could just reuse rather than building again, so you should be able
to skip building target libs altogether, but I don't think gcc's build
process was made to do that.

Anyway, if you do try to use litecross/mcm for the native compiler, it
breaks on building musl since litecross tries to use the newly-built
xgcc, which is a non-native binary (unless you have qemu + binfmt_misc
installed in such a way that it happens to work). I think it's
reasonably easy to work around this; I just made it work with some


More information about the J-core mailing list