从源代码生成gcc 5.4.0时出错

从源代码生成gcc 5.4.0时出错,gcc,g++,Gcc,G++,在我运行make之前,一切都正常。我遇到了成百行的错误消息,我不知道会发生什么。一些错误消息如下所示: 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 ./c

在我运行
make
之前,一切都正常。我遇到了成百行的错误消息,我不知道会发生什么。一些错误消息如下所示:

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
/path\u to\u gcc/gcc/hwint.h:74:错误:“HOST\u WIDE\u INT”未命名类型
/路径\u到\u gcc/gcc/hwint.h:157:错误:在“x”之前应为“,”或“…”
/路径_到_gcc/gcc/hwint.h:在函数“int clz_hwi(unsigned int)”中:
/路径\u到\u gcc/gcc/hwint.h:159:错误:未在此作用域中声明“x”
/路径\u到\u gcc/gcc/hwint.h:在全局范围内:
/路径\u到\u gcc/gcc/hwint.h:171:错误:在“x”之前应为“,”或“…”
/路径_到_gcc/gcc/hwint.h:在函数“int-ctz_-hwi(unsigned int)”中:
/路径\u到\u gcc/gcc/hwint.h:232:错误:“主机\u宽\u INT”未命名类型
/路径\u到\u gcc/gcc/hwint.h:233:错误:“主机\u宽\u INT”未命名类型
/路径\u到\u gcc/gcc/hwint.h:234:错误:“主机\u宽\u INT”未命名类型
/路径\u到\u gcc/gcc/vec.h:305:错误:“收集\u统计信息”未在此范围内声明
/路径_到_gcc/gcc/vec.h:在静态成员函数“static void va_heap::release(vec*&)”中:
/路径_to_gcc/gcc/tree.h:4723:error:expected')在“;”之前代币
/路径\u到\u gcc/gcc/wide-int.h:1930:错误:“类泛型\u wide\u int”没有名为“val”的成员
/路径\u到\u gcc/gcc/wide-int.h:1930:错误:“类泛型\u wide\u int”没有名为“val”的成员
/路径_至_gcc/gcc/wide-int.h:在函数'bool wi::neg_p(const T&,signop)[with T=generic_-wide_-int]'中:
/路径\u到\u gcc/gcc/wide-int.h:1759:从'bool wi::lts\u p(常数T1&,常数T2&)[T1=generic\u wide\u int,T2=generic\u wide\u int]实例化'
/路径\u到\u gcc/gcc/tree.h:5013:从此处实例化
/路径\u到\u gcc/gcc/wide-int.h:1687:错误:“类generic\u wide\u int”没有名为“sign\u mask”的成员
生成[3]:***[c/c-lang.o]错误1
make[3]:离开目录“/d2/mypath/software/try\u gcc/objdir/gcc”
生成[2]:***[all-stage1-gcc]错误2
make[2]:离开目录“/d2/mypath/software/try\u gcc/objdir”
生成[1]:***[stage1气泡]错误2
make[1]:离开目录“/d2/mypath/software/try\u gcc/objdir”
make:**[全部]错误2

GCC需要在其源代码树之外构建。您不仅需要下载,还需要构建先决条件。顺便说一句,最新的GCC是GCC7,而不是5。4@BasileStarynkevitch哦我会尝试一下。如果您遇到一些问题,请显示所有命令和更多错误消息。顺便说一句,这可能是一个更好的询问的地方,您需要提供更多详细信息(例如,在哪个操作系统和计算机上)有900多行错误消息。我将首先尝试将gcc安装到另一个路径。您当然需要先构建依赖项。在
configure
命令中使用
$PWD
是可疑的(最好使用绝对路径),需要在其源代码树之外构建GCC。您不仅需要下载,还需要构建先决条件。顺便说一句,最新的GCC是GCC7,而不是5。4@BasileStarynkevitch哦我会尝试一下。如果您遇到一些问题,请显示所有命令和更多错误消息。顺便说一句,这可能是一个更好的询问的地方,您需要提供更多详细信息(例如,在哪个操作系统和计算机上)有900多行错误消息。我将首先尝试将gcc安装到另一个路径。您当然需要先构建依赖项。在
configure
命令中使用
$PWD
是可疑的(最好使用绝对路径)
/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