Re: Bug#797324: gcc-5: please support multiarch path to kfreebsd-kernel-headers
> 在 2015年8月29日,下午10:39,Steven Chamberlain <steven@pyro.eu.org> 写道:
>
> Package: src:gcc-5
> Version: 5.2.1-15
> Severity: wishlist
> Tags: patch
> User: helmutg@debian.org
> Usertags: rebootstrap
>
> Hi,
>
> gcc-5 already supports having some linux kernel headers at
> /usr/include/$(DEB_TARGET_MULTIARCH)/asm
>
> We'd like to move *all* of kfreebsd-kernel-headers into
> /usr/include/$(DEB_TARGET_MULTIARCH), to allow cross-building linux
> arches from kfreebsd and vice-versa. Moving our headers to a multiarch
> path would deconflict identically named kernel headers.
>
> Would the attached patch be acceptable? I have tested this with native
> builds on kfreebsd-i386 and kfreebsd-amd64 (with biarch). The change
> should not affect other arches than kfreebsd. And it is backward-
> compatible with headers being in /usr/include/sys, until we actually
> make the change in sid.
+ifeq ($(DEB_TARGET_ARCH_OS),kfreebsd)
: # multilib builds without b-d on gcc-multilib (used in FLAGS_FOR_TARGET)
+ ln -sf /usr/include/$(DEB_TARGET_MULTIARCH) $(builddir)/sys-include
+else
if [ -d /usr/include/$(DEB_TARGET_MULTIARCH)/asm ]; then \
mkdir -p $(builddir)/sys-include; \
ln -sf /usr/include/$(DEB_TARGET_MULTIARCH)/asm $(builddir)/sys-include/asm; \
fi
+endif
Why not do the same things like Linux?
aka, only link the headers really needed.
+
+ifeq ($(DEB_TARGET_ARCH_OS),kfreebsd)
+ : # multilib builds without b-d on gcc-multilib (used in FLAGS_FOR_TARGET)
+ ln -sf /usr/include/$(DEB_TARGET_MULTIARCH) $(builddir_jit)/sys-include
+endif
+
Build-deps on gcc-multilib should be a better choice.
You can link the needed headers in libc6-dev-{i386,amd64} multilib libraries.
I think making kfreebsd have the similar way to work should be ideal.
>
> Thanks!
>
> -- System Information:
> Debian Release: stretch/sid
> APT prefers unstable
> APT policy: (500, 'unstable'), (1, 'experimental')
> Architecture: kfreebsd-amd64 (x86_64)
>
> Kernel: kFreeBSD 9.0-2-amd64-xenhvm-ipsec
> Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> <gcc-5_5.2.1-15.diff>
Reply to: