Mailinglist Archive: opensuse-buildservice (244 mails)

< Previous Next >
[opensuse-buildservice] Re: qemu Cross Compilation Instructions
  • From: Troy Telford <ttelford.groups@xxxxxxxxx>
  • Date: Tue, 19 Jun 2012 18:35:55 -0600
  • Message-id: <jrr5ta$i15$1@dough.gmane.org>
On 2012-06-12 04:28:48 +0000, Robert Schiele said:

On Mon, Jun 11, 2012 at 10:12 PM, Troy Telford
<ttelford.groups@xxxxxxxxx> wrote:
So far, I've been able to create a repo for the ARM architecture, and get
the ARM scheduler running - however, builds are never attempted; they are
stuck at "scheduled".

So what else am I missing?

Add something like this to your project config:

%ifarch armv7l armv5el
HostArch: x86_64
%endif

This will tell OBS to schedule jobs from those architectures on x86_64
workers instead of arm workers (that you apparently don't have).

This gets me farther than before. However, I'm still having problems:

Distro: Fedora_17 (not my choice - I have to build it)
Prjconf: Nearly identical to build.opensuse.org for F17; the diff is:
@@ -1,3 +1,11 @@
+%ifarch armv7l armv5el armv7hl
+HostArch: x86_64
+Preinstall: qemu-user qemu-system-arm qemu-img qemu-common
+%endif
+ExportFilter: ^qemu-user.*\.x86_64.rpm$ . armv7l armv5el
+ExportFilter: ^qemu-system-arm.*\.x86_64.rpm$ . armv7l armv5el
+ExportFilter: ^qemu-img.*\.x86_64.rpm$ . armv7l armv5el
+ExportFilter: ^qemu-common.*\.x86_64.rpm$ . armv7l armv5el
Preinstall: acl attr bash bzip2 coreutils device-mapper-libs diffutils
Preinstall: filesystem glibc grep libacl libattr
Preinstall: libgcc m4 ncurses pam nss nspr


This seems to match up (fairly) well with the ARM support on openSUSE:Factory:ARM, which is:
%ifarch armv5el armv7l armv7hl
Hostarch: x86_64
# cross build support for the build hosts
Preinstall: qemu-linux-user
%endif
%ifarch armv7l armv7hl
# qemu-accel-arm includes armv7l specific gcc, so we can't install it on armv5
Preinstall: qemu-accel-arm
%endif
ExportFilter: ^qemu-linux-user.*\.x86_64.rpm$ . armv7l armv5el
ExportFilter: ^qemu-accel.*\.x86_64.rpm$ . armv7l armv5el


And the build log of a test package:

Using BUILD_ROOT=/var/tmp/obs_workers/root_2
Using BUILD_ARCH=armv5el


n010 started "build xz.spec" at Tue Jun 19 23:34:48 UTC 2012.

Building xz for project 'foo' repository 'Fedora_17' arch 'armv5el' srcmd5 '4e462df4254424f6e9025eb08c050c90'
processing specfile /var/tmp/obs_workers/root_2/.build-srcdir/xz.spec ...
running changelog2spec --target rpm --file /var/tmp/obs_workers/root_2/.build-srcdir/xz.spec
init_buildsystem --configdir /var/run/obs/worker/2/build/configs --cachedir /var/cache/build --clean --rpmlist /var/tmp/obs_workers/root_2/.build.rpmlist /var/tmp/obs_workers/root_2/.build-srcdir/xz.spec build rpmlint-Factory ...
registering binfmt handlers
Warning: could not register binfmt handlers
Warning: mmap_min_addr is != 0. If programs fail at mmap this could be the reason
cycle: filesystem -> setup
breaking dependency filesystem -> setup
cycle: glibc -> nss-softokn-freebl
breaking dependency nss-softokn-freebl -> glibc
cycle: pam -> coreutils
breaking dependency coreutils -> pam
cycle: rpm-libs -> rpm
breaking dependency rpm -> rpm-libs
[1/54] preinstalling filesystem...
[2/54] preinstalling libgcc...
[3/54] preinstalling setup...
.
.
.
[50/56] preinstalling qemu-img...
[51/56] preinstalling qemu-common...
[52/56] preinstalling rpm...
[53/56] preinstalling qemu-system-arm...
[54/56] preinstalling qemu-user...
[53/54] preinstalling rpm-libs...
[54/54] preinstalling rpm-sign...
initializing rpm db...
chroot: failed to run command `rpm': Exec format error

So it appears that while OBS is at least attempting to build the package, I'm not seeing any indication that qemu is being invoked. It seems that the worker is just trying to execute the ARM-architecture 'rpm' as native x86_64 code - and dies.

Also - has qemu cross-compilation been attempted for a distribution other
than openSUSE?

The principles are always the same, no matter which distribution you
build. MeeGo for instance used this technology to build.

Having run my own OBS instance for ~6 years now, I'm also well aware that while in principle it should work, in practice the behavior doesn't always match perfectly.
--
Troy Telford


--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-buildservice+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups