Building a cross-compiling gcc using wiki tutorial
Posted: Tue Oct 22, 2013 10:56 am
Hi, I've been busy build a cross-compiler for the arm-none-eabi target, and I've been following this tutorial:
http://wiki.osdev.org/GCC_Cross-Compiler
My OS is Windows 7 64-bit and my compiler is nuwen MinGW 4.8.1
I've encountered many issues, but so far I have been able to solve all of them myself through the use of Google.
However, Google doesn't seem to be able to help me today - I'm encountering a strange problem with the cpp executable that was built.
I am using Cygwin+MinGW to build everything, which is working because I have a symbolic link from C:/cygwin/c/Users to C:/Users to allow tools that don't understand cygwin paths to still work properly. I've been able to build and install all the prerequisites for gcc as the tutorial requires (binutils, GMP, MPFR, MPC).
In my gcc directory I have a 'build' folder and an 'installation' folder. From the build folder I ran configure like this:
After resolving some issues via Google, I am now encountering this problem:
I've put the relevant config.log on gist:
https://gist.github.com/LB--/22b8c7755f913ee7c173
The relevant line from the output is line 747.
I'm really confused as to what is happening here. Google searching some of the errors gives me relevant results but none of them have solutions that I can use or that apply to me.
What I think is happening is that it is trying to run test the preprocessor on test files which include simple common headers that should exist. What I don't understand is why it is doing this, I thought that the configuration setting --without-headers affected things like this?
On the wiki, I see a troubleshooting topic "C++ preprocessor "/lib/cpp" fails sanity check in Cygwin when building Binutils", but I am not building binutils - I have built binutils already and it works. I'm having this issue with building gcc.
I really don't know what to do here - nothing I can find on Google helps, and all the workarounds I guessed and tried didn't work. Has anyone else had this problem and solved it? I've put a lot of time and effort into this build and I'm not willing to just give up.
http://wiki.osdev.org/GCC_Cross-Compiler
My OS is Windows 7 64-bit and my compiler is nuwen MinGW 4.8.1
I've encountered many issues, but so far I have been able to solve all of them myself through the use of Google.
However, Google doesn't seem to be able to help me today - I'm encountering a strange problem with the cpp executable that was built.
I am using Cygwin+MinGW to build everything, which is working because I have a symbolic link from C:/cygwin/c/Users to C:/Users to allow tools that don't understand cygwin paths to still work properly. I've been able to build and install all the prerequisites for gcc as the tutorial requires (binutils, GMP, MPFR, MPC).
In my gcc directory I have a 'build' folder and an 'installation' folder. From the build folder I ran configure like this:
Code: Select all
../configure --target=$TARGET --prefix=/cygdrive/c/Users/Nicholas/Code/gcc-4.8.2/installation --disable-nls --enable-languages=c,c++ --without-headers
Code: Select all
checking how to run the C preprocessor... /lib/cpp
configure: error: in `/cygdrive/c/Users/Nicholas/Code/gcc-4.8.2/build/arm-none-eabi/libgcc':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
make[1]: *** [configure-target-libgcc] Error 1
make[1]: Leaving directory `C:/Users/Nicholas/Code/gcc-4.8.2/build'
make: *** [all] Error 2
https://gist.github.com/LB--/22b8c7755f913ee7c173
The relevant line from the output is line 747.
I'm really confused as to what is happening here. Google searching some of the errors gives me relevant results but none of them have solutions that I can use or that apply to me.
What I think is happening is that it is trying to run test the preprocessor on test files which include simple common headers that should exist. What I don't understand is why it is doing this, I thought that the configuration setting --without-headers affected things like this?
On the wiki, I see a troubleshooting topic "C++ preprocessor "/lib/cpp" fails sanity check in Cygwin when building Binutils", but I am not building binutils - I have built binutils already and it works. I'm having this issue with building gcc.
I really don't know what to do here - nothing I can find on Google helps, and all the workarounds I guessed and tried didn't work. Has anyone else had this problem and solved it? I've put a lot of time and effort into this build and I'm not willing to just give up.