Skip to contentSkip to conversation

qemu-ppc (user mode) and chroot

Qemu-devel Miklos Vajna 1 participant 2 messages Aug 19, 2008

lore
Share & tools
lore
#0 lore raw

Hello,

I recently found a mailing list post:

http://osdir.com/ml/emulators.qemu/2004-02/msg00162.html

That's exactly what I'm trying to set up.

I have a ppc chroot on an x86 machine - both Linux, with nptl-enabled glibc.

I'm trying to run the following test app:

#include <stdio.h>
#include <unistd.h>

int main()
{
int pid;
pid = fork();
printf("child is %d\n", pid);
if (pid == -1)
perror("fork() failed");
return 0;
}

When I link this statically to a linuxthreads-enabled libc on ppc, then I can run this using qemu-ppc without any problem:

$ sudo chroot . /qemu-ppc /hello-static
child is 0
child is 29207

However, when I link it dynamically (so it will use the nptl-enabled libc from the chroot), I get:

$ sudo chroot . /qemu-ppc /hello
child is -1
fork() failed: Invalid argument

and yes, I just checked, when I run the same dynamic executable on a real ppc, it works just fine, so I think this is a bug in qemu.

I tried qemu-0.9.1 and svn trunk, with the same results.

Is this a known issue?

Thanks!

#1 lore raw
Quoted 2 lines · Miklos Vajna

I have a ppc chroot on an x86 machine - both Linux, with nptl-enabled glibc.

Ah, forgot to mention that the kernel is a 2.6 one, with nptl support (same for the real ppc machine), so the lack of kernel support can't be a problem.

Thanks!