[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Report 1 — Multiarch cross-toolchains

[Sending a copy to the emdebian list, which will be CC'd in upcoming reports]


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/

Attachment: signature.asc
Description: Digital signature

Reply to: