centos gcc卸载_Centos 降低Gcc版本

本文介绍了在CentOS 6.5系统上从GCC 4.4.6降至4.1.2的详细步骤,包括遇到的错误和解决方案。首先尝试修改源码支持4.1.2版本,然后通过yum安装texinfo和ncurses,解决编译错误。最终通过安装glibc-devel.i686并卸载高版本GCC,成功完成降级,并验证了GCC版本为4.1.2。
摘要由CSDN通过智能技术生成

GCC源版本:4.4.6

GCC目标版本:4.1.2

操作系统:CentOS release 6.5 (Final)

Kernel \r on an \m

tar -zxvf gcc-4.1.2.tar.bz2

cd gcc-4.1.2

./configure --prefix=/Disk/gcc

make

报错:

WARNING: `makeinfo‘ is missing on your system.  You should only need it if

you modified a `.texi‘ or `.texinfo‘ file, or any other file

indirectly affecting the aspect of the manual.  The spurious

call might also be the consequence of using a buggy `make‘ (AIX,

DU, IRIX).  You might want to install the `Texinfo‘ package or

the `GNU make‘ package.  Grab either from any GNU archive site.

解决办法:

a.网上都说是修改源码支持4.1.2版本

configure文件中texinfo对该版本不支持,可以在解压gcc4.1.2文件夹中的configure文件里找到以下语句

# For an installed makeinfo, we require it to be from texinfo 4.2 or

# higher, else we use the "missing" dummy.

if ${MAKEINFO} --version \

| egrep ‘texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])‘ >/dev/null 2>&1; then

:

else

MAKEINFO="$MISSING makeinfo"

fi

;;

其中4\.[2-9]|[5-9]表示的是支持4.2-4.9之间的几个版本,所以需要自己添加4\.[1-9][0-9]*,以支持4.1版本。

即把‘texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])‘编辑成‘texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|4\.[1-9][0-9]*|[5-9])‘后保存,编译通过。

-->但尝试之后失败

b.yum -y install texinfo

yum -y install ncurses

c.继续报错

/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: 没有那个文件或目录

make[4]: *** [32/crtbegin.o] 错误 1

make[4]: Leaving directory `/Disk/gcc_source/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc‘

make[3]: *** [extra32] 错误 2

make[3]: Leaving directory `/Disk/gcc_source/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc‘

make[2]: *** [stmp-multilib] 错误 2

make[2]: Leaving directory `/Disk/gcc_source/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc‘

make[1]: *** [all-gcc] 错误 2

make[1]: Leaving directory `/Disk/gcc_source/gcc-4.1.2‘

make: *** [all] 错误 2

解决办法:

yum -y install glibc-devel.i686

make install

yum remove gcc 卸载yum安装的高版本gcc

ln -s /usr/local/bin/gcc /usr/bin/gcc

[root@GHCLC6X-4354 bin]# gcc -v

Using built-in specs.

Target: x86_64-unknown-linux-gnu

Configured with: ./configure --prefix=/Disk/gcc

Thread model: posix

gcc version 4.1.2

gcc 降级成功

本文出自 “精忠报国” 博客,谢绝转载!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值