I am trying to compile binutils and GCC (for windows) as per this tutorial. The binutils compilation has finished without errors , however GCC has failed
Steps I've taken
Installed MinGW with the dependencies specified in the tutorial.
Installed the GCC and binutils source code and unpacked them in $HOME/src folder
And in the MinGW shell:
export PREFIX="$HOME/opt/cross"
export TARGET=i686-elf
export PATH="$PREFIX/bin:$PATH"
cd $HOME/src
mkdir build-binutils
cd build-binutils
../binutils-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
make
make install
so far everything went without any errors
cd $HOME/src
# The $PREFIX/bin dir _must_ be in the PATH. We did that above.
which -- $TARGET-as || echo $TARGET-as is not in the PATH
mkdir build-gcc
cd build-gcc
../gcc-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers
make all-gcc
make all-target-libgcc
make install-gcc
make install-target-libgcc
Firstly, the which command failed giving unrecognized command -- . I ensured that path_to_sysm_user/opt/cross/bin was added to PATH and moved on
Then in make all-gcc warnings and errors popped up:
../../gcc-10.3.0/gcc/mem-stats.h:215:72: warning: ISO C++11 does not support the 'I64' ms_printf length modifier [-Wformat=]
../../gcc-10.3.0/gcc/pretty-print.c: In function 'void eat_esc_sequence(HANDLE, int, const char*, const char*)':
../../gcc-10.3.0/gcc/pretty-print.c:530:22: error: 'COMMON_LVB_UNDERSCORE' was not declared in this scope
attrib_add |= COMMON_LVB_UNDERSCORE;
^~~~~~~~~~~~~~~~~~~~~
../../gcc-10.3.0/gcc/pretty-print.c:539:22: error: 'COMMON_LVB_REVERSE_VIDEO' was not declared in this scope
attrib_add |= COMMON_LVB_REVERSE_VIDEO;
^~~~~~~~~~~~~~~~~~~~~~~~
../../gcc-10.3.0/gcc/pretty-print.c:644:24: error: 'COMMON_LVB_REVERSE_VIDEO' was not declared in this scope
if (attrib_add & COMMON_LVB_REVERSE_VIDEO)
^~~~~~~~~~~~~~~~~~~~~~~~
# And it finished with
make[1]: *** [pretty-print.o] Error 1
make[1]: Leaving directory `/home/Ashok/src/build-gcc/gcc'
make: *** [all-gcc] Error 2