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
本文介绍了在编译GCC时可能遇到的三个问题及解决方案:1) 如何解决缺少GMP、MPFR和MPC依赖;2) 如何处理找不到C编译器的问题,即通过yum安装gcc;3) 修复结构体指针类型不完整错误;4) 解决cfns.gperf等文件的编译冲突。提供了详细的修改步骤和参考链接。
990

被折叠的 条评论
为什么被折叠?



