<> = glibc headers in a multiarch environment = == Issue == Resolving conflicts between libc0.1-dev, libc0.3-dev, libc6-dev, and libc6.1-dev binary packages from different Debian architectures installed on the same MA-enabled system. For instance, allowing binary packages libc6-dev:amd64 and libc0.3-dev:hurd-i386 to be installed together on amd64, or on hurd-i386, or even on another Debian architecture... == Solution == 1. [X] DONE * Using glibc-2.21 source package from experimental, write a patch to move all headers in libc-dev from /usr/include to /usr/include/$(DEB_HOST_MULTIARCH). * Leave /usr/include symlinks be in libc-dev- packages, as we do not need them in MA anyway. 2. [ ] WIP * Build patched glibc and install it. * Rebuild all archive: setup wanna-build, buildd, sbuild... 3. [ ] WIP * For each maybe-failed package, rebuild with unpatched glibc. * If also maybe-failed, record failure here. * If maybe-succeeded, patch package to support /usr/include/$(DEB_HOST_MULTIARCH) instead of /usr/include. * Anyhow, patch each package assuming libc-dev headers to be found in hardcoded /usr/include. 4. [ ] Merge the MA headers patch in glibc. N.B.: Beware of multilib-related issues, e.g. -m64, -m32, and -mx32 on amd64. == Known Problems == * gcc-5 (and other versions) cross compiler builds search for includes in `/usr/$(DEB_HOST_GNU_TYPE)/include`, `/usr/include` and for `asm` headers `/usr/include/$(DEB_HOST_MULTIARCH)/asm`, but they do not search `/usr/include/$(DEB_HOST_MULTIARCH)` in general. TODO: Diagnose and file bug and patch (`debian/rules2` sets up a `sys-include` folder which can be extended). * gcc "fixes" includes during build. In that process, it also replaces ``. During build, it determines whether to include the original `` by testing whether it exists in the system header dir. Unless the point above this one changes the location of the system header directory, this results in a broken replacement. As a workaround, one can set `LIMITS_H_TEST=:` in `src/gcc/Makefile.in`. * The initial patch completely breaks multilib. In a multilib setting, `/usr/include/$(DEB_HOST_MULTIARCH)` is not searched at all, so all the headers that are moved there are essentially gone when building with multilib. Some headers are already in multiarch locations and for those headers the `libc6-dev-$multilib` packages already contain symlinks. This symlink farm needs to be extended to cover all moved headers. * `pythonX.Y` [[http://sources.debian.net/src/python2.7/2.7.10-5/Lib/plat-linux2/regen/?hl=8#L8|hardcodes]] `/usr/include/netinet/in.h`. == glibc patch == * [[https://bugs.debian.org/798955|Debian Bug #798955]]: [[attachment:multiarch_headers.patch]] == People involved == * HelmutGrohne * AurelienGerome == Related ressources == * [[Multiarch/LibraryPathOverview]] * [[https://wiki.ubuntu.com/ToolChain#Multiarch_and_multilib_configurations]] * [[https://sourceware.org/glibc/wiki/Testing/Builds]] * [[https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html]]