Report 1 — Multiarc h cross-toolchains

Thibaut Girka <[email protected]>
Newsgroups gmane.linux.debian.devel.embedded
Message-ID <20120602211643.GA29659@debian-thib>
[Sending a copy to the emdebian list, which will be CC'd in upcoming reports]

Hi,

Here is my first report on the “Multiarch cross-toolchains” project[0],
mentored by Héctor Orón and co-mentored by Marcin Juszkiewicz.


What I've been doing so far
---------------------------


During April and the first week of May, I've been getting familiar with
Multiarch, and the toolchain packaging.

I've also written patches for apt and dpkg, in order to handle the MultiarchCross[1] specification
and specific cross-arch deps (not specified anywhere, but basically extending the “:qualifer” notation
to allow arbitrary arch names instead of just “any” and, in the case of Build-Deps, “native”).

Then, I've been busy with uni for the two following weeks. I've been able to resume work this monday.

I've first rebuilt dpkg and apt with my changes, and I'm now using them on both my systems.
Then, I've looked into libc6-dev, to see why it wasn't Multi-Arch: same.
It turns out there are different versions of two files (/usr/include/ieee754.h and /usr/include/a.out.h)
across the different architectures supported by Debian.
I wrote a patch to move them to arch-qualified paths and mark libc6-dev Multi-Arch: same.
I think such a patch should be sufficient to make libc6-dev co-installable in Wheezy.

I've then attempted to rebuild libc6 with this patch. While it built just fine on my armhf system,
it failed a test on my i386 system. I hit #673596.
This kept me busy the whole of Tuesday and Wednesday.
I've finally managed to work around this bug by building the libc on 486 kernel, without SMP support.
I'm now using those packages on both my systems.

Since Thursday, I've been trying to build a cross-compiler package (i386 -> armhf cross-compiler),
which does not involve dpkg-cross at all, and I think I've finally managed to get this working
(I have not been able to test yet, as gcc-4.7=4.7.0-11 isn't in armhf yet, although it is in i386,
and since the two versions are different, they aren't co-installable)
It is a bit hackish at times, but it is a good way to see what changes are needed.

Those changes include:
  * removing the dependency on dpkg-cross (#675511)
  * moving some new manpages to correct places (#675516)
  * completely removing $(cross_lib_arch) and $(LS) usage (that is, -$arch-cross suffixes)
    and use :$TARGET where appropriate
  * making the build process look for headers in the right places.
    I used with_sysroot=/ and removed with-headers and with-libs to do that.
  * creating “Architecture: $TARGET” packages for runtime libraries
    this involves setting DEB_HOST_ARCH=$TARGET when calling debhelper

What this package builds is the cross-compilers themselves (cpp-4.7-<triplet>, gcc-4.7-<triplet>, gccgo-4.7-<triplet>, etc.),
and cross-built runtime libraries (libgcc1:$TARGET, libgomp1:$TARGET, etc.).

When building a cross-toolchain for an exisiting arch, those runtime libraries are already present in the repos,
so, the cross-built packages are unneeded and should be discarded.

Patches are available[2] and you can try them out using the repo we've set up[3], providing source packages,
i386 and armhf packages split into two components: “main” which currently contains apt, dpkg and eglibc,
and “cross-deps” which contains the toolchain, as patched apt and dpkg are needed to install it.



What should be done next
------------------------

Having multiarch cross-toolchains available in wheezy, would be nice, even if the cross-toolchain themselves
are hosted on a third-party archive.

To make it possible, my changes to dpkg, apt and eglibc need to land in wheezy.
Thus, I'll try to get my patches accepted as soon as possible!

I'll also try my cross-compiler package as soon as gcc-4.7:armhf=4.7.0-11 gets into the archive.

I'll then clean up my patches, simplify the packaging, try different cross-compilers...


[0]: http://wiki.debian.org/SummerOfCode2012/Projects#Multiarch_Cross-Toolchains
[1]: https://wiki.ubuntu.com/MultiarchCross
[2]: http://emdebian.org/~thibg/patches/
[3]: http://emdebian.org/~thibg/repo/
signature.asc (application/pgp-signature, 836 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBCAAGBQJPyoK6AAoJEOY0VNOn/l3WrDwQALbXGayHZy3wN53LNbf3rLao
bsgflN5qp0F17X0nnjpo4RfV2Ws7IrV03dSTLDMxXnjWpWFOvYJBLTNiOVkkkCsr
I2paSaR1rHHYzTT30aLcmVuzDoTqfe8giy0kjgCh3mCKqySS4h1aZNlix/bnwRaX
4jK49b3OjOIQwG2L4TOj/6I3FkATMfq99CgRBwZcS8vNGmOQw86nZfHRucmF0Kit
iRkYTPI5BSQhaG+JaTOu6KI2azc5sPYaYSveagc0Fpf2qz818O2TmR5dqcXPJeZe
flCK5IQLAvjwsM/gDFGxEVlhhkZl3/Em8XU3Fjh7rVNQxbvD27Oksy9pf1XITn1F
GW2at41/SrGc600a5Uz1NoPDzHg+F1qS1LRcUspsZi8IVP4/6Ko3mvcphJJchhBX
Innqo653q48pgiG/xFx7vFE1b4BAhfP7+E6HdV5+C+ahYgqvBmJQ9jtPxrB5BYnv
tcXR0LBY76/Tir2C6cG2LFGLtkRYZ/vgZCYNAwobPmXsO3UHM2o7J5ENcjc0dA8i
/lHH5J493OxYV+Z6Jb1lLQ69y4tA3cc93qVp6juxwOzHLrc9dz9P0fj/oHaUpf5W
sLSx2f0p/CwmdmTinIZx1Wv2tcH23fX2kuJmhUCIwujJaTNtv2noUQJV8jeBGaZq
az/1/bTfo5kYQpIcj4kT
=I7BF
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.