Date: Fri, 28 Mar 2014 11:00:30 -0700 From: Sean Bruno <sbruno@ignoranthack.me> To: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: qemu-mips illegal instruction [was readelf: Error: /usr/lib/libc.a: failed to skip archive symbol table] Message-ID: <1396029630.1466.21.camel@powernoodle.corp.yahoo.com> In-Reply-To: <1395599440.67694.13.camel@powernoodle.corp.yahoo.com> References: <1395337352.7757.11.camel@powernoodle.corp.yahoo.com> <1395599440.67694.13.camel@powernoodle.corp.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--=-PndviJJk1F88OPligJhj Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > This problem seems to be caused by a endian issue in qemu-mips. Ed > Maste found the culprit and I've applied it here: >=20 > https://github.com/seanbruno/qemu/commit/05ee8495804599b52a88eb36b13ea9c0= 6b3207cd >=20 > Which is my combined tracking branch for qemu and sson's bsd-user > branch. >=20 > I'm currently tracking an "illegal instruction" on exit issue that seems > to happen on application exit causing a crash. >=20 > sean I've been tracking qemu upstream with sson's patches and massaging things here and there with the bsd-user mode qemu. https://github.com/seanbruno/qemu/tree/bsd-user That in combination with sson's kernelmod/userland tool allows me to "chroot" into a mips environment suitable for building packages. http://people.freebsd.org/~sson/imgact_binmisc/imgact_binmisc.diff Currently, if I explicitly pass a shell into the chroot command, I have no issues and all is well. e.g. chroot /mipsbuild /bin/sh If I do not explicitly pass a shell, I get an illegal instruction core dump from qemu-mips on exit from any command I run in the chroot: chroot /mipsbuild uname -a <uname output> (Illegal Instruction)[coredump] This breaks poudriere right now. More or less this is my recipe: - built a mips32 world for "chroot" purposes: - use sson's binmisc ELF interceptor thing: - run binmiscctl: binmiscctl add mips32 --interpreter "/bin/qemu-mips" --magic "\x7f\x45 \x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00 \x08" --mask "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff \xff\xff\xff\xfe\xff\xff" --size 20 --set-enabled - chroot /mipsbuild - uname -a (Illegal Instruction and coredump ON EXIT) - chroot /mipsbuild /bin/sh - uname -a (works everytime) sean --=-PndviJJk1F88OPligJhj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJTNbi+AAoJEBkJRdwI6BaHXo4H/2CZt/ot9MHTI3f47Ah3PTBL giK7x5gvJzkNHDGXrXeerN36b7e7A05LAQwWVfTCVqSXUeof0G8UoxERmvOD2Xc6 JtcAq3zwG3yMYV81kO6aoQL86d/KcjfR/IX8yzVYy38BORjt13GpiAnZ7FN8/Meg 9s7qVgDP3iS+kxnodBpOHGgmYsidB+Kl59zRafSAe0K/yTdNtF43qHudOcryRGTy vC5P7qbjPo5n52EGpShwYuxR6AkeNkwmR7rS+u2XNzNJ0guuObXimGYIQAUUREQP a0NhmHzRxf7w6FbhF/54un+GxOhHiAAafgbUab8/ikIpteypuDzhI8beDgY3SRU= =Gb/U -----END PGP SIGNATURE----- --=-PndviJJk1F88OPligJhj--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1396029630.1466.21.camel>