lisanke wrote:
If, as was stated above, you can Not build a gcc cross-compiler --without-headers... Why does the
https://wiki.osdev.org/GCC_Cross-Compiler#GCC Instructions for building a cross-compiler (target with no libc) have us try??? Just trying to understand... is it a right of passage? :-p I'm trying to build a cross compiler on a windows machine under cygwin and I can find pthread.h ... the make all-libgcc-target can't find it because we told configure to not find it... but the build abends. So, what I think is asked here and in many other places is, why would an instruction on building a GCC cross compiler intentional (or accidentally for years) produce an outcome know to fail? It makes no sense... I can move on to the next set with sysroot but I like to understand what went wrong when an expected outcome doesn't happen... after years of development, it's just my way.
Thanks to anyone with sincere comments that can explain.
It's not that you can't build a gcc cross-compiler --without-headers, it's that the wiki directions are for a different type of cross-compiler to be used for different purposes. The wiki directions are for building a cross compiler for kernel development, generally on the same architecture. The default configuration of gcc assumes that you are building applications that will be linked with a C library. To avoid certain pitfalls in kernel programming, you need to build a compiler that won't make those assumptions. But you're trying to build a cross compiler that will build Linux applications against glibc for MIPS on a different OS and architecture. For that, gcc needs to make all of the assumptions that the cross compiler setup on the wiki needs to avoid.
Korona didn't say you can't build a gcc *cross-compiler* --without-headers, he said that you can't build a *Linux compiler* without headers (strictly speaking, if you were building a compiler for an environment that used a Linux kernel, but where the system runtime was an oddball library that did not implement the C standard library, you would use --without-headers as well, but that doesn't really apply to what you're trying to do).