1、Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
缺少GMP 、MPFR 等依赖
解决办法:在解压的gcc目录执行,./contrib/download_prerequisites
2、no acceptable C compiler found in $PATH
系统未安装过gcc
解决办法:先使用yum命令安装gcc再使用压缩包安装
3、dereferencing pointer to incomplete type
解决办法:找到md-unwind-support.h位置
修改 struct ucontext *uc_ = context->cfa;
中的 ucontext
为 ucontext_t
:
struct ucontext_t *uc_ = context->cfa;
4、cfns.gperf:101:1: error: 'const char* libc_name_p(const char*, unsigned int)' redeclared inline
通过修改gcc源码解决。按照下面网页中的修改即可,+代表增加,-代表删除。主要修改cfns.gperf、cfns.h、except.c、Make-lang.in这几个文件。参考:
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=ec1cc0263f156f70693a62cf17b254a0029f4852