开始编译qemu 0.9.1时碰到提示
WARNING: "gcc" looks like gcc 4.x
Looking for gcc 3.x
gcc 3.x not found!
QEMU is known to have problems when compiled with gcc 4.x
It is recommended that you use gcc 3.x to build QEMU
To use this compiler anyway, configure with --disable-gcc-check
跳过gcc检查,运行make,真的出错了。
gcc -Wall -O2 -g -fno-strict-aliasing -I. -I.. -I/home/harry/workroom/opensource/qemu/qemu-0.9.1/target-i386 -I/home/harry/workroom/opensource/qemu/qemu-0.9.1 -MMD -MP -DNEED_CPU_H -I/home/harry/workroom/opensource/qemu/qemu-0.9.1/linux-user -I/home/harry/workroom/opensource/qemu/qemu-0.9.1/linux-user/i386 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/home/harry/workroom/opensource/qemu/qemu-0.9.1/fpu -DHAS_AUDIO -DHAS_AUDIO_CHOICE -I/home/harry/workroom/opensource/qemu/qemu-0.9.1/slirp -c -o main.o /home/harry/workroom/opensource/qemu/qemu-0.9.1/linux-user/main.c
/tmp/ccqswCUi.s: Assembler messages:
/tmp/ccqswCUi.s:2218: Error: can't resolve `.rodata' {.rodata section} - `.Ltext0' {.text section}
/tmp/ccqswCUi.s:2219: Error: can't resolve `.rodata' {.rodata section} - `.Ltext0' {.text section}
按照
http://jim19770812.blogspot.com/2009/02/ubuntugcc.html用apt-get安装gcc3.4,然后用
update-alternatives工具来改变符号链接
=================================================================================
sudo apt-get install gcc-3.4
看一下当前安装的gcc的各个版本
harry@harry-ubuntu:qemu$ ls /usr/bin/gcc* -l
lrwxrwxrwx 1 root root 21 2009-02-10 17:24 /usr/bin/gcc -> /etc/alternatives/gcc
-rwxr-xr-x 1 root root 85552 2008-05-08 18:04 /usr/bin/gcc-3.4
-rwxr-xr-x 1 root root 193372 2008-10-11 03:41 /usr/bin/gcc-4.2
-rwxr-xr-x 1 root root 16090 2008-05-08 17:58 /usr/bin/gccbug-3.4
-rwxr-xr-x 1 root root 2018 2007-06-05 08:59 /usr/bin/gccmakedep
增加gcc3.4.6和gcc4.3.2可选项
qemu$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.2 40
qemu$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-3.4 30
切换版本到gcc-3.4
qemu$ sudo update-alternatives --config gcc
现有 2 个可选项,它们都提供了“gcc”<
选择 可选项
-----------------------------------------------
1 /usr/bin/gcc-3.4
*+ 2 /usr/bin/gcc-4.2
要维持缺省值[*],按回车键,或者键入选择的编号:1
使用“/usr/bin/gcc-3.4”来提供“gcc”。
ok,现在gcc就切换到了3.4了。
查看一下gcc/cc版本
===================================================================================
然后重新编译qemu即可
不明白的是在这里生成的config-host.h中,CPU被识别成了I386,而前面提到在android的qemu中则被识别成了I686,难道这是因为用了不同的gcc版本?抑或是android的检测方式和qemu不一致,或者由于qemu的版本问题?先不管了。
阅读(2804) | 评论(0) | 转发(0) |