[opensuse-arm] Howto build package on arm@qemu
Hi, please add me in CC when replying as I am not subscribed I've miserably failed to build openjdk package via qemu for arm. I've followed the documentation https://en.opensuse.org/openSUSE:ARM_distribution_howto#How_to_work_on_openS... However armv6l build fails OSC_BUILD_ROOT=/var/tmp/build-root-qemu/ osc build --alternative-project=openSUSE:Factory:ARM qemu armv6l --clean [ 1s] [1/30] preinstalling filesystem... [ 1s] [2/30] preinstalling glibc... [ 1s] [3/30] preinstalling fillup... [ 1s] [4/30] preinstalling libattr1... [ 1s] [5/30] preinstalling libbz2-1... [ 1s] [6/30] preinstalling liblua5_1... [ 1s] [7/30] preinstalling liblzma5... [ 1s] [8/30] preinstalling libpcre1... [ 1s] [9/30] preinstalling libpopt0... [ 1s] [10/30] preinstalling libz1... [ 1s] [11/30] preinstalling attr... [ 1s] [12/30] preinstalling libacl1... [ 1s] [13/30] preinstalling libcap2... [ 1s] [14/30] preinstalling libselinux1... [ 1s] [15/30] preinstalling libncurses5... [ 1s] [16/30] preinstalling libreadline6... [ 1s] [17/30] preinstalling bash... [ 1s] [18/30] preinstalling qemu-linux-user... [ 2s] [19/30] preinstalling libgcc_s1... [ 2s] [20/30] preinstalling m4... [ 2s] [21/30] preinstalling sed... [ 2s] [22/30] preinstalling tar... [ 2s] [23/30] preinstalling coreutils... [ 2s] [24/30] preinstalling libelf1... [ 2s] [25/30] preinstalling diffutils... [ 2s] [26/30] preinstalling grep... [ 2s] [27/30] preinstalling permissions... [ 2s] [28/30] preinstalling aaa_base... [ 2s] [29/30] preinstalling rpm... [ 2s] [30/30] preinstalling pam... [ 2s] [ 2s] running aaa_base preinstall script [ 2s] chroot: failed to run command 'sh': No such file or directory [ 2s] running aaa_base postinstall script [ 2s] chroot: failed to run command 'sh': No such file or directory [ 2s] initializing rpm db... [ 2s] chroot: failed to run command '/usr/bin/rpmdb': No such file or directory as well as armv7l OSC_BUILD_ROOT=/var/tmp/build-root-qemu/ osc build --alternative-project=openSUSE:Factory:ARM qemu armv7l --clean ... ./configure --host=armv7hl-suse-linux-gnueabi --build=armv7hl-suse-linux-gnueabi ... [ 88s] checking for gcc... gcc [ 89s] checking whether the C compiler works... no [ 89s] configure: error: in `/home/abuild/rpmbuild/BUILD/icedtea-2.4.2': [ 89s] configure: error: C compiler cannot create executables looking at strace output, the /emul/x86_64-for-arm/usr/bin/gcc.real does search lib64 for cc1, instead of /usr/lib sudo strace -f -o out chroot /var/tmp/build-root-qemu/ /usr/bin/gcc /home/abuild/foo.c ... stat("/usr/lib64/gcc/armv7hl-suse-linux-gnueabi/4.8/cc1", 0x7ffff786c010) = -1 ENOENT (No such file or directory) BTW: not sure if related, but there is something in /usr/lib64/gcc in a buildroot file /usr/lib64/gcc/arm-suse-linux-gnueabi /usr/lib64/gcc/arm-suse-linux-gnueabi: broken symbolic link to `../../lib/gcc/arm-suse-linux-gnueabi' however does not belongs to any package rpm -qf /usr/lib64/gcc/arm-suse-linux-gnueabi file /usr/lib64/gcc/arm-suse-linux-gnueabi is not owned by any package rpm -qf /usr/lib64/gcc/ file /usr/lib64/gcc is not owned by any package Thanks for any help Michal Vyskocil
Hi Michal,
[ 2s] running aaa_base preinstall script [ 2s] chroot: failed to run command 'sh': No such file or directory
Unfortunately Adrian reenbled the qemu-accel layer before leaving for vacation, which (as you found out) does not work. you need to manually fix it up now, as root, do echo -1 > /proc/sys/fs/binfmt_misc/arm and then rerun the osc command. please note that due to osc bugs, you need to always include the spec file in the osc build commandline as last argument when using --alternative-project.
sudo strace -f -o out chroot /var/tmp/build-root-qemu/ /usr/bin/gcc /home/abuild/foo.c ... stat("/usr/lib64/gcc/armv7hl-suse-linux-gnueabi/4.8/cc1", 0x7ffff786c010) = -1 ENOENT (No such file or directory)
Yeah, normal when you use the broken qemu-accel stuff. I've disabled it again now. Let me know if that helps. Greetings, Dirk -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
On Tue, Oct 01, 2013 at 02:41:24PM +0200, Dirk Müller wrote:
Hi Michal,
[ 2s] running aaa_base preinstall script [ 2s] chroot: failed to run command 'sh': No such file or directory
Unfortunately Adrian reenbled the qemu-accel layer before leaving for vacation, which (as you found out) does not work.
you need to manually fix it up now, as root, do echo -1 > /proc/sys/fs/binfmt_misc/arm
and then rerun the osc command. please note that due to osc bugs, you need to always include the spec file in the osc build commandline as last argument when using --alternative-project.
sudo strace -f -o out chroot /var/tmp/build-root-qemu/ /usr/bin/gcc /home/abuild/foo.c ... stat("/usr/lib64/gcc/armv7hl-suse-linux-gnueabi/4.8/cc1", 0x7ffff786c010) = -1 ENOENT (No such file or directory)
Yeah, normal when you use the broken qemu-accel stuff. I've disabled it again now.
Let me know if that helps.
Yes, now it fails on the same error as in OBS. Thanks! Michal Vyskocil
Greetings, Dirk
On Tue, Oct 01, 2013 at 02:41:24PM +0200, Dirk Müller wrote:
Hi Michal,
[ 2s] running aaa_base preinstall script [ 2s] chroot: failed to run command 'sh': No such file or directory
Unfortunately Adrian reenbled the qemu-accel layer before leaving for vacation, which (as you found out) does not work.
you need to manually fix it up now, as root, do echo -1 > /proc/sys/fs/binfmt_misc/arm
and then rerun the osc command. please note that due to osc bugs, you need to always include the spec file in the osc build commandline as last argument when using --alternative-project.
sudo strace -f -o out chroot /var/tmp/build-root-qemu/ /usr/bin/gcc /home/abuild/foo.c ... stat("/usr/lib64/gcc/armv7hl-suse-linux-gnueabi/4.8/cc1", 0x7ffff786c010) = -1 ENOENT (No such file or directory)
Yeah, normal when you use the broken qemu-accel stuff. I've disabled it again now.
Let me know if that helps.
BTW: what is the correct way how to setup aarch64 build? http://news.opensuse.org/2013/10/01/suse-speeds-up-building-aarch64-software... mentions follow the same as for normal arch build, however I got [ 3s] [30/30] preinstalling pam... [ 3s] [ 3s] running aaa_base preinstall script [ 3s] chroot: failed to run command 'sh': Exec format error [ 3s] running aaa_base postinstall script [ 3s] chroot: failed to run command 'sh': Exec format error [ 3s] initializing rpm db... [ 3s] chroot: failed to run command '/usr/bin/rpmdb': Exec format error I assume missing binfmt_misc for aarch64, however qemu-linux-user does not have qemu-aarch64-binfmt handler. Looking to Virtualization I doubt it was added in a meanwhile. Regards Michal Vyskocil
Greetings, Dirk
Hi Michal, Indeed, the QEMU package in Factory/13.1. Unfortunatly osc does not use the server configuration but simply runs qemu-binfmt-misc-handler.sh locally, which hopefully sets up the environment correctly then (it doesn't for you). It would be a lot better if osc would simply run the qemu-reg from the server, but until it does so, simply add this to be run as root initially after boot: echo ':aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-arm64-binfmt:P'
/proc/sys/fs/binfmt_misc/register
Greetings, Dirk -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
participants (2)
-
Dirk Müller
-
Michal Vyskocil