如何解决在 Windows 上为 i686-elf 编译 GCC 时出错MinGW
我正在尝试按照此 tutorial 编译 binutils 和 GCC(适用于 Windows)。 binutils 编译已经完成,没有错误,但是 GCC 失败了
我采取的步骤
使用教程中指定的依赖项安装 MinGW。
安装 GCC 和 binutils 源代码并将它们解压到 $HOME/src
文件夹
在 MinGW 外壳中:
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
到目前为止一切顺利
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
首先, which
命令未能给出 unrecognized command --
。我确保 path_to_sysm_user/opt/cross/bin
已添加到 PATH 并继续
然后在 make all-gcc
中弹出警告和错误:
../../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
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。