#1144189 c-t-b-ports fails to building glibc for arc-linux-gnu

#1144189#5
Date:
2026-08-12 02:18:25 UTC
From:
To:
cross-toolchain-base-ports ftbfs in the glibc stage1 target.  I haven't
figured out what is exactly wrong about it, as it is the only target
with that kind of build failure.

In file included from ../sysdeps/unix/sysv/linux/bits/errno.h:26,
                  from ../stdlib/errno.h:28,
                  from ../include/errno.h:2,
                  from ../sysdeps/unix/sysdep.h:28,
                  from ../sysdeps/unix/sysv/linux/arc/sysdep.h:24,
                  from ../sysdeps/arc/nptl/tls.h:33,
                  from ../include/link.h:51,
                  from <stdin>:1:
/usr/include/linux/errno.h:1:10: fatal error: asm/errno.h: No such file
or directory
     1 | #include <asm/errno.h>
       |          ^~~~~~~~~~~~~
compilation terminated.
rm -f
/build/reproducible-path/cross-toolchain-base-ports-77/glibc-2.43/build-tree/arc-libc/sem_t-align.h.dT

The build still uses gcc-15, glibc now has a new upstream version, and
the linux headers are provided by the linux source package.

full build log at
https://buildd.debian.org/status/package.php?p=cross-toolchain-base-ports

Debian doesn't have an arc port, so one option possibly is to drop the
arc target as well.

#1144189#10
Date:
2026-08-12 03:12:31 UTC
From:
To:
Control: reassign -1 src:cross-toolchain-base-ports
/usr/arc-linux-gnu.  The failing gcc call uses -nostdinc, so why does
gcc fall back to /usr/include?

To be exact, it uses:
| -nostdinc
| -isystem /build/reproducible-path/cross-toolchain-base-ports-77/debian/tmp.arc/usr/bin/../lib/gcc-cross/arc-linux-gnu/15/include
| -isystem /build/reproducible-path/cross-toolchain-base-ports-77/debian/tmp.arc/usr/bin/../lib/gcc-cross/arc-linux-gnu/15/include-fixed
| -isystem /build/reproducible-path/cross-toolchain-base-ports-77/glibc-2.43/debian/include

Aka it is configured to use the gcc fixed up headers, not even the ones
from the package.

Bastian

#1144189#17
Date:
2026-08-12 17:20:05 UTC
From:
To:
And this is the clue:

| # ls -al glibc-2.43/debian/include/
| total 8
| drwxr-xr-x 1 root root   54 Aug 12 14:09 .
| drwxr-xr-x 1 root root 3694 Aug 12 17:11 ..
| lrwxrwxrwx 1 root root   24 Aug 12 14:09 asm-generic -> /usr/include/asm-generic
| -rw-r--r-- 1 root root    0 Aug 12 14:09 assert.h
| lrwxrwxrwx 1 root root   18 Aug 12 14:09 linux -> /usr/include/linux
| drwxr-xr-x 1 root root    0 Aug 12 14:09 sys

glibc assumes a normal header arrangement and symlinks them into
debian/include.  As the cross-toolchain-base maintainer insists on the
sysroot layout, he needs to somehow redirect this to that layout.

Anyway, there is a LINUX_SOURCE definition in debian/rules.  This is
then used by glibc as additional search location and current set to
debian/tmp.arc/usr/include.  Did this in the past contain the headers,
as side effect of the linux-libc-dev-*-cross build?

Bastian

#1144189#22
Date:
2026-08-12 18:46:32 UTC
From:
To:
--- cross-toolchain-base-ports-77/debian/rules	2026-08-11 07:07:26.000000000 +0000
+++ cross-toolchain-base-ports-77/debian/rules	2026-08-11 07:07:26.000000000 +0000
@@ -472,7 +473,7 @@
 	cd glibc-${VER_GLIBC} && \
 	  PATH=${CURDIR}/debian/tmp.${CROSS_ARCH}/$(PF)/bin/:${PATH} \
 	  LD_LIBRARY_PATH=$(call binutils_ldpath,$*):${CURDIR}/gcc/debian/lib$(libgcc_base)1-armel-cross/usr/${CROSS_GNU_TYPE}/lib/ \
-	  LINUX_SOURCE=${CURDIR}/debian/tmp.${CROSS_ARCH}/usr \
+	  LINUX_SOURCE=/usr/${CROSS_GNU_TYPE} \
 	  PATCHED_SOURCES=yes \
 	  WITH_BUILD_SYSROOT=${CURDIR}/debian/tmp.${CROSS_ARCH} \
 	  DEB_BUILD_PROFILES=stage1 \
@@ -545,7 +546,7 @@
 	cd glibc-${VER_GLIBC} && \
 	  PATH=${CURDIR}/debian/tmp.${CROSS_ARCH}/$(PF)/bin/:${PATH} \
 	  LD_LIBRARY_PATH=$(call binutils_ldpath,$*):${CURDIR}/gcc/debian/lib$(libgcc_base)1-armel-cross/usr/${CROSS_GNU_TYPE}/lib/ \
-	  LINUX_SOURCE=${CURDIR}/debian/tmp.${CROSS_ARCH}/usr \
+	  LINUX_SOURCE=/usr/${CROSS_GNU_TYPE} \
 	  DEB_BUILD_OPTIONS="nocheck notest notests $(DH_PARALLEL)" \
 	  PATCHED_SOURCES=yes \
 	  WITH_BUILD_SYSROOT=${CURDIR}/debian/tmp.${CROSS_ARCH} \

Bastian

#1144189#27
Date:
2026-08-13 09:58:40 UTC
From:
To:
Hi,

The glibc scripts is unable to do the symlinking process for the arc
architecture as the linux-libc-dev package doesn't provide headers for
the arc architectures, contrary to all other architectures:

$ dpkg -L linux-libc-dev | grep '/usr/include/.*/asm/errno.h'
/usr/include/aarch64-linux-gnu/asm/errno.h
/usr/include/alpha-linux-gnu/asm/errno.h
/usr/include/arm-linux-gnueabi/asm/errno.h
/usr/include/arm-linux-gnueabihf/asm/errno.h
/usr/include/hppa-linux-gnu/asm/errno.h
/usr/include/i386-linux-gnu/asm/errno.h
/usr/include/loongarch64-linux-gnu/asm/errno.h
/usr/include/m68k-linux-gnu/asm/errno.h
/usr/include/mips-linux-gnu/asm/errno.h
/usr/include/mips64-linux-gnuabi64/asm/errno.h
/usr/include/mips64el-linux-gnuabi64/asm/errno.h
/usr/include/mipsel-linux-gnu/asm/errno.h
/usr/include/mipsisa64r6el-linux-gnuabi64/asm/errno.h
/usr/include/powerpc-linux-gnu/asm/errno.h
/usr/include/powerpc64-linux-gnu/asm/errno.h
/usr/include/powerpc64le-linux-gnu/asm/errno.h
/usr/include/riscv64-linux-gnu/asm/errno.h
/usr/include/s390x-linux-gnu/asm/errno.h
/usr/include/sh4-linux-gnu/asm/errno.h
/usr/include/sparc64-linux-gnu/asm/errno.h
/usr/include/x86_64-linux-gnu/asm/errno.h
/usr/include/x86_64-linux-gnux32/asm/errno.h

Regards
Aurelien

#1144189#32
Date:
2026-08-13 18:09:40 UTC
From:
To:
I'm unsure what you want to say.  Yes, headers for arc are not provided
in the multiarch form.  But as I already mentioned: this does not
matter at all at this time, as cross-toolchain-base uses sysroot and not
multiarch.

Bastian

#1144189#37
Date:
2026-08-13 18:40:15 UTC
From:
To:
Hi,

I am giving the explanation why all cross build architectures work,
except arc.
at runtime. Something has to provide the kernel headers for the cross
glibc and cross compiler to work. In the past it was
linux-libc-dev-arc-cross and libc6-dev-arc-cross depends on it for that
purpose.

Therefore I see two options:
- linux-libc-dev provides the arc kernel headers
- cross-toolchaine-base-ports continues to build
  linux-libc-dev-arc-cross

Regards
Aurelien

#1144189#42
Date:
2026-08-13 19:08:01 UTC
From:
To:
Hi

What are you talking about?!?  runtime or build time does not make a
difference on the existence of the kernel headers in
/usr/GNU_HOST/include.  Please explain how this could happen.

And what changed?  libc6-dev-arc-cross still depends on
linux-libc-dev-arc-cross, at least if this was not broken due to related
changes in cross-toolchain-base-ports.

It does?!?

No, src:linux provides linux-libc-dev-arc-cross.  If you think this is
incorrect, please talk to the CTTE, as this is part of a understanding
created within their reach last year at DebConf 25.

Bastian

#1144189#47
Date:
2026-08-13 20:11:59 UTC
From:
To:
Hi,

First of all, I just realized that the linux kernel now provides a
libc6-dev-arc-cross package in addition to linux-libc-dev. I got tricked
by the fact that cross-toolchain-base-ports is able to use the multiarch
headers, and it uses them since it stopped building the
libc6-dev-$arch-cross packages. Except for the arc architectures as
linux-libc-dev doesn't provide the headers for that architecture, hence
the FTBFS.

Therefore let me answer you the rest of the mail with that in mind.

I meant as runtime, like when using arc-linux-gnu-gcc with the
libc-dev-arc-cross package installed. But you are correct that the cross
compiler is also able to use the headers provided by the
linux-libc-dev-arc-cross build from src:linux.

Sorry you are correct, I thought linux-libc-dev was supposed to provide
that instead of linux-libc-dev-arc-cross.

Yes, correct, sorry about the confusion.

With a full view of the problem I agree the current solution is fine.
Therefore I believe the patch you proposed earlier is indeed correct.

Regards
Aurelien

#1144189#52
Date:
2026-08-20 03:35:38 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
cross-toolchain-base-ports, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1144189@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matthias Klose <doko@debian.org> (supplier of updated cross-toolchain-base-ports package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Thu, 20 Aug 2026 05:15:57 +0200
Source: cross-toolchain-base-ports
Architecture: source
Version: 78
Distribution: unstable
Urgency: medium
Maintainer: Cross Toolchain Base Team <cross-toolchain-base-devs@lists.launchpad.net>
Changed-By: Matthias Klose <doko@debian.org>
Closes: 1144189
Changes:
 cross-toolchain-base-ports (78) unstable; urgency=medium
 .
   * Copy linux headers to the build location when not building the
     linux-libc-dev packages. Closes: #1144189.
   * Build using linux 7.1.8.
Checksums-Sha1:
 c3000fccea32f6261115ef245594e8cf09207d7e 6020 cross-toolchain-base-ports_78.dsc
 b37c3721336be218564cbabb549a4f1fd451a74a 45780 cross-toolchain-base-ports_78.tar.xz
 3516b40f5b9f96eb5ee44b01ceb0f6f73869fa1f 9199 cross-toolchain-base-ports_78_source.buildinfo
Checksums-Sha256:
 e8bf37788527c06c81fe8d45ade1780feb3f61e1d35524839cda6af103d078cf 6020 cross-toolchain-base-ports_78.dsc
 13d2cfc32dd783d4bb534897b3e35658ea0910682bafd860fd1c74db3e4faef5 45780 cross-toolchain-base-ports_78.tar.xz
 51c04453dc64be2d18e88e4129e26fb40c2e873e12c604a30106ab80206b9f1f 9199 cross-toolchain-base-ports_78_source.buildinfo
Files:
 a822962c417898932784c78cbf24d661 6020 devel optional cross-toolchain-base-ports_78.dsc
 669d1bd0b4a65bac576457fb5cbc7bdc 45780 devel optional cross-toolchain-base-ports_78.tar.xz
 42c480f4bc973416b39d7eb8870f67c2 9199 devel optional cross-toolchain-base-ports_78_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJEBAEBCgAuFiEE1WVxuIqLuvFAv2PWvX6qYHePpvUFAmqGcpsQHGRva29AZGVi
aWFuLm9yZwAKCRC9fqpgd4+m9Q7zEAC/iQMPzIwo5xzsyYX6uUQKOLH+hpolMpjH
QemB02kEe2UTul0Q4CqRm7dEHPUZIEZF/4z7jzknTH7sdoHkIcF8mrybdlpry6HO
EGkDVX3TNCqJFG93oYtNNqgXK+YSACf+usM7xVuHpct0opVw3aVkjgJou/PSnEpN
hc8WyoKxbfatpxFvUC+O7Jsp7Ecwb8veHBAE16JAq/JXg14ec0Ob0Y2u3MFbSTQr
CSRVgsT3GGHegoJWlrYNy+aYQg8edKP7oUS6ny+6l5jmuwk/t8TNVtDvLeByhVwE
nA00Piss+m+W0cxnzE6QE0WQsBN57An6Re52bKT3mM3DRoaKDgEjsafX//hNs29X
Ol9+23AOFuTKW5WJNTo1RVo2KmOL1uxHN2lbtsEXZhv74QOL0sKjBesQBRWs+fCG
6c3fUM5NdCsiGpVfl5sung5EsrJw7mVO04a+3IUqbIsa4ZprW4ROJYtEwtdDiJRW
p1W7OTkXj4JdUsQu+6KTxYJ0hICg3RrnlTWkjuabrweWCOhj9Nhgrq9Pnr1Vbnjw
xS/SOye6Lc1F9yaBHVO8JvPuZnuRaPyuk+CjTKi6DPKXIdG7g3VilanrWuhV3D9Q
C9TCWhUiFSJ4bBsw3WJaTVunQ0AGZQ3nHJwJv8lu3GYhxbuGJql0g/ZxlMsiP/oP
Sy9i56eacA==
=vygl
-----END PGP SIGNATURE-----