How to switch between gcc versions and install QEMU

I recently migrated my laptop to Gentoo Linux. I think it will serve me well as in introduction to inside of Linux and explore how things operate and build in there. But sometimes I have to work in Windows, for that I used QEMU.

It’s a great tool, however it needs to be compiled with gcc 3 while in the recent Gentoo Linux it comes with gcc-4.1.2.

So, first install gcc 3, type:

emerge =sys-devel/gcc-3.4.6* -av

You can take a look at your gcc config file and see your correct gcc 3 version and architecture in /etc/env.d/gcc folder

My laptop has i686-pc-linux-gnu-3.4.6 So I type:

gcc-config i686-pc-linux-gnu-3.4.6
Then update my profile:

source /etc/profile

Now, you might need to unmask these stuff, type in:

echo “app-emulation/qemu” >> /etc/portage/package.keywords
echo “app-emulation/qemu-user” >> /etc/portage/package.keywords
echo “app-emulation/qemu-softmmu” >> /etc/portage/package.keywords
echo “app-emulation/kqemu” >> /etc/portage/package.keywords

echo “>=app-emulation/qemu-0.8.2″ >> /etc/portage/package.mask
echo “>=app-emulation/qemu-user-0.8.2″ >> /etc/portage/package.mask
echo “>=app-emulation/qemu-softmmu-0.8.2″ >> /etc/portage/package.mask

If you want graphical output, enter the following in /etc/portage/package.use

app-emulation/qemu-softmmu sdl

So when you are ready, install QEMU by typing:

emerge qemu -av

QEMU is also helpful for Windows users to get to know Linux without really installing it on their PCs. It will run Linux inside your Windows. It gives you a chance to use Linux before migrating.

Comments

Leave a Reply

You must be logged in to post a comment.

Categories


Clicky Web Analytics