narke / gcc-cross-compiler

A script to cross-compile GCC toolchain for various target architectures.
BSD 3-Clause "New" or "Revised" License
51 stars 11 forks source link

fatal error: stdio.h: No such file or directory #7

Closed gthaker closed 1 year ago

gthaker commented 3 years ago

get a similar error. What are the steps needed to build glibc (or any other steps) to overcome this?

~/usr2ppc32/bin/ppc-linux-gnu-gcc -o hello hello.c hello.c:1:9: fatal error: stdio.h: No such file or directory 1 | #include | ^~~~~ compilation terminated.

~/usr2ppc32/bin/ppc-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=/export/home/gthaker/usr2ppc32/bin/ppc-linux-gnu-gcc COLLECT_LTO_WRAPPER=/export/home/gthaker/usr2ppc32/libexec/gcc/ppc-linux-gnu/11.1.0/lto-wrapper Target: ppc-linux-gnu Configured with: /proj/home/gthaker/repos/gcc-11.2/ppc32/gcc-11.1.0/configure --target=ppc-linux-gnu --prefix=/export/home/gthaker/usr2ppc32 --program-prefix=ppc-linux-gnu- --with-gnu-as --with-gnu-ld --disable-nls --disable-threads --enable-languages=c --disable-multilib --disable-libgcj --without-headers --disable-shared --enable-lto --disable-werror Thread model: single Supported LTO compression algorithms: zlib gcc version 11.1.0 (GCC)

narke commented 3 years ago

Hello, It seems that you need to have cross-compiled glibc for the target architecture (or another c library) to link against, you may install such a library (maybe such packages exists). See this answer: https://stackoverflow.com/questions/23011367/arm-linux-gnu-gcc-fatal-error-stdio-h-no-such-file-or-directory

I never run into such situation because I use it only to compile kernels.