Bug#798064: glibc: please find kfreebsd-kernel-headers in multiarch path
Hi Steven,
On Sat, Sep 05, 2015 at 01:50:02AM +0100, Steven Chamberlain wrote:
> We're hoping to move kfreebsd-kernel-headers' files to multiarch
> path /usr/include/$(DEB_TARGET_MULTIARCH), so that headers of other
> kernels are co-installable on a build machine (for cross-building and
> bootstrapping).
Thanks for doing that work!
> Please could glibc be patched as attached, to always look in that
> directory for system includes, even for native builds (HOST==BUILD).
I'm not quite sure how much backwards compatibility we need here and
your patch probably breaks that. In former times (before multiarch based
cross building) cross libraries were installed in a sysroot, typically
/usr/$(DEB_HOST_GNU_TYPE). The package dpkg-cross was used to convert
regular :$(DEB_HOST_ARCH) packages to -$(DEB_HOST_ARCH)-cross:all
packages and convert the paths in the same way. (In
jenkins.d.n/view/rebootstrap this method is called "supported", because
it is the only way supported by the gcc maintainers.)
So maybe we could find a way that works for both the "dpkg-cross" way
(at least in theory) and the multiarch way.
For linux this is not sorted out either yet. The relevant code here is
in debian/sysdeps/linux.mk:
| ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
| LINUX_HEADERS := /usr/include
| else
| LINUX_HEADERS := /usr/$(DEB_HOST_GNU_TYPE)/include
| endif
| LINUX_ARCH_HEADERS := /usr/include/$(DEB_HOST_MULTIARCH)
The patch in bug #773300 (which is mostly obsolete due to merging
#766877), suggests to change this ifeq to the following line.
| ifeq ($(shell dpkg-query --status linux-libc-dev-$(DEB_HOST_ARCH)-cross 2>/dev/null),)
It might make sense to do something similar for kfreebsd, but I was
still wondering whether this particular test method works in all
relevant cases.
Aurelien, I shall follow up to #773300 again and explain what parts of
that bug are still applicable.
> - ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
> - KFREEBSD_HEADERS := /usr/include
> - else
> - KFREEBSD_HEADERS := /usr/$(DEB_HOST_GNU_TYPE)/include
> - endif
> + KFREEBSD_HEADERS := /usr/include/$(DEB_TARGET_MULTIARCH)
Using target variables is wrong here. It might work (because target
defaults to host), but it doesn't make sense semantically. This must be
DEB_HOST_MULTIARCH here. Target variables are only relevant for
compilers, but glibc isn't a compiler.
Helmut
Reply to: