Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180301212047.GY1436@brightrain.aerifal.cx>
Date: Thu, 1 Mar 2018 16:20:47 -0500
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: Generating headers for a specific target

On Thu, Mar 01, 2018 at 10:12:26PM +0100, EJ wrote:
> Hi Rich,
> 
> > On 1 Mar 2018, at 21:59, Rich Felker <dalias@...c.org> wrote:
> > 
> > On Thu, Mar 01, 2018 at 09:49:42PM +0100, EJ wrote:
> >> Hello,
> >> 
> >> Is there a way to generate the headers for a specific target without
> >> having access to the target or a cross-compiler for the target?
> >> 
> >> I’m not interested in compiling must, just in a complete set of header files.
> > 
> > Yes, with a few caveats. Keep in mind that for archs with subarchs,
> > there will be preprocessor conditionals in the bits headers which
> > depend on predefined macros from the compiler, so you can't
> > use/process the headers without knowing the values of those macros.
> 
> Understood. I’m still planning to run the headers through a properly
> configured compiler fornt-end, so that shouldn’t be a problem.
> 
> > With that said, something like this should work from a clean tree:
> > 
> > 	make includedir=/where/you/want/them ARCH=whatever install-headers
> > 
> > or out-of-tree in a clean dir:
> > 
> > 	make -f /path/to/musl/Makefile srcdir=/path/to/musl \
> > 	includedir=/where/you/want/them ARCH=whatever install-headers
> > 
> > filling in ARCH=whatever with the musl name for the target arch (not
> > including the subarch part).
> 
> The above works like a charm.
> 
> > The above make invocations are not entirely documented/public
> > interfaces, but are probably 90% so and unlikely to change/break in
> > practice. It might be a good idea to check that they still work with
> > new versions when upgrading musl though.
> 
> Understandable.
> 
> Thanks for your quick and informative response!

No problem. Also note that, if you are building compilers, you can
pause in the middle to build & install the musl headers; the
musl-cross-make repo has an example of how to do this with gcc, which
is roughly:

1. GCC: make all-gcc
2. musl: configure (using xgcc) and make install-headers
3. GCC: make all-target-libgcc with disable_shared forced
4. musl: make, make install to build sysroot
5. GCC: make all

Rich

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.