ubuntu中编译linux-0.11因为gcc版本问题可能会出现一下错误
命令:make all
结果:
as86 -0 -a -o boot/bootsect.o boot/bootsect.s
ld86 -0 -s -o boot/bootsect boot/bootsect.o
as86 -0 -a -o boot/setup.o boot/setup.s
ld86 -0 -s -o boot/setup boot/setup.o
gcc-3.4 -m32 -g -I./include -traditional -c boot/head.s
make: gcc-3.4: Command not found
Makefile:62: recipe for target 'boot/head.o' failed
make: *** [boot/head.o] Error 127
原因是系统默认使用更高版本的gcc,即使卸载再下载也不能使用低版本,下面是解决方法。
需要工具:新立得软件管理器、gcc3.4的安装包(我所需要的版本)
1.下载新立得软件管理器:sudo apt-get install synaptic
2.gcc3.4:http://old-releases.ubuntu.com/ubuntu/pool/main/g/gcc-3.4/
需要下载三个文件,分别是
cpp-3.4_3.4.6-6ubuntu2_amd64.deb
gcc-3.4-base_3.4.6-6ubuntu2_amd64.deb
gcc-3.4_3.4.6-6ubuntu2_amd64.deb
文件很多,不要下错