从源代码构建 gcc 5.4.0 时出错

问题描述 投票:0回答:1
I have to build gcc 5.4.0 from source on a server because I don't have root permission. The server is running on CentOS 6.5.

I try the following commands:

tar xzf gcc-5.4.0.tar.gz
cd gcc-5.4.0
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-5.4.0/configure --prefix=/ghome/mypath/software/try_gcc/installed/ --enable-languages=c,c++,fortran,go --disable-multilib
make
make install

一切正常,直到我运行

make
。我遇到了数百行错误消息,但我不知道发生了什么。部分错误信息如下:

/path_to_gcc/gcc/hwint.h:74: error: ‘HOST_WIDE_INT’ does not name a type
/path_to_gcc/gcc/hwint.h:157: error: expected ‘,’ or ‘...’ before ‘x’
/path_to_gcc/gcc/hwint.h: In function ‘int clz_hwi(unsigned int)’:
/path_to_gcc/gcc/hwint.h:159: error: ‘x’ was not declared in this scope
/path_to_gcc/gcc/hwint.h: At global scope:
/path_to_gcc/gcc/hwint.h:171: error: expected ‘,’ or ‘...’ before ‘x’
/path_to_gcc/gcc/hwint.h: In function ‘int ctz_hwi(unsigned int)’:
/path_to_gcc/gcc/hwint.h:232: error: ‘HOST_WIDE_INT’ does not name a type
/path_to_gcc/gcc/hwint.h:233: error: ‘HOST_WIDE_INT’ does not name a type
/path_to_gcc/gcc/hwint.h:234: error: ‘HOST_WIDE_INT’ does not name a type
/path_to_gcc/gcc/vec.h:305: error: ‘GATHER_STATISTICS’ was not declared in this scope
/path_to_gcc/gcc/vec.h: In static member function ‘static void va_heap::release(vec<T, va_heap, vl_embed>*&)’:
/path_to_gcc/gcc/tree.h:4723: error: expected ‘)’ before ‘;’ token
/path_to_gcc/gcc/wide-int.h:1930: error: ‘class generic_wide_int<wide_int_ref_storage<true> >’ has no member named ‘val’
/path_to_gcc/gcc/wide-int.h:1930: error: ‘class generic_wide_int<wide_int_ref_storage<true> >’ has no member named ‘val’
/path_to_gcc/gcc/wide-int.h: In function ‘bool wi::neg_p(const T&, signop) [with T = generic_wide_int<wide_int_ref_storage<true> >]’:
/path_to_gcc/gcc/wide-int.h:1759:   instantiated from ‘bool wi::lts_p(const T1&, const T2&) [with T1 = generic_wide_int<wi::extended_tree<192> >, T2 = generic_wide_int<wi::extended_tree<192> >]’
/path_to_gcc/gcc/tree.h:5013:   instantiated from here
/path_to_gcc/gcc/wide-int.h:1687: error: ‘class generic_wide_int<wide_int_ref_storage<true> >’ has no member named ‘sign_mask’
make[3]: *** [c/c-lang.o] Error 1
make[3]: Leaving directory `/d2/mypath/software/try_gcc/objdir/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/d2/mypath/software/try_gcc/objdir'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/d2/mypath/software/try_gcc/objdir'
make: *** [all] Error 2
gcc g++
1个回答
0
投票

unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE

在您的终端中运行此命令。你会得到它

© www.soinside.com 2019 - 2024. All rights reserved.