On Sat, 18 Nov 2023, Xi Ruoyao wrote: > diff --git a/gcc/config/loongarch/loongarch-def.h > b/gcc/config/loongarch/loongarch-def.h > index b319cded456..6123c8e0f19 100644 > --- a/gcc/config/loongarch/loongarch-def.h > +++ b/gcc/config/loongarch/loongarch-def.h > @@ -46,6 +46,7 @@ along with GCC; see the file COPYING3. If not see > #ifndef LOONGARCH_DEF_H > #define LOONGARCH_DEF_H > > +#include <stdint.h> > #include "loongarch-tune.h" > > #ifdef __cplusplus
This has broken libgcc builds when target libc isn't yet available. In file included from /scratch/jmyers/glibc-bot/src/gcc/libgcc/../gcc/config/loongarch/loongarch-def.h:49, from /scratch/jmyers/glibc-bot/src/gcc/libgcc/../gcc/config/loongarch/loongarch-opts.h:24, from ../.././gcc/options.h:8, from ../.././gcc/tm.h:49, from /scratch/jmyers/glibc-bot/src/gcc/libgcc/libgcc2.c:29: /scratch/jmyers/glibc-bot/build/compilers/loongarch64-linux-gnu-lp64d/gcc-first/gcc/include/stdint.h:9:16: fatal error: stdint.h: No such file or directory 9 | # include_next <stdint.h> | ^~~~~~~~~~ compilation terminated. make[3]: *** [Makefile:505: _muldi3.o] Error 1 https://sourceware.org/pipermail/libc-testresults/2023q4/012109.html My guess would be that the definitions needing <stdint.h> are not actually needed in code built for the target, and so there should be more #if !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS) && !defined(IN_RTS) conditions like the one already present in loongarch-opts.h, to avoid depending on a target header like this being present. (Alternatively, one could argue for building much libgcc code with -ffreestanding, which would also avoid GCC's <stdint.h> expecting a libc header to be available - but that would have more risk for other targets.) -- Joseph S. Myers jos...@codesourcery.com