在Oracle Linux上,我试图从以下内容构建GCC工具链:
所有这些都是截止到今天的最新版本。 我的配置如下:
../gcc10-toolchain/configure \
--prefix=/opt/gcc10-toolchain \
--with-diagnostics-color=auto \
--with-system-zlib \
--with-system-lzma \
--enable-languages="c,c++,lto" \
--enable-shared \
--enable-static \
--enable-gold=default \
--enable-install-libbfd \
--enable-plugins \
--enable-default-pie \
--enable-linker-build-id \
--enable-threads=posix \
--enable-checking=release \
--enable-__cxa_atexit \
--enable-initfini-array \
--enable-gnu-indirect-function \
--enable-tui \
--enable-bootstrap \
--disable-multilib \
--disable-libgcj \
--disable-nls \
--disable-lto \
--disable-libstdcxx-debug
但是,在使用make
进行构建时,出现以下错误:
../../gcc10-toolchain/gcc/lto-streamer-out.c: In function ‘void write_symbol_extension_info(tree)’: ../../gcc10-toolchain/gcc/lto-streamer-out.c:2790:10: error: ‘GCCST_VARIABLE’ was not declared in this scope
? GCCST_VARIABLE : GCCST_FUNCTION);
^ ../../gcc10-toolchain/gcc/lto-streamer-out.c:2790:27: error: ‘GCCST_FUNCTION’ was not declared in this scope
? GCCST_VARIABLE : GCCST_FUNCTION);
^ ../../gcc10-toolchain/gcc/lto-streamer-out.c:2797:18: error: ‘GCCSSK_BSS’ was not declared in this scope section_kind |= GCCSSK_BSS;
不幸的是,我在网上找不到任何东西,也不知道从哪里开始寻找。
答案 0 :(得分:2)
问题在于我将源代码一起复制的顺序。 binutils-2.34早于gcc-10.1.0,因此最后复制gcc-10.1.0,以便它覆盖与binutils共享的文件,而不是相反。