qemu3.0.0: Linux on non x86 CPUs run x86 executable
Hi, everyone.
When I have installed the QEMU3.0.0 in the Linux on non X86 CPUS, I want to use user space emulator to run X86 executable. So I get the document from the QEMU web page (QEMU document) .
I find the section 5.3 and read the content. But I have some questions in the following:
(1)I can't understand the content: "On non x86 CPUs, you need first to download at least an x86 glibc (qemu-runtime-i386-XXX-.tar.gz on the QEMU web page). Ensure that LD_LIBRARY_PATH is not set:
unset LD_LIBRARY_PATH". How I get the X86 glibc? And How to use it? Compiling and installing it in the Linux on non X86 CPUS or not?
(2) I also haven't understood the content:"Then you can launch the precompiled ls x86 executable: qemu-i386 tests/i386/ls". The file of "ls x86 executable" is in the any Linux from the path "/bin/ls" on the X86 CPUS. Is that right? Please help me to resolve these questions. Thanks very much.
Quoted 7 lines · wj193102 <[email protected]> writes:
Hi, everyone.
When I have installed the QEMU3.0.0 in the Linux on non X86 CPUS, I want to use user space emulator to run X86 executable. So I get the document from the QEMU web page (QEMU document) .
I find the section 5.3 and read the content. But I have some questions in the following:
(1)I can't understand the content: "On non x86 CPUs, you need first to download at least an x86 glibc (qemu-runtime-i386-XXX-.tar.gz on the QEMU web page). Ensure thatLD_LIBRARY_PATHis not set:
unsetLD_LIBRARY_PATH". How I get the X86 glibc? And How to use it?
Compiling and installing it in the Linux on non X86 CPUS or
not?
The usual way is to create a chroot and install some x86 distro in there so that it can provide the requisite bits and pieces. The details vary depending on what chroot you want to setup.
I personally tend to use Debian as it has excellent architecture support. If you have a working docker setup you can even host your x86 userspace in a docker container which simplifies some aspects.
Quoted 4 lines
(2) I also haven't understood the content:"Then you can launch the precompiled ls x86 executable: qemu-i386 tests/i386/ls". The file of "ls x86 executable" is in the any Linux from the path "
/bin/ls" on the X86 CPUS. Is that right?
Yes. The very simplest case is a statically compiled binaries as you then don't need to worry about jumping hoops to get the dynamic linker working.
Quoted 1 line
Please help me to resolve these questions. Thanks very much.
If you just want to prove you have a working x86 emulation you can just build the tcg test cases:
cd i386-linux-user
make guest-tests
./qemu-i386 ./tests/linux-test
--
Alex Bennée