降低gcc版本

事情的起因

在编译linux0.11内核的时候,编译完成后在bochs上一直跑不起来,一直卡在 Loading System… 页面。正常的思路应该是改代码,让代码适应gcc。可是很遗憾我暂时还么有这个能力,只能让gcc版本来适应我的代码。
现象

事情的经过

1、环境准备
Centos6.8_x86
我的gcc版本
更新前的版本
目标版本gcc4.1.2

2、开始安装

tar jxvf gcc-4.1.2.tar.bz2
cd gcc-4.1.2
./configure --prefix=/usr/local/gcc-4.1.2 --enable-language=c,c++
make

ERROR1

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.

解决1

yum install texinfo
将gcc-4.1.2目录下的Makefile文件中的.../missing makeinfo改成/usr/bin/makeinfo
继续 make

10分钟后,编译完成

make install

3、配置
删除 /usr/bin 目录下的 cc,gcc,g++,cpp 并创建同名软连接到 /usr/local/gcc-4.1.2/bin 目录下的相应文件

mv gcc cc g++ cpp gcc_bak/
ln -s /usr/local/gcc-4.1.2/bin/gcc gcc
ln -s gcc cc
ln -s /usr/local/gcc-4.1.2/bin/g++ g++
ln -s /usr/local/gcc-4.1.2/bin/cpp cpp

4、gcc安装完成
更新后的gcc版本
更新后的gcc版本

事情的结果

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值