I've already built the cross compiler from the mingw-w64 source and the newest gcc and binutils tarballs. It seems to be working fine because there are some i686-w64-mingw32-prefixed executables in my path, and simple hello world that i've compiled on my linux machine using them ran well on my winxp virtual machine. Now I need to use it all to build mingw-w64 again but for windows.
I was using this file found in mingw-w64-doc directory as a base tutorial:
https://pastebin.com/9rtrrkmw
Here's the approximate list of commands that i've used:
Code:
export WD=$HOME/mingw-build
export TGT=i686-w64-mingw32
cd ~/binutils/tmp
../configure --prefix=$WD --with-sysroot=$WD --host=$TGT --disable-multilib --disable-nls
make && make install
cd ~/mingw/mingw-w64-headers/tmp
../configure --prefix=$WD/$TGT --host=$TGT
make install
ln -s $WD/{$TGT,mingw}
(copy gmp, mpc and mpfr into ~/gcc here)
cd ~/gcc/tmp
../configure --prefix=$WD --with-sysroot=$WD --host=$TGT --disable-multilib --disable-nls --enable-languages=c,c++
make all-gcc && make install-gcc
cd ~/mingw/mingw-w64-crt
../configure --prefix=$WD/$TGT --with-sysroot=$WD --host=$TGT
make && make install
cd ~/gcc/tmp
make
The problem appears on the last make command. Here are last lines of the output:
Code:
checking how to run the C preprocessor... /lib/cpp
configure: error: in `/home/alpha/work/tmp/gcc-7.2.0/bin/i686-w64-mingw32/libgcc':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
I guess it means that my toolchain is broken, but I can't figure out why. Is that something wrong with my ../configures? Or maybe i have to redefine my $PATH after some point? I dunno, that's my first experience building gcc. Halp pls
I'm using gcc 7.2.1 on archlinux.