On Tue, Oct 28, 2014 at 12:35:50AM +0100, Matthias Klose wrote:
> cross builds supporting multiarch exists and works. claiming otherwise is just
> populistic and/or marketing.

This claim and its counterclaim has been made repeatedly throughout the
discussion. It is long overdue to fill it with facts, so I am doing that
now:

I tried to build a cross compiler targeting x32 with the supported
method and ran into a number of issues. I am documenting them here to
give an idea to what extend the default method does work on Debian
today.

The first issue one runs into is that the stage1 compiler is not
installable. gcc-4.9-multilib-$targettriplet depend on
libc6-dev-$multilib-$targetarch-cross, but we need to use the stage1
compiler to build the latter package. This bug is known as #771243 and
has since been fixed in sid.

The next issue is that the stage2 libc cannot be installed. It is
converted using dpkg-cross. During conversion the path of the loader is
not updated, so libc6:$HOST and libc6-$HOST-cross:all have an undeclared
file conflict. While this can be worked around by simply not installing
libc6:$HOST no building of actual packages would be possible without
installing a libc. This bug is known as #771497 and has a patch.

After being able to install stage2 libc, the stage3 gcc build fails
since dpkg-cross forgot to fix up the ldscripts for multilib libc
packages. This issue is known as #772045 and has a patch. Alternatively,
it can be worked around by patching DEB_CROSS_NO_BIARCH (one of the
subjects of this ctte bug) back into gcc and building a non-multilib
gcc.

After covering all of the above, the glibc/gcc dance can be completed,
but the resulting compiler is not installable. It depends on libc6-amd64
(:amd64), which is unsatisfiable because there only is a
libc6-amd64:x32. It seems that this dependency is inserted by
dpkg-shlibdeps reading it from the (unconverted) symbols file of the
converted package libc6-amd64-x32-cross. Unfortunately, Guillem Jover
expressed no interest to add further multilib specific code to
dpkg-shlibdeps. Then it can be worked around by using
DEB_CROSS_NO_BIARCH again.

So a non-multilib cross compiler actually is installable, but it does
not look into /usr/include/<triplet> for includes, so you cannot build
any packages with it. Note that this failure may be due to bugs in
DEB_CROSS_NO_BIARCH and may go away when fixing the spurious libc6-amd64
dependency properly.

Given these findings, it feels rather far fetched to describe the method
as working.

Helmut


-- 
To UNSUBSCRIBE, email to debian-ctte-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20141204171402.ga...@alf.mars

Reply via email to