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

            Bug ID: 118369
           Summary: Multilib bootstrap on Debian 12 fails due to missing
                    asm/errno.h
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iii at linux dot ibm.com
  Target Milestone: ---

I'm trying to bootstrap gcc with multilib on cfarm422. It is running debian 12,
and as far as I can see all the necessary cross packages are installed.

./configure && make fails with:

[...]/gcc/build1/./gcc/xgcc -B[...]/gcc/build1/./gcc/
-B/usr/local/x86_64-linux-gnu/bin/  -B/usr/local/x86_64-linux-gnu/lib/../lib32/
-B/usr/local/x86_64-linux-gnu/lib/ -isystem /usr/local/x86_64-linux-gnu/include
-isystem /usr/local/x86_64-linux-gnu/sys-include   -fno-checking -g -O2 -m32
-O2  -g -O2 -DIN_GCC   -W -Wall -Wno-error=narrowing -Wwrite-strings
-Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition  -isystem ./include  -fpic -mlong-double-80
-DUSE_ELF_SYMVER -fcf-protection -mshstk -g -DIN_LIBGCC2 -fbuilding-libgcc
-fno-stack-protector  -fpic -mlong-double-80 -DUSE_ELF_SYMVER -fcf-protection
-mshstk -I. -I. -I../../.././gcc -I../../../../libgcc -I../../../../libgcc/.
-I../../../../libgcc/../gcc -I../../../../libgcc/../include
-I../../../../libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS 
-DUSE_TLS  -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c
../../../../libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
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 have two concerns here:

- Is it okay that the argument-less ./configure does not work?

- Is it okay that the -m32 libgcc build relies on headers from
/usr/x86_64-linux-gnu/include and not from /usr/i686-linux-gnu/include?

Reply via email to