toolchain from below: http://autobuilder.yoctoproject.org/pub/nightly/20120919-2/toolchain/x86_64/poky-eglibc-x86_64-mips-toolchain-gmae-1.2+snapshot-20120919.sh steps below: 1.install toolchain to "/opt/poky/1.2+snapshot". 2.run "source /opt/poky/1.2+snapshot/environment-setup-mips32-poky-linux". 3.run "${CC} -o test test.c -lm" 4.run "qemu-mips /opt/poky/1.2+snapshot/sysroots/mips32-poky-linux/lib/ld.so.1 --library-path /opt/poky/1.2+snapshot/sysroots/mips32-poky-linux/lib:/opt/poky/1.2+snapshot/sysroots/mips32-poky-linux/usr/lib ./test" errors below: qemu: uncaught target signal 11 (Segmentation fault) - core dumped Segmentation fault (core dumped) run "file ./test",output below: ./test: ELF 32-bit MSB executable, MIPS, MIPS32 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70401, not stripped test.c below: #include <stdio.h> #include <math.h> double convert(long long l) { return (double)l;// or double(l) } int main(int argc, char * argv[]) { long long l = 10; double f; f = convert(l); printf("convert: %lld => %f\n", l, f); f = 1234.67; printf("floorf(%f) = %f\n", f, floorf(f)); return 0; } test env : host :ubuntu 12.04 x86_64 git info:52850f0fc6f801298413ee779834b346ef7f48d6 git branch: poky/1.3_M5
Do you happen to know if this is a regression? Did it work previously?
It looks like it's enough for the test.c file to contain an empty main() function and it still segfaults...
(In reply to comment #1) > Do you happen to know if this is a regression? Did it work previously? not regression,such error not met before.
error still exists in 1.3 M5 RC2 from: http://autobuilder.pokylinux.org/nightly/20120926-1/toolchain/x86_64/poky-eglibc-x86_64-mips-toolchain-gmae-1.2+snapshot-20120926.sh git info: 718eb85806e080d0b165344b272e531ef19421eb git branch: poky/1.3_M5
I isolated the issue doing a bisect on qemu repository and found that this issue was introduced by this commit: "linux-user: reserve 4GB of vmem for 32-on-64". Reverting it will make qemu-mips work again.
After some investigations, it looks like the problem is in the translated code and a MMU fault is generated in the virtual CPU. Somehow, a kernel address is accessed from user/supervisor mode or supervisor address from user mode and a MMU fault is triggered. Everything works fine however if the guest virtual address space is limited to 2GB...
Patch on the mailing list.
Patch merged: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=0d43dc75e4ddf9b8966429f41355cb2e8895d0e2
no such error to nightly build 20121003-4: http://autobuilder.yoctoproject.org/pub/nightly/20121003-4/toolchain/x86_64/poky-eglibc-x86_64-mips-toolchain-gmae-1.3.sh git info:86c9aa8081f107420cd3763d0566d779daddc2b1 git branch:poky/danny