On Mon, Mar 04, 2024 at 01:49:24PM +0100, Helmut Grohne wrote:
> The packaged gcc cross toolchain uses a sysroot during its own build
> still. As it is implemented now, it searches /usr/<triplet>/include, but
> not /usr/include/<multiarch>. So quite fundamentally, the Provides that
> we two agreed do break the build of cross toolchains right now.

Okay, so this problem is about the build of the toolchain, _not_ for
everything that comes after.

> Arguably, a cross toolchain build should probably search
> /usr/include/<multiarch>. I went back and forth a bit with Matthias
> about whether we could add this and did not fully understand his
> reasons, but there is one technical reason we want to avoid it for now.
> We can have both libc6-dev:TARGET and libc6-dev-TARGET-cross installed
> and these packages can have differing versions. When that happens and we
> search both /usr/<triplet>/include and /usr/include/<multiarch>, we'd
> mix two glibc versions with usually bad results (been there).

But this is a search path.  If a file exists in one, the second one is
not found.  So nothing can happen even from version skew.

> The other aspect here is that it is not sufficient to add
> /usr/include/<multiarch> to the search path as you also need
> /usr/include to get a complete linux kernel headers experience. We
> definitely do not want to add /usr/include, because that is known to
> misguide configure tests performed for the target architecture.

We are talking about the toolchain itself.  What configure tests could
that be?  Or is that premature optimization of the gcc build?

> So at least for now, I am convinced that we will need
> /usr/<triplet>/include to be provided by the package providing
> linux-libc-dev-arch-cross.

You just said that the search path used during the build of the
toolchain and the one for everything else are unrelated.  So you are
free to create $BUILD/tmp-include with symlinks for asm, asm-generic,
linux.

The toolchain as installed already finds all headers.  So I still don't
see why we need this in the final system.

> That still leaves the question of which package would have to build that
> new linux-libc-dev-cross. The two obvious answers are linux and
> cross-toolchain-base. Do you have a preference here?

No, the gcc build itself, because it is the only part that needs it from
what you said here.

> I hope this all makes more sense now.

At least to show where it breaks.

Bastian

-- 
Each kiss is as the first.
                -- Miramanee, Kirk's wife, "The Paradise Syndrome",
                   stardate 4842.6

Reply via email to