Bug#1065416: [Cross-toolchain-base-devs] Bug#1065416: linux-libc-dev claims to provide linux-libc-dev-ARCH-cross, but it doesn't do that completely
- To: Bastian Blank <waldi@debian.org>, 1065416@bugs.debian.org, doko@debian.org
- Cc: 1064003@bugs.debian.org
- Subject: Bug#1065416: [Cross-toolchain-base-devs] Bug#1065416: linux-libc-dev claims to provide linux-libc-dev-ARCH-cross, but it doesn't do that completely
- From: Helmut Grohne <helmut@subdivi.de>
- Date: Thu, 21 Mar 2024 20:48:01 +0100
- Message-id: <[🔎] 20240321194801.GA3220846@subdivi.de>
- Reply-to: Helmut Grohne <helmut@subdivi.de>, 1065416@bugs.debian.org
- In-reply-to: <20240305085027.GA1965023@subdivi.de>
- References: <0cde5b2e-d145-493a-b889-16e58230b96d@debian.org> <0cde5b2e-d145-493a-b889-16e58230b96d@debian.org> <20240304102906.55joiaozhetx63yb@shell.thinkmo.de> <5c8a0485-c9ca-4287-b8d6-98e92f18a05a@canonical.com> <0cde5b2e-d145-493a-b889-16e58230b96d@debian.org> <20240304113009.kcd4xmp7vkvw2byf@shell.thinkmo.de> <20240304124924.GA1562503@subdivi.de> <20240304220422.tpsvqnr5fdlsl6gv@shell.thinkmo.de> <20240305085027.GA1965023@subdivi.de> <0cde5b2e-d145-493a-b889-16e58230b96d@debian.org>
Hi Bastian and Matthias,
I was recently working on gcc builds and this disagreement currently
makes stuff unbuildable. Hence I looked into solutions and/or
workarounds.
On Tue, Mar 05, 2024 at 09:50:27AM +0100, Helmut Grohne wrote:
> > You just said that the search path used during the build of the
> > toolchain and the one for everything else are unrelated. So you are
> > free to create $BUILD/tmp-include with symlinks for asm, asm-generic,
> > linux.
> >
> > The toolchain as installed already finds all headers. So I still don't
> > see why we need this in the final system.
>
> I find this argument fairly convincing and hope Matthias also does.
As a result, I implemented the proposed change and am attaching it for
discussion here. I've implemented it in a way that if there is a sysroot
linux header installation, it'll be preferred. Do you see any downsides
of this approach?
Helmut
linux-libc-dev now provides linux-libc-dev-$arch-cross without actually
providing /usr/<triplet>/include. Thus we symlink it to where we need it.
See also #1064003.
diff --git a/debian/rules2 b/debian/rules2
index 651d14af..6a486ffe 100644
--- a/debian/rules2
+++ b/debian/rules2
@@ -1266,6 +1266,13 @@ endif
ln -sf /usr/include/$(DEB_HOST_MULTIARCH)/crypt.h \
$(builddir)/sys-include/crypt.h; \
fi
+ : # Import headers from Multi-Arch:foreign linux-libc-dev
+ set -e; for d in asm-generic linux; do \
+ if [ -d "/usr/include/$$d" ] && ! [ -d "/usr/$(DEB_TARGET_GNU_TYPE)/include/$$d" ]; then \
+ mkdir -p '$(builddir)/sys-include'; \
+ ln -sf "/usr/include/$$d" "$(builddir)/sys-include/$$d"; \
+ fi; \
+ done
touch $(configure_stamp)
Reply to: