安装gcc及其依赖
来源:互联网 发布:淘宝300块的耐克 编辑:程序博客网 时间:2024/06/07 09:20
在gcc-4.8.2和gcc-4.1.2基础上编译gcc-5.2.0,有可能会遇到一些问题。
要想成功编译gcc,则在编译之前需要安装好它的至少以下三个依赖:
gmp
mpfr
mpc
而mpc又依赖gmp和mpfr。
1) 安装gmp
./configure --prefix=/usr/local/gmp-6.0.0
make
make install
2) 安装mpfr
./configure --prefix=/usr/local/mpfr-3.1.3
make
make install
3) 安装mpc
./configure --prefix=/usr/local/mpc-1.0.3 --with-gmp=/usr/local/gmp-6.0.0 --with-mpfr=/usr/local/mpfr-3.1.3
make
make install
为了成功的编译gcc,建议设置环境变量:
export LD_LIBRARY_PATH=/usr/local/mpc-1.0.3/lib:/usr/local/gmp-6.0.0/lib:/usr/local/mpfr-3.1.3/lib:$LD_LIBRARY_PATH
4) 安装gcc-5.2.0
./configure --prefix=/data/gcc-5.2.0 --with-mpfr=/usr/local/mpfr-3.1.3 --with-gmp=/usr/local/gmp-6.0.0 --with-mpc=/usr/local/mpc-1.0.3
make
make install
4) 安装gcc-4.8.2
./configure --prefix=/data/gcc-4.8.2 --with-mpfr=/usr/local/mpfr-3.1.3 --with-gmp=/usr/local/gmp-6.0.0 --with-mpc=/usr/local/mpc-1.0.3
make
make install
常见错误:
错误1)
configure: error: C compiler cannot create executables
请尝试设置下LD_LIBRARY_PATH后,再执行configure,再make:
export LD_LIBRARY_PATH=/usr/local/mpc-1.0.3/lib:/usr/local/gmp-6.0.0/lib:/usr/local/mpfr-3.1.3/lib:$LD_LIBRARY_PATH
错误2)
../.././libgcc/config/t-softfp:106: 在“else”指令之后含有不该出现的文字
../.././libgcc/config/t-softfp:113: *** 每个条件只能有一个“else”。 停止。
首先通过find命令找到t-softfp(注意是config目录下的t-softfp):
find . -name "t-softfp"
然后进入t-softfp的第106行:
vi ./libgcc/config/t-softfp
98 ifeq ($(enable_shared),yes)
99 $(call softfp_set_symver,__$(*F))
100 if grep strong_alias $(srcdir)/soft-fp/$@ > /dev/null; then \
101 alias=`grep strong_alias $(srcdir)/soft-fp/$@ | sed -e 's/.*, *//' -e 's/).*//'`; \
102 $(call softfp_set_symver,$$alias); \
103 fi
104 endif
105 echo '#endif' >> $@
106 else ifneq ($(softfp_wrap_start),)
107 softfp_file_list := $(addsuffix .c,$(softfp_func_list))
108
109 $(softfp_file_list):
110 echo $(softfp_wrap_start) > $@
111 echo '#include "soft-fp/$@"' >> $@
112 echo $(softfp_wrap_end) >> $@
113 else
114 softfp_file_list := \
115 $(addsuffix .c,$(addprefix $(srcdir)/soft-fp/,$(softfp_func_list)))
116 endif
将文件t-softfp的第106行变成两行:
else
ifneq ($(softfp_wrap_start),)
错误3)
../.././libgcc/config/t-softfp:144: *** 遗漏“endif”。 停止。
第144行已是文件t-softfp的最后一行:
139 LIB2FUNCS_EXCLUDE += \
140 $(addprefix _,$(foreach m,$(softfp_float_modes), \
141 $(foreach i,si di, \
142 $(softfp_floatint_funcs))))
143 endif
按照出错提示增加第144行:
143 endif
144 endif
错误4)使用gcc-4.1.2编译gcc-5.2.0时,遇到如下错误:
checking for suffix of object files... configure: error: in `/data/gcc-5.2.0/x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
依据错误提示,在config.log中找到如下一些信息:
| #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
| #error -static-libstdc++ not implemented
| #endif
这表示用于编译gcc-5.2.0的gcc版本偏低,至少需gcc-4.5版本。
要想成功编译gcc,则在编译之前需要安装好它的至少以下三个依赖:
gmp
mpfr
mpc
而mpc又依赖gmp和mpfr。
1) 安装gmp
./configure --prefix=/usr/local/gmp-6.0.0
make
make install
2) 安装mpfr
./configure --prefix=/usr/local/mpfr-3.1.3
make
make install
3) 安装mpc
./configure --prefix=/usr/local/mpc-1.0.3 --with-gmp=/usr/local/gmp-6.0.0 --with-mpfr=/usr/local/mpfr-3.1.3
make
make install
为了成功的编译gcc,建议设置环境变量:
export LD_LIBRARY_PATH=/usr/local/mpc-1.0.3/lib:/usr/local/gmp-6.0.0/lib:/usr/local/mpfr-3.1.3/lib:$LD_LIBRARY_PATH
4) 安装gcc-5.2.0
./configure --prefix=/data/gcc-5.2.0 --with-mpfr=/usr/local/mpfr-3.1.3 --with-gmp=/usr/local/gmp-6.0.0 --with-mpc=/usr/local/mpc-1.0.3
make
make install
4) 安装gcc-4.8.2
./configure --prefix=/data/gcc-4.8.2 --with-mpfr=/usr/local/mpfr-3.1.3 --with-gmp=/usr/local/gmp-6.0.0 --with-mpc=/usr/local/mpc-1.0.3
make
make install
常见错误:
错误1)
configure: error: C compiler cannot create executables
请尝试设置下LD_LIBRARY_PATH后,再执行configure,再make:
export LD_LIBRARY_PATH=/usr/local/mpc-1.0.3/lib:/usr/local/gmp-6.0.0/lib:/usr/local/mpfr-3.1.3/lib:$LD_LIBRARY_PATH
错误2)
../.././libgcc/config/t-softfp:106: 在“else”指令之后含有不该出现的文字
../.././libgcc/config/t-softfp:113: *** 每个条件只能有一个“else”。 停止。
首先通过find命令找到t-softfp(注意是config目录下的t-softfp):
find . -name "t-softfp"
然后进入t-softfp的第106行:
vi ./libgcc/config/t-softfp
98 ifeq ($(enable_shared),yes)
99 $(call softfp_set_symver,__$(*F))
100 if grep strong_alias $(srcdir)/soft-fp/$@ > /dev/null; then \
101 alias=`grep strong_alias $(srcdir)/soft-fp/$@ | sed -e 's/.*, *//' -e 's/).*//'`; \
102 $(call softfp_set_symver,$$alias); \
103 fi
104 endif
105 echo '#endif' >> $@
106 else ifneq ($(softfp_wrap_start),)
107 softfp_file_list := $(addsuffix .c,$(softfp_func_list))
108
109 $(softfp_file_list):
110 echo $(softfp_wrap_start) > $@
111 echo '#include "soft-fp/$@"' >> $@
112 echo $(softfp_wrap_end) >> $@
113 else
114 softfp_file_list := \
115 $(addsuffix .c,$(addprefix $(srcdir)/soft-fp/,$(softfp_func_list)))
116 endif
将文件t-softfp的第106行变成两行:
else
ifneq ($(softfp_wrap_start),)
错误3)
../.././libgcc/config/t-softfp:144: *** 遗漏“endif”。 停止。
第144行已是文件t-softfp的最后一行:
139 LIB2FUNCS_EXCLUDE += \
140 $(addprefix _,$(foreach m,$(softfp_float_modes), \
141 $(foreach i,si di, \
142 $(softfp_floatint_funcs))))
143 endif
按照出错提示增加第144行:
143 endif
144 endif
错误4)使用gcc-4.1.2编译gcc-5.2.0时,遇到如下错误:
checking for suffix of object files... configure: error: in `/data/gcc-5.2.0/x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
依据错误提示,在config.log中找到如下一些信息:
| #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
| #error -static-libstdc++ not implemented
| #endif
这表示用于编译gcc-5.2.0的gcc版本偏低,至少需gcc-4.5版本。
0 0
- 安装gcc及其依赖
- 安装gcc及其依赖
- python及其依赖安装
- gcc的依赖安装顺序
- gcc依赖安装(附带rzsz安装)
- 安装gcc时的依赖包
- linux安装gcc需要的依赖包
- redhad安装gcc问题---解决依赖问题
- Linux安装gcc软件的依赖关系
- RedHat安装GCC问题-解决依赖问题
- CentOS安装GCC--解决依赖问题
- centos安装ansible及其依赖包
- Windows下RQAlpha及其依赖的安装
- Linux系统安装GCC软件的依赖关系
- Fedora 20 yum利用缓存离线安装软件及其依赖
- linux 软件包 libqt4-opengl-dev 依赖关系详解,及其安装
- yum一次性下载安装包及其依赖包
- linux ubuntu下安装nginx及其依赖包
- 第一章:Mysql负载均衡与主从复制实验
- websocket 无法找到ws://localhost:8080/WebSocket/message
- oracle外键--详解
- 倒计时恢复按钮点击
- 【Oracle】DBLINK执行DDL,添加删除表
- 安装gcc及其依赖
- AppCan 2015年度TOP10开发者团队评选
- C# 获取CPU信息
- EBS事务处理对应的财务借贷关系
- [Android] ImageView.ScaleType设置图解
- ubuntu compile surfGPU
- 计算机地址分配
- 第一章:hadoop1-hdfs完全分布式模式实验
- xUtils框架的介绍