https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108433
Bug ID: 108433 Summary: canadian cross aarch64/x86_64/aarch64 fails to build Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgcc Assignee: unassigned at gcc dot gnu.org Reporter: arnd at linaro dot org Target Milestone: --- I tried to build a set of cross compilers for all target architectures. Build architecture is arm64, host architecture is x86_64 or ppc64le, both of them fail the same way: cc -g -O2 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -fPIC -I. -I. -I../.././gcc -I/home/arnd/git/gcc/libgcc -I/home/arnd/git/gcc/libgcc/. -I/home/arnd/git/gcc/libgcc/../gcc -I/home/arnd/git/gcc/libgcc/../include -DHAVE_CC_TLS -o unwind-dw2-fde-dip.o -MT unwind-dw2-fde-dip.o -MD -MP -MF unwind-dw2-fde-dip.dep -fexceptions -c /home/arnd/git/gcc/libgcc/unwind-dw2-fde-dip.c -fvisibility=hidden -DHIDE_EXPORTS libgcc/unwind-dw2.c:967:20: error: ‘__LIBGCC_DWARF_CIE_DATA_ALIGNMENT__’ undeclared (first use in this function); did you mean ‘DWARF_CIE_DATA_ALIGNMENT’? The problem seems to be caused by configure picking up /usr/bin/cc as the compiler for building libgcc when in a canadian cross with build==target, despite another aarch64-linux-gnu-gcc being provided for this purpose: Configuring in aarch64-linux/libgcc configure: creating cache ./config.cache checking build system type... aarch64-unknown-linux-gnu checking host system type... aarch64-unknown-linux-gnu checking for --enable-version-specific-runtime-libs... no checking for a BSD-compatible install... /usr/bin/install -c checking for gawk... mawk checking for aarch64-linux-ar... /home/arnd/cross/arm64/gcc-13.0.1-nolibc/aarch64-linux/lib/gcc/aarch64-linux/13.0.1/../../../../aarch64-linux/bin/ar checking for aarch64-linux-lipo... lipo checking for aarch64-linux-nm... /home/arnd/cross/arm64/gcc-13.0.1-nolibc/aarch64-linux/lib/gcc/aarch64-linux/13.0.1/../../../../aarch64-linux/bin/nm checking for aarch64-linux-ranlib... /home/arnd/cross/arm64/gcc-13.0.1-nolibc/aarch64-linux/lib/gcc/aarch64-linux/13.0.1/../../../../aarch64-linux/bin/ranlib checking for aarch64-linux-strip... /home/arnd/cross/arm64/gcc-13.0.1-nolibc/aarch64-linux/lib/gcc/aarch64-linux/13.0.1/../../../../aarch64-linux/bin/strip checking whether ln -s works... yes checking for aarch64-linux-gcc... cc I think libgcc should either be built with the other compiler, or it should avoid dependencies on the having a matching target compiler version in the definition of __LIBGCC_DWARF_CIE_DATA_ALIGNMENT__.