首页 > 代码库 > Centos 降低Gcc版本
Centos 降低Gcc版本
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 降级成功
本文出自 “精忠报国” 博客,谢绝转载!
Centos 降低Gcc版本