Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sat, 8 Jul 2017 22:00:15 -0400
From: Rich Felker <>
Subject: Re: [cross compilation][bootstraping] installing target libc
 headers without a cross toolchain

On Sat, Jul 08, 2017 at 11:58:39PM +0000, wrote:
> Hi,
> What is the proper way to install target musl libc headers without the cross-toolchain?
> For the target sysroot I did install the linux headers in /sysroot/include
> (~make ARCH=x86_64 install-headers), which I know are useless for the musl libc
> configuration and build. Then I would like to install the bear target libc
> headers in /sysroot/include.
> That _should_ allow me to compile a static libgcc and static libstdc++ from gcc
> without musl libc being built.
> ----
> I started to peak into the musl makefile, it seems install-headers makefile
> target is just a raw copy of generic include files + arch specific include
> files. No tricks? No generators or such trickeries?

You'll notice that ALL_INCLUDES containes some generated headers
(GENH), but these are generated purely by standard text processing
tools, and do not depend on a cross toolchain. So yes, you can just
run make ARCH=[whatever] install-headers.

I think your approach will work for static target libs only, but if
you want to do dynamic too, look at the approach in musl-cross-make:

There, litecross/Makefile is responsible for building musl after
binutils, gcc itself, and libgcc.a are built, but before any further
target libs are. The combined binutils+gcc may be something of a
distraction if you're trying to read it (and it's problematic, I'm
trying to remove it) but it's orthogonal to this approach of building
musl mid-gcc-build.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.