Skip to contentSkip to conversation

i386-linux-user on ARM host

Qemu-devel Gary Thomas 2 participants 4 messages Sep 8, 2009 – Sep 9, 2009

lore
Share & tools
lore
#0 lore raw

I've built the latest Qemu, running on ARM (OMAP3530) with i386-linux-user support. I built from .git because I couldn't get the cross compile setup to work at all using 0.11.0-rc2 :-(

Anyway, on a simple test it sort of works, but not quite right. I tried running 'ls'. Here's what I get via Qemu:

root@arm_target:~ qemu-i386 /testing/i386/ls -l /
total 24

drwxr-xr-x    2 996      996          4096 Nov 12  2007 etc
drwxr-xr-x    2 996      996          4096 Nov 12  2007 lib
drwxr-xr-x    4 996      996          4096 Apr 11  2003 usr

Here's what it should look like:
root@arm_target:~ ls -l /

drwxr-xr-x    2 996      996          4096 Jun 25 12:38 bin
drwxr-xr-x   11 root     root         3180 Jan  1  2000 dev
drwxr-xr-x    7 996      996          4096 Jun 10 17:43 etc
drwxrwxr-x    3 996      996          4096 Jun  4 19:56 home
-rwxrwxrwx    1 996      996           951 Aug 25 12:19 lcd_video
drwxrwxr-x    3 996      996          4096 Jun 10 22:33 lib
lrwxrwxrwx    1 996      996            12 Jun 25 12:38 linuxrc -> /bin/busybox
drwxr-xr-x    4 996      996          4096 Sep  8 16:02 local
drwxr-xr-x    2 996      996          4096 Jun  4 19:56 mnt
dr-xr-xr-x   41 root     root            0 Jan  1  1970 proc
drwx------    2 996      996          4096 Jun  4 19:56 root
drwxrwxr-x    2 996      996          4096 Aug  5 13:27 sbin
drwxr-xr-x   12 root     root            0 Jan  1  1970 sys
-rwxrwxrwx    1 996      996           884 Jul 30 16:45 test_tv
-rwxrwxrwx    1 996      996           884 Jun  8 15:05 test_tv~
drwxrwxr-x    4 996      996          4096 Sep  8 18:16 testing
drwxrwxrwt    2 root     root           40 Jan  1  2000 tmp
-rwxrwxrwx    1 root     root          875 Aug  6 14:10 tv_video
-rwxrwxrwx    1 996      996           884 Aug  6 13:30 tv_video~
drwxrwxr-x    7 996      996          4096 Sep  8 16:05 usr
drwxr-xr-x    5 996      996          4096 Jun  4 19:56 var

Any ideas what's going on?

n.b. I tested this the other way around (x86 host, arm-linux-user) and it all seemed to work fine.

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#1 lore raw
Quoted 37 lines · Gary Thomas

I've built the latest Qemu, running on ARM (OMAP3530) with i386-linux-user support. I built from .git because I couldn't get the cross compile setup to work at all using 0.11.0-rc2 :-(

Anyway, on a simple test it sort of works, but not quite right. I tried running 'ls'. Here's what I get via Qemu:

root@arm_target:~ qemu-i386 /testing/i386/ls -l /
total 24
drwxr-xr-x 2 996 996 4096 Nov 12 2007 etc
drwxr-xr-x 2 996 996 4096 Nov 12 2007 lib
drwxr-xr-x 4 996 996 4096 Apr 11 2003 usr

Here's what it should look like:
root@arm_target:~ ls -l /
drwxr-xr-x 2 996 996 4096 Jun 25 12:38 bin drwxr-xr-x 11 root root 3180 Jan 1 2000 dev drwxr-xr-x 7 996 996 4096 Jun 10 17:43 etc drwxrwxr-x 3 996 996 4096 Jun 4 19:56 home -rwxrwxrwx 1 996 996 951 Aug 25 12:19 lcd_video drwxrwxr-x 3 996 996 4096 Jun 10 22:33 lib lrwxrwxrwx 1 996 996 12 Jun 25 12:38 linuxrc -> /bin/busybox drwxr-xr-x 4 996 996 4096 Sep 8 16:02 local drwxr-xr-x 2 996 996 4096 Jun 4 19:56 mnt dr-xr-xr-x 41 root root 0 Jan 1 1970 proc drwx------ 2 996 996 4096 Jun 4 19:56 root drwxrwxr-x 2 996 996 4096 Aug 5 13:27 sbin drwxr-xr-x 12 root root 0 Jan 1 1970 sys

(quoted diff) +0 -2
-rwxrwxrwx 1 996 996 884 Jul 30 16:45 test_tv
-rwxrwxrwx 1 996 996 884 Jun 8 15:05 test_tv~

drwxrwxr-x 4 996 996 4096 Sep 8 18:16 testing
drwxrwxrwt 2 root root 40 Jan 1 2000 tmp

(quoted diff) +0 -2
-rwxrwxrwx 1 root root 875 Aug 6 14:10 tv_video
-rwxrwxrwx 1 996 996 884 Aug 6 13:30 tv_video~

drwxrwxr-x 7 996 996 4096 Sep 8 16:05 usr
drwxr-xr-x 5 996 996 4096 Jun 4 19:56 var

Quoted 5 lines

Any ideas what's going on?

n.b. I tested this the other way around (x86 host, arm-linux-user) and it all seemed to work fine.

Belay that - my previous test that worked was 0.11.0-rc2

The version from .git is broken on all hosts :-(

Any ideas how to fix this or how to actually cross build using 0.11.0-rc2?

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#2 lore raw
Quoted 46 lines · Gary Thomas
Quoted 37 lines · Gary Thomas

I've built the latest Qemu, running on ARM (OMAP3530) with i386-linux-user support. I built from .git because I couldn't get the cross compile setup to work at all using 0.11.0-rc2 :-(

Anyway, on a simple test it sort of works, but not quite right. I tried running 'ls'. Here's what I get via Qemu:

root@arm_target:~ qemu-i386 /testing/i386/ls -l /
total 24
drwxr-xr-x 2 996 996 4096 Nov 12 2007 etc
drwxr-xr-x 2 996 996 4096 Nov 12 2007 lib
drwxr-xr-x 4 996 996 4096 Apr 11 2003 usr

Here's what it should look like:
root@arm_target:~ ls -l /
drwxr-xr-x 2 996 996 4096 Jun 25 12:38 bin drwxr-xr-x 11 root root 3180 Jan 1 2000 dev drwxr-xr-x 7 996 996 4096 Jun 10 17:43 etc drwxrwxr-x 3 996 996 4096 Jun 4 19:56 home -rwxrwxrwx 1 996 996 951 Aug 25 12:19 lcd_video drwxrwxr-x 3 996 996 4096 Jun 10 22:33 lib lrwxrwxrwx 1 996 996 12 Jun 25 12:38 linuxrc -> /bin/busybox drwxr-xr-x 4 996 996 4096 Sep 8 16:02 local drwxr-xr-x 2 996 996 4096 Jun 4 19:56 mnt dr-xr-xr-x 41 root root 0 Jan 1 1970 proc drwx------ 2 996 996 4096 Jun 4 19:56 root drwxrwxr-x 2 996 996 4096 Aug 5 13:27 sbin drwxr-xr-x 12 root root 0 Jan 1 1970 sys

(quoted diff) +0 -2
-rwxrwxrwx 1 996 996 884 Jul 30 16:45 test_tv
-rwxrwxrwx 1 996 996 884 Jun 8 15:05 test_tv~

drwxrwxr-x 4 996 996 4096 Sep 8 18:16 testing
drwxrwxrwt 2 root root 40 Jan 1 2000 tmp

(quoted diff) +0 -2
-rwxrwxrwx 1 root root 875 Aug 6 14:10 tv_video
-rwxrwxrwx 1 996 996 884 Aug 6 13:30 tv_video~

drwxrwxr-x 7 996 996 4096 Sep 8 16:05 usr
drwxr-xr-x 5 996 996 4096 Jun 4 19:56 var

Quoted 5 lines

Any ideas what's going on?

n.b. I tested this the other way around (x86 host, arm-linux-user) and it all seemed to work fine.

Belay that - my previous test that worked was 0.11.0-rc2

Quoted 4 lines

The version from .git is broken on all hosts :-(

Any ideas how to fix this or how to actually cross build using 0.11.0-rc2?

Sorry all, I've now figured out that it _does_ work, just not like I expected. It seems that without a -L option to qemu, the executed code runs in something like a 'chroot' jail. Is this the case? If so, is there any way to let the emulated program live in the same file system [space] as other applications?

The idea would be to be able to execute some program, e.g. something available as x86 only, on the ARM target and make the process as invisible as possible. Can this be made to work?

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#3 lore raw

On Wed, Sep 9, 2009 at 2:04 AM, Gary Thomas<[email protected]> wrote:
[...]

Quoted 10 lines

Sorry all, I've now figured out that it _does_ work, just not like I expected.  It seems that without a -L option to qemu, the executed code runs in something like a 'chroot' jail.  Is this the case?  If so, is there any way to let the emulated program live in the same file system [space] as other applications?

The idea would be to be able to execute some program, e.g. something available as x86 only, on the ARM target and make the process as invisible as possible.  Can this be made to work?

How would you handle shared libraries?

Laurent