02.09.2019. 18.08, "Aleksandar Markovic" <aleksandar.m.m...@gmail.com> је написао/ла: > > > 02.09.2019. 06.17, "Libo Zhou" <zhl...@foxmail.com> је написао/ла: > > > > I am trying to run a simple MIPS program with QEMU user mode. > > > > > > > > Host: Ubuntu 18.04 LTS on x86_64 > > QEMU config: ../configure --target-list=mips-linux-user > > > > Cross Compiler: sudo apt install gcc-mips-linux-gnu > > > > > > My test.c is simple: int main(void) {int a = 1; int b =2; int c; c = a + b; return 0;} > > After compiling it with "mips-linux-gnu-gcc test.c -o test", I ran it with "./qemu-mips -L /usr/mips-linux-gnu test", then I got the following error message: > > qemu: uncaught target signal 11 (Segmentation fault) - core dumped > > > > > > Does anyone have a solution to this? Thank you in advance. > > > > Hi, Libo. > > Please try this: > > cd /usr/mips-linux-gnu > sudo mkdir etc > sudo ldconfig -c etc/ld.do.cache -r . > > ... and start qemu as you described. >
Or, unless you really need dynamicly linked executables, compile with "-static", and you will never need "-L" QEMU switch, and will never have the problem you described. > Sincerely, > Aleksandar > > > > > Cheers, > > Libo