码迷,mamicode.com
首页 > 其他好文 > 详细

centos6.4 gcc降级至4.1.2过程

时间:2014-08-23 15:12:40      阅读:279      评论:0      收藏:0      [点我收藏+]

标签:http   os   使用   io   strong   文件   for   ar   div   

安装tfs,需要gcc-4.1.2版本的,我的centos6.4 是4.7版本它编译不了,很奇怪。下面是gcc-4.1.2的安装。
 

解包:tar -xjf gcc-4.1.2.tar.bz2

进入目录:cd gcc-4.1.2

# ./configure && 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.
make[3]: *** [fastjar.info] 错误 1
make[3]:正在离开目录 `/home/ssm/gcc-obj/fastjar‘
make[2]: *** [all] 错误 2
make[2]:正在离开目录 `/home/ssm/gcc-obj/fastjar‘
make[1]: *** [all-fastjar] 错误 2
make[1]:正在离开目录 `/home/ssm/gcc-obj‘
make: *** [all] 错误 2

(主要原因是GCC的版本过高)

出现此错误的原因也在于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.2版本。即把’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])’后保存,编译

接着又报错:

/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h:

参考:http://stackoverflow.com/questions/7412548/gnu-stubs-32-h-no-such-file-or-directory

On Ubuntu it‘s called libc6-dev-i386 - do sudo apt-get install libc6-dev-i386. See below for extra instructions for Ubuntu 12.04.

On Red Hat distros, the package name is glibc-devel.i686 (Thanks to David Gardner‘s comment)

On CentOS 5.8, the package name is glibc-devel.i386 (Thanks to JimKleck‘s comment)

On CentOS 6.3, the package name is glibc-devel.i686.

On SLES it‘s called glibc-devel-32bit - do zypper in glibc-devel-32bit

so,   yum install glibc-devel.i686

继续编译 make

然后 make install

 

最后, 重启 ,即可(当时以为失败了,结果第二天打开时,亮瞎了双眼,尼玛)

[hadoop@luxury ~]$ gcc -v
使用内建 specs。
目标:x86_64-unknown-linux-gnu
配置为:./configure
线程模型:posix
gcc 版本 4.1.2

centos6.4 gcc降级至4.1.2过程

标签:http   os   使用   io   strong   文件   for   ar   div   

原文地址:http://www.cnblogs.com/luxiaorui/p/3931032.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!