Openmoko under QEMU on Gentoo

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(IMPORTANT)
(Using Manual Setup)
Line 51: Line 51:
 
</pre>
 
</pre>
  
Once you've got a valid install of gcc3.4 activate it with the following:
 
  
<pre>
+
You don't need to use gcc-config to switch the default compiler to gcc-3 - Qemu should find there right version if it's installed.
# gcc-config x86_64-pc-linux-gnu-3.4.6
+
# source /etc/profile
+
</pre>
+
 
+
Your system will now be using the gcc 3.4.6 compiler. Its probably best if you don't emerge anything else until you're done compiling qemu and can set it back.
+
  
 
Now continue with the ./configure and make sections from the main article, then reset your system to the previous gcc compiler using the gcc-config command again.
 
Now continue with the ./configure and make sections from the main article, then reset your system to the previous gcc compiler using the gcc-config command again.
Line 66: Line 60:
 
# make
 
# make
  
# gcc-config x86_64-pc-linux-gnu-4.1.2
 
# source /etc/profile
 
 
</pre>
 
</pre>
  

Revision as of 21:27, 22 June 2008

IMPORTANT

As noted in http://docs.openmoko.org/trac/ticket/1093

It is confirmed by upstream: gentoo's 3.4.6 doesn't build qemu on 32-bit x86. A gcc developer (Paul Brook) said gentoo's gcc "is broken" and nothing can be done outside gentoo. Please use

# emerge -va =sys-devel/gcc-3.3.6-r1

Introduction

This page is aimed at Gentoo users new to the OpenMoko project who're trying to get the QEMU emulator up and running and do some development for the project. The basic process to do this is described at OpenMoko_under_QEMU however there are a number of Gentoo specific steps, not all of which are immediately obvious. This page obviously draws heavily from the main OpenMoko_under_QEMU page and you should check that page for most of the details as it is more likely to be updated

The ultimate aim of this article is to get a good Gentoo process set out which can then be used as the basis for an ebuild. Ideally this would incorporate the Neo1973 qemu files into the normal Gentoo qemu build.

Using Manual Setup

Fetch the source from Subversion as described in the main article. Before performing the configure step we need to emerge a few dependencies.

emerge -va libsdl lynx netpbm

(more dependencies to be added here)

Unfortunately qemu won't compile with gcc4.x so we need to temporarily switch to a gcc3.4 compiler. You can check the available gcc installs by using gcc-config -l. If the output lists a valid gcc3.4 compiler then you can skip the next install, but most people will probably see output similar to this:

# gcc-config -l
 [1] x86_64-pc-linux-gnu-4.1.2 *

If you don't have an entry in the list for gcc3.4 then you'll have to emerge the compiler using:

# emerge -va =sys-devel/gcc-3.4.6-r2
...
...
# gcc-config -l
 [1] x86_64-pc-linux-gnu-3.4.6
 [2] x86_64-pc-linux-gnu-3.4.6-hardened
 [3] x86_64-pc-linux-gnu-3.4.6-hardenednopie
 [4] x86_64-pc-linux-gnu-3.4.6-hardenednopiessp
 [5] x86_64-pc-linux-gnu-3.4.6-hardenednossp
 [6] x86_64-pc-linux-gnu-4.1.2 *


You don't need to use gcc-config to switch the default compiler to gcc-3 - Qemu should find there right version if it's installed.

Now continue with the ./configure and make sections from the main article, then reset your system to the previous gcc compiler using the gcc-config command again.

# ./configure --target-list=arm-softmmu  # GCC 3.x will be required, see --cc=
# make

Once you've completed the rest of the instructions set out in the main article you should have a qemu Neo1973 emulator which you can run with something similar to: arm-softmmu/qemu-system-arm -M neo -m 130 -mtdblock openmoko/openmoko-flash.image -kernel openmoko/openmoko-kernel.bin -usb -show-cursor -snapshot -usbdevice keyboard

Personal tools

IMPORTANT

As noted in http://docs.openmoko.org/trac/ticket/1093

It is confirmed by upstream: gentoo's 3.4.6 doesn't build qemu on 32-bit x86. A gcc developer (Paul Brook) said gentoo's gcc "is broken" and nothing can be done outside gentoo. Please use

# emerge -va =sys-devel/gcc-3.3.6-r1

Introduction

This page is aimed at Gentoo users new to the OpenMoko project who're trying to get the QEMU emulator up and running and do some development for the project. The basic process to do this is described at OpenMoko_under_QEMU however there are a number of Gentoo specific steps, not all of which are immediately obvious. This page obviously draws heavily from the main OpenMoko_under_QEMU page and you should check that page for most of the details as it is more likely to be updated

The ultimate aim of this article is to get a good Gentoo process set out which can then be used as the basis for an ebuild. Ideally this would incorporate the Neo1973 qemu files into the normal Gentoo qemu build.

Using Manual Setup

Fetch the source from Subversion as described in the main article. Before performing the configure step we need to emerge a few dependencies.

emerge -va libsdl lynx netpbm

(more dependencies to be added here)

Unfortunately qemu won't compile with gcc4.x so we need to temporarily switch to a gcc3.4 compiler. You can check the available gcc installs by using gcc-config -l. If the output lists a valid gcc3.4 compiler then you can skip the next install, but most people will probably see output similar to this:

# gcc-config -l
 [1] x86_64-pc-linux-gnu-4.1.2 *

If you don't have an entry in the list for gcc3.4 then you'll have to emerge the compiler using:

# emerge -va =sys-devel/gcc-3.4.6-r2
...
...
# gcc-config -l
 [1] x86_64-pc-linux-gnu-3.4.6
 [2] x86_64-pc-linux-gnu-3.4.6-hardened
 [3] x86_64-pc-linux-gnu-3.4.6-hardenednopie
 [4] x86_64-pc-linux-gnu-3.4.6-hardenednopiessp
 [5] x86_64-pc-linux-gnu-3.4.6-hardenednossp
 [6] x86_64-pc-linux-gnu-4.1.2 *

Once you've got a valid install of gcc3.4 activate it with the following:

# gcc-config x86_64-pc-linux-gnu-3.4.6
# source /etc/profile

Your system will now be using the gcc 3.4.6 compiler. Its probably best if you don't emerge anything else until you're done compiling qemu and can set it back.

Now continue with the ./configure and make sections from the main article, then reset your system to the previous gcc compiler using the gcc-config command again.

# ./configure --target-list=arm-softmmu  # GCC 3.x will be required, see --cc=
# make

# gcc-config x86_64-pc-linux-gnu-4.1.2
# source /etc/profile

Once you've completed the rest of the instructions set out in the main article you should have a qemu Neo1973 emulator which you can run with something similar to: arm-softmmu/qemu-system-arm -M neo -m 130 -mtdblock openmoko/openmoko-flash.image -kernel openmoko/openmoko-kernel.bin -usb -show-cursor -snapshot -usbdevice keyboard