qemu-i386 fails on system(3) with a cross-toolchain from Buildroot
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
qemu-i386 fails with small C program containing a system().
The C program is cross-compiled with a toolchain created by buildroot (http://
qemu version 1.2.0 (built with http://
host machine : Ubuntu 12.04 LTS on x86_64.
$ cat sys.c
#include <stdio.h>
#include <stdlib.h>
int main()
{
int ret = system("echo hello");
printf("%d\n", ret);
}
$ ../../host/
$ file sys
sys: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
$ ../../host/
-1
same problem with x86_64 :
$ ../../host/
$ file sys
sys: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
$ ../../host/
-1
works fine with arm :
$ ../../host/
$ file sys
sys: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
$ ../../host/
hello
0
works fine with mips :
$ ../../host/
$ file sys
sys: ELF 32-bit MSB executable, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, not stripped
$ ../../host/
hello
0
Looks like the long-standing "clone/fork for i386 user mode targets doesn't work" issue. See also discussion in bug 739785...