#1092576 linux-libc-dev: Multilib GCC bootstrap on Debian 12 fails due to missing asm/errno.h

Package:
linux-libc-dev
Source:
linux-libc-dev
Description:
Linux support headers for userspace development
Submitter:
Ilya Leoshkevich
Date:
2025-01-17 16:36:02 UTC
Severity:
normal
#1092576#5
Date:
2025-01-09 08:58:38 UTC
From:
To:
Dear Maintainer,

I'm trying to bootstrap gcc from git master with multilib on debian 12.
As far as I can see all the necessary cross packages are installed.

./configure && make fails with:

In file included from /usr/include/bits/errno.h:26,
                 from /usr/include/errno.h:28,
                 from ../../../../libgcc/../gcc/tsystem.h:101,
                 from ../../../../libgcc/libgcc2.c:27:
/usr/include/linux/errno.h:1:10: fatal error: asm/errno.h: No such file or directory
    1 | #include <asm/errno.h>
      |          ^~~~~~~~~~~~~

However, running ./configure with the same flags as the distro-built
GCC succeeds.

The minimal set of working options appears to be: --prefix=/usr
--build=x86_64-linux-gnu. This ultimately adds
-isystem /usr/x86_64-linux-gnu/include to the problematic GCC
invocation, which makes the issue go away.

I filed this upstream [1] and Andrew Pinski replied:

```
Looks like they changed how they handle mutli-lib with respect to multi-arch.

Before they required you to install the multiarch i386-linux-gnu too.

Now it seems like 32bit is multilibed in with the x86_64-linux-gnu.
BUT x32 is still multi-arch.

I would raise this issue with debian really because they made some changes which are break how multiarch work.
```

Best regards,
Ilya

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118369

#1092576#10
Date:
2025-01-15 20:12:40 UTC
From:
To:
How do you configure GCC to support the Debian multi-arch include
layout?  Also direct support requires Debian 13, due to linux-libc-dev
only supporting a single arch before.

For everything else, please refer to gcc packages on how to build it.

Bastian

#1092576#13
Date:
2025-01-15 20:12:40 UTC
From:
To:
How do you configure GCC to support the Debian multi-arch include
layout?  Also direct support requires Debian 13, due to linux-libc-dev
only supporting a single arch before.

For everything else, please refer to gcc packages on how to build it.

Bastian

#1092576#18
Date:
2025-01-15 23:10:25 UTC
From:
To:
Hi Bastian,

thanks for having a look!

In the upstream ticket Matthias has figured out that the root cause is
the lack of the gcc-multilib package, which conflicts with the
cross-compilers, which are installed on the affected systems.
I believe that this, in turn, is a very old issue, which is not going
to go away anytime soon.

I tried to upgrade to debian 13, and with it I get better diagnostics
from the gcc's configure:

configure: error: I suspect your system does not have 32-bit
development libraries (libc and headers). If you have them, rerun
configure with --enable-multilib. If you do not have them, and want to
build a 64-bit-only compiler, rerun configure with --disable-multilib.

So we can close this bug.

Best regards,
Ilya

#1092576#23
Date:
2025-01-15 23:10:25 UTC
From:
To:
Hi Bastian,

thanks for having a look!

In the upstream ticket Matthias has figured out that the root cause is
the lack of the gcc-multilib package, which conflicts with the
cross-compilers, which are installed on the affected systems.
I believe that this, in turn, is a very old issue, which is not going
to go away anytime soon.

I tried to upgrade to debian 13, and with it I get better diagnostics
from the gcc's configure:

configure: error: I suspect your system does not have 32-bit
development libraries (libc and headers). If you have them, rerun
configure with --enable-multilib. If you do not have them, and want to
build a 64-bit-only compiler, rerun configure with --disable-multilib.

So we can close this bug.

Best regards,
Ilya

#1092576#26
Date:
2025-01-15 23:10:25 UTC
From:
To:
Hi Bastian,

thanks for having a look!

In the upstream ticket Matthias has figured out that the root cause is
the lack of the gcc-multilib package, which conflicts with the
cross-compilers, which are installed on the affected systems.
I believe that this, in turn, is a very old issue, which is not going
to go away anytime soon.

I tried to upgrade to debian 13, and with it I get better diagnostics
from the gcc's configure:

configure: error: I suspect your system does not have 32-bit
development libraries (libc and headers). If you have them, rerun
configure with --enable-multilib. If you do not have them, and want to
build a 64-bit-only compiler, rerun configure with --disable-multilib.

So we can close this bug.

Best regards,
Ilya

#1092576#31
Date:
2025-01-17 16:33:19 UTC
From:
To:
Thanks for confirming.

Bastian

#1092576#34
Date:
2025-01-17 16:33:19 UTC
From:
To:
Thanks for confirming.

Bastian