HOWTO: Qemu with gcc 4

From Gentoo Linux Wiki

Jump to: navigation, search
This page is a candidate for deletion 
Reason given: This page can be deleted as the correct way was just merged with HOWTO: Qemu. Infirit 11:53, 16 October 2006 (GMT+1)
If you disagree with its deletion, please explain why on its discussion page.
If you intend to fix it, please remove this notice, but do not remove this notice from articles that you have created yourself.
Make sure no other pages link here and check the page's history before deleting.

[edit] Using the correct way with gcc-config

It is best done with the below rather than do it manually.

emerge =gcc-3.4.6*

And now switch compiler with gcc-config

gcc-config your-arch-pc-linux-gnu-3.4.6
source /etc/profile

And emerge the qemu packages. When done switch back to gcc 4 with

gcc-config x86_64-pc-linux-gnu-4.1.1

For some people, there are build problems with gcc version 3.4.6. Version 3.3.6 is required, which is masked.

ACCEPT_KEYWORD="~your-arch" emerge =gcc-3.3.6*

Switch compilers as above.

[edit] The wrong manual way

This is a small howto get qemu running with gcc 4 installed.

Please feel free to add. This is not a nice way of doing it but it works. Emerge will have no idear that this is installed so it is wise to keep everything in one directory. Further keep track of http://packages.gentoo.org/search/?sstring=qemu

This only describes the way howto do it with quemu not kqemu I had huge problems doing it with kqemu.

1. You want to get gcc 3. So download it from http://gcc.gnu.org/mirrors.html

2. Create a directory where you want to build quemu (in this example /qemu)

3. Untar gcc into this dir (man tar might be helpfull)

Code: untar
$ tar -xjf gcc-3.4.6.tar.bz2 -C /qemu/gcc/

4. cd into the gcc dir

Code: Tell make to build in this dir
$ ./configure --prefix=/qemu $ make install

7. now we should have gcc 3 installed in /qemu

8. test with /qemu/bin/gcc -v

9. now edit the PATH var with export PATH=/qemu/bin:$PATH

Code: export
$ export PATH=/qemu/bin:$PATH

10. now when you type gcc -v version 3 should show up

Code: gcc
$ gcc -v Reading specs from /qemu/bin/../lib/gcc/x86_64-unknown-linux-gnu/3.4.6/specs Configured with: ./configure --prefix=/qemu/ Thread model: posix gcc version 3.4.6


Remember now everything what you compile in this window will be compiled with version 3 of gcc

11. Now download qemu from http://fabrice.bellard.free.fr/qemu/download.html

12. untar this into /qemu

13. cd into the dir

14 .

Code: Tell make to build in this dir
$ ./configure --prefix=/qemu $ make install

16. You may have to emerge some packages. Please do not do this in this window otherwise it may conflict.

17. Now you should be able to start quemu with /qemu/bin/qemu

18. Please refer to the HOWTO: Qemu howto use Qemu

Personal tools