Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGw6cBusuyEQeyK_Evhd4aXDwygye6ckEyog34CdqfXEc-fGUA@mail.gmail.com>
Date: Sun, 10 May 2020 13:35:23 -0700
From: Michael Forney <mforney@...rney.org>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com
Subject: Re: Re: [musl-cross-make] [PATCH v2] litecross: Fix system
 header dir when building native toolchains

Thanks for your response, Rich.

On 2020-05-10, Rich Felker <dalias@...c.org> wrote:
> Sorry I haven't had the time/attention to devote to this. I think
> there's still a major mismatch in expectations -- the system you
> install this native compiler onto is not going to have its include
> files in /include but the standard /usr/include, among a lot of other
> things.

My understanding was that musl-cross-make toolchains (native or cross)
were meant to be self-contained units, so the include directory
relative to the sysroot is always /include.

Merging a native toolchain into / can't work, even using the default
/usr/include search directory, because you'd still have musl headers
installed into /include, so the compiler would be unable to find the
musl headers (this is the same reason why you currently need the usr
-> . symlink). To support something like this, I think you'd need to
make the prefix configurable.

> Cross-compiling a native compiler is in many ways a really
> poor match for what musl-cross-make is intended to do. The "stop to
> build musl in the middle" logic doesn't really even make much sense
> when the target libs are being compiled by an existing cross compiler
> toolchain that already has its own musl headers and libc.so.
>
> I think you're right that we're doing something very wrong here, but I
> don't understand exactly what it is, and before making changes I want
> to get to the poing where we're on the same page about what it
> *should* be doing. Maybe we mostly are, but I don't understand enough
> yet to know whether we are.
>
> I know there's also an issue someone (perhaps yourself; I don't
> remember at the moment) brought to my attention that there's a mixup
> in the logic in litecross/Makefile for "is a cross compile" vs "is
> being cross compiled" that messes up completely in the canadian cross
> case. This further suggests to me that there's a big mess that needs
> to be unraveled..

I'm sure there are other improvements that can be made, but I don't
see why those should block this change. It's pretty clear to me that
$SYSROOT/usr/include is the wrong directory to search for these
headers, since they are not installed in this location. This is backed
up by fact that litecross creates a usr -> . symlink in the sysroot,
and that you need to create this symlink manually for a native
toolchain.

Even forgetting native compilers entirely, this patch still removes a
hack for cross-compilers which only works coincidentally.

> I'll try to get back to this sometime soon, but at the moment my focus
> is already split several ways between mallocng, initial entropy source
> and csprng issues for musl (was considered a prereq for merging
> mallocng but I think it's turning out to be mostly separate which may
> mean I can punt on this for a while), bringing this all together for
> next musl release, and paid work independent from musl.

No worries, there is no rush. But keep in mind that I sent this patch
1.5 years ago (and mentioned it a couple times on IRC).

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.