[opensuse-arm] How does package "qemu-accel" work?
Hi, all. I have found that package "qemu-accel-armv7l-cross-arm" contains directory /emul/i586-for-arm/ with cross utilities that accelerate the build. Could you explain, how does this construction work? For example, there are 2 binaries in the chroot environemt: bash-4.2# file /usr/bin/make /usr/bin/make: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=0xe1ed5cff83cb3973a9b8ed363857cd796dba63cf, not stripped bash-4.2# file /emul/i586-for-arm/usr/bin/make /emul/i586-for-arm/usr/bin/make: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=0x90f51594906fdc9f7906c7e119ba8703a616d4b8, not stripped bash-4.2# whereis make make: /usr/bin/make /usr/share/man/man1/make.1.gz bash-4.2# LD_DEBUG=all make 2>&1 | tail -10 27438: binding file make [0] to /emul/i586-for-arm/lib/libc.so.6 [0]: normal symbol `exit' [GLIBC_2.0] 27438: symbol=ferror; lookup in file=make [0] 27438: symbol=ferror; lookup in file=/emul/i586-for-arm/lib/libc.so.6 [0] 27438: binding file make [0] to /emul/i586-for-arm/lib/libc.so.6 [0]: normal symbol `ferror' [GLIBC_2.0] 27438: symbol=fclose; lookup in file=make [0] 27438: symbol=fclose; lookup in file=/emul/i586-for-arm/lib/libc.so.6 [0] 27438: binding file make [0] to /emul/i586-for-arm/lib/libc.so.6 [0]: normal symbol `fclose' [GLIBC_2.1] 27438: 27438: calling fini: make [0] 27438: "whereis" says that "make" is taken from /usr/bin/, but ld.so says that it is taken from /emul/i586-for-arm/usr/bin/, so we have cross accelerated executable "make". How does this work? Best regards, Ilya Palachev -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
On 07/15/2014 01:45 PM, Ilya Palachev wrote:
Hi, all.
I have found that package "qemu-accel-armv7l-cross-arm" contains directory /emul/i586-for-arm/ with cross utilities that accelerate the build.
Could you explain, how does this construction work?
For example, there are 2 binaries in the chroot environemt:
bash-4.2# file /usr/bin/make /usr/bin/make: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=0xe1ed5cff83cb3973a9b8ed363857cd796dba63cf, not stripped bash-4.2# file /emul/i586-for-arm/usr/bin/make /emul/i586-for-arm/usr/bin/make: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=0x90f51594906fdc9f7906c7e119ba8703a616d4b8, not stripped bash-4.2# whereis make make: /usr/bin/make /usr/share/man/man1/make.1.gz bash-4.2# LD_DEBUG=all make 2>&1 | tail -10 27438: binding file make [0] to /emul/i586-for-arm/lib/libc.so.6 [0]: normal symbol `exit' [GLIBC_2.0] 27438: symbol=ferror; lookup in file=make [0] 27438: symbol=ferror; lookup in file=/emul/i586-for-arm/lib/libc.so.6 [0] 27438: binding file make [0] to /emul/i586-for-arm/lib/libc.so.6 [0]: normal symbol `ferror' [GLIBC_2.0] 27438: symbol=fclose; lookup in file=make [0] 27438: symbol=fclose; lookup in file=/emul/i586-for-arm/lib/libc.so.6 [0] 27438: binding file make [0] to /emul/i586-for-arm/lib/libc.so.6 [0]: normal symbol `fclose' [GLIBC_2.1] 27438: 27438: calling fini: make [0] 27438:
"whereis" says that "make" is taken from /usr/bin/, but ld.so says that it is taken from /emul/i586-for-arm/usr/bin/, so we have cross accelerated executable "make".
How does this work?
ARM binaries don't run natively on x86. So instead when we see an ARM binary, we execute a binfmt_misc handler instead. Our binfmt_misc handler (qemu-arm-binfmt) checks whether /emul/i586-for-arm/$0 exists. If it does, it executes that one. If it doesn't, it calls qemu-arm with $@. For the glorious details, check out https://github.com/openSUSE/qemu/blob/opensuse-2.1/linux-user/binfmt.c Alex -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Hi, again.. I have a problem during the build at build.tizen.org related with qemu-accel package. The cross build for armv7l architecture is based on qemu-accel package. It was imported from opensuse (some time ago). Now the problem is that packages in "armv7l" in our project is staying in "scheduled" state for a long time (while most of workers are in idle state) and this happens only package "qemu-accel" is based in current repository. If we use usual version of qemu-accel (without my modifications) packages begin to build. Can wrong build of "qemu-accel" package cause the obs scheduler to hang? Best regards, Ilya 15.07.2014, 16:00, "Alexander Graf" <agraf@suse.de>:
On 07/15/2014 01:45 PM, Ilya Palachev wrote:
Hi, all.
I have found that package "qemu-accel-armv7l-cross-arm" contains directory /emul/i586-for-arm/ with cross utilities that accelerate the build.
Could you explain, how does this construction work?
For example, there are 2 binaries in the chroot environemt:
bash-4.2# file /usr/bin/make /usr/bin/make: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=0xe1ed5cff83cb3973a9b8ed363857cd796dba63cf, not stripped bash-4.2# file /emul/i586-for-arm/usr/bin/make /emul/i586-for-arm/usr/bin/make: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=0x90f51594906fdc9f7906c7e119ba8703a616d4b8, not stripped bash-4.2# whereis make make: /usr/bin/make /usr/share/man/man1/make.1.gz bash-4.2# LD_DEBUG=all make 2>&1 | tail -10 27438: binding file make [0] to /emul/i586-for-arm/lib/libc.so.6 [0]: normal symbol `exit' [GLIBC_2.0] 27438: symbol=ferror; lookup in file=make [0] 27438: symbol=ferror; lookup in file=/emul/i586-for-arm/lib/libc.so.6 [0] 27438: binding file make [0] to /emul/i586-for-arm/lib/libc.so.6 [0]: normal symbol `ferror' [GLIBC_2.0] 27438: symbol=fclose; lookup in file=make [0] 27438: symbol=fclose; lookup in file=/emul/i586-for-arm/lib/libc.so.6 [0] 27438: binding file make [0] to /emul/i586-for-arm/lib/libc.so.6 [0]: normal symbol `fclose' [GLIBC_2.1] 27438: 27438: calling fini: make [0] 27438:
"whereis" says that "make" is taken from /usr/bin/, but ld.so says that it is taken from /emul/i586-for-arm/usr/bin/, so we have cross accelerated executable "make".
How does this work?
ARM binaries don't run natively on x86. So instead when we see an ARM binary, we execute a binfmt_misc handler instead. Our binfmt_misc handler (qemu-arm-binfmt) checks whether /emul/i586-for-arm/$0 exists. If it does, it executes that one. If it doesn't, it calls qemu-arm with $@.
For the glorious details, check out
https://github.com/openSUSE/qemu/blob/opensuse-2.1/linux-user/binfmt.c
Alex
-- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Sorry, the status was "scheduled", because tag "Hostarch: x86_64" was missing in Project config of that project. It does not deal with qemu-accel at all. ------------------------------------------------------------------------ *From:* Илья Палачев <palachev.ilya@yandex.ru> *Sent:* Wednesday, July 30, 2014 7:41PM *To:* Alexander Graf <agraf@suse.de>, Ilya Palachev *Cc:* opensuse-arm@opensuse.org <opensuse-arm@opensuse.org> *Subject:* Re: [opensuse-arm] How does package "qemu-accel" work? Hi, again.. I have a problem during the build at build.tizen.org related with qemu-accel package. The cross build for armv7l architecture is based on qemu-accel package. It was imported from opensuse (some time ago). Now the problem is that packages in "armv7l" in our project is staying in "scheduled" state for a long time (while most of workers are in idle state) and this happens only package "qemu-accel" is based in current repository. If we use usual version of qemu-accel (without my modifications) packages begin to build. Can wrong build of "qemu-accel" package cause the obs scheduler to hang? Best regards, Ilya 15.07.2014, 16:00, "Alexander Graf" <agraf@suse.de>:
On 07/15/2014 01:45 PM, Ilya Palachev wrote:
Hi, all.
I have found that package "qemu-accel-armv7l-cross-arm" contains directory /emul/i586-for-arm/ with cross utilities that accelerate the build.
Could you explain, how does this construction work?
For example, there are 2 binaries in the chroot environemt:
bash-4.2# file /usr/bin/make /usr/bin/make: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=0xe1ed5cff83cb3973a9b8ed363857cd796dba63cf, not stripped bash-4.2# file /emul/i586-for-arm/usr/bin/make /emul/i586-for-arm/usr/bin/make: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=0x90f51594906fdc9f7906c7e119ba8703a616d4b8, not stripped bash-4.2# whereis make make: /usr/bin/make /usr/share/man/man1/make.1.gz bash-4.2# LD_DEBUG=all make 2>&1 | tail -10 27438: binding file make [0] to /emul/i586-for-arm/lib/libc.so.6 [0]: normal symbol `exit' [GLIBC_2.0] 27438: symbol=ferror; lookup in file=make [0] 27438: symbol=ferror; lookup in file=/emul/i586-for-arm/lib/libc.so.6 [0] 27438: binding file make [0] to /emul/i586-for-arm/lib/libc.so.6 [0]: normal symbol `ferror' [GLIBC_2.0] 27438: symbol=fclose; lookup in file=make [0] 27438: symbol=fclose; lookup in file=/emul/i586-for-arm/lib/libc.so.6 [0] 27438: binding file make [0] to /emul/i586-for-arm/lib/libc.so.6 [0]: normal symbol `fclose' [GLIBC_2.1] 27438: 27438: calling fini: make [0] 27438:
"whereis" says that "make" is taken from /usr/bin/, but ld.so says that it is taken from /emul/i586-for-arm/usr/bin/, so we have cross accelerated executable "make".
How does this work? ARM binaries don't run natively on x86. So instead when we see an ARM binary, we execute a binfmt_misc handler instead. Our binfmt_misc handler (qemu-arm-binfmt) checks whether /emul/i586-for-arm/$0 exists. If it does, it executes that one. If it doesn't, it calls qemu-arm with $@.
For the glorious details, check out
https://github.com/openSUSE/qemu/blob/opensuse-2.1/linux-user/binfmt.c
Alex
-- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
-- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
participants (3)
-
Alexander Graf
-
Ilya Palachev
-
Илья Палачев