← Back to team overview

cross-toolchain-base-devs team mailing list archive

Bug#1064003: Bug#1065416: Bug#1065416: linux-libc-dev claims to provide linux-libc-dev-ARCH-cross, but it doesn't do that completely

 

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)
 

References