c++ - GCC 5.2 cc1、cc1plus 错误

标签 c++ c gcc centos

我在为 CentOS 7 制作 GCC 5.2 时收到以下错误。我添加了一些文件以使其工作,libstdc++-devel、ccache 以及运行“下载先决条件”命令。以下是错误消息出现之前发生的情况。

 cp/cp-lang.o c-family/stub-objc.o cp/call.o cp/decl.o cp/expr.o cp/pt.o 
 cp/typeck2.o cp/class.o cp/decl2.o cp/error.o cp/lex.o cp/parser.o 
 cp/ptree.o cp/rtti.o cp/typeck.o cp/cvt.o cp/except.o cp/friend.o 
 cp/init.o cp/method.o cp/search.o cp/semantics.o cp/tree.o cp/repo.o 
 cp/dump.o cp/optimize.o cp/mangle.o cp/cp-objcp-common.o cp/name-lookup.o 
 cp/cxx-pretty-print.o cp/cp-cilkplus.o cp/cp-gimplify.o cp/cp-array-notation.o
 cp/lambda.o cp/vtable-class-hierarchy.o cp/constexpr.o cp/cp-ubsan.o
 attribs.o incpath.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o 
 c-family/c-format.o c-family/c-gimplify.o c-family/c-lex.o 
 c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o 
 c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o 
 c-family/c-cilkplus.o c-family/array-notation-common.o c-family/cilk.o 
 c-family/c-ubsan.o i386-c.o glibc-c.o cc1plus-checksum.o libbackend.a main.o  
 libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber
 /libdecnumber.a libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs
 /libbacktrace.a ../libiberty/libiberty.a 
 ../libdecnumber/libdecnumber.a   -lmpc -lmpfr -lgmp -rdynamic -ldl  -L../zlib -lz

编辑...(错误前处理)

collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
make[3]: *** [cc1plus] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [cc1] Error 1
make[3]: Leaving directory `/usr/local/gcc-5.2/gcc-5.2.0/objdir/gcc'
make[2]: *** [all-stage3-gcc] Error 2
make[2]: Leaving directory `/usr/local/gcc-5.2/gcc-5.2.0/objdir'
make[1]: *** [stage3-bubble] Error 2
make[1]: Leaving directory `/usr/local/gcc-5.2/gcc-5.2.0/objdir'
make: *** [all] Error 2

来自 config.log 文件(已添加)

 configure:5989: checking for compatible ISL
 configure:6002: gcc -msse2 -flto -fuse-linker-plugin -o conftest -g -O2
  -lisl conftest.c  -lisl >&5
 conftest.c:10:21: fatal error: isl/val.h: No such file or directory
 #include <isl/val.h>

通过Google进行了各种搜索,没有找到任何结果。大多数错误都有 cc1 错误的特定错误,而我的设置仅输出“离开目录”。查看 GCC 网页上的潜在错误没有发现任何结果。我已经使用以下设置设置了编译文件。感谢您的帮助。

/usr/local/gcc-5.2/gcc-5.2.0/configure --prefix=/usr/local/sbin/gcc-5.2.0
--enable-languages=c,c++  --disable-multilib 

最佳答案

我必须更改我的 ./configure 设置并读取 Linux from Scratch 。在 @iharob 的帮助下,我能够编译 GCC。以下是新的 ./configure 设置。

/usr/local/gcc-5.2/gcc-5.2.0/configure --prefix=/usr/local/gcc-5.2/gcc-5.2.0/objdir 
--enable-languages=c,c++ --enable-threads=posix --disable-multilib 
--disable-nls --disable-bootstrap LD_LIBRARY_PATH=/usr/local/lib

我可能不需要LD_LIBRARY_PATH标志,但我谨慎行事。

关于c++ - GCC 5.2 cc1、cc1plus 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32958394/

相关文章:

c++ - 奇怪的 unsigned char * concat 行为

c++ - 适用于 x86 的 OpenSolaris 的良好 C/C++ 编译器

c - 修改函数中的指针

c++ - 为什么在不相关的 #define 语句上包含 <windows.h> 会导致 "error: expected ' )' before numeric constant"

c - 为什么使用 getaddrinfo、node 为 NULL、ai_flags 为 PASSIVE 会导致 IP 地址不正确?

c - GCC 内联汇编 : constraint for direct memory reference

objective-c - 非 Mac OS X 平台是否支持 Objective-C 2.0 异常处理?

c++ - C++ 中的重载 lambda 以及 clang 和 gcc 之间的区别

c++ - Boost::signals2 传递无效数据

c++ - Qt/C++ - 从一行中读取一个字符