Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Aug 2017 21:22:55 +0200
From:      Jan Beich <jbeich@FreeBSD.org>
To:        Andrea Venturoli <ml@netfence.it>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: qemu-aarch64-static
Message-ID:  <fucq-0zjk-wny@FreeBSD.org>
In-Reply-To: <29906b14-8efa-ba65-985a-fd5b90c76b9b@netfence.it> (Andrea Venturoli's message of "Thu, 17 Aug 2017 20:42:06 +0200")
References:  <29906b14-8efa-ba65-985a-fd5b90c76b9b@netfence.it>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
(Redirected from https://lists.freebsd.org/pipermail/freebsd-questions/2017-August/278443.html )

Andrea Venturoli <ml@netfence.it> writes:

>> # file date
>> date: ELF 64-bit MSB executable, MIPS, MIPS-III version 1 (FreeBSD),
>> statically linked, FreeBSD-style, for FreeBSD 10.0 (1000027),
>> stripped
>> # ./date Thu Aug 17 19:51:56 CEST 2017
>
>> # file date
>> date: ELF 64-bit LSB executable, ARM aarch64, version 1 (FreeBSD),
>> dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD
>> 11.1, FreeBSD-style, not stripped
>> # ./date
>> Unable to load interpreter
>
> Is this the expected behaviour?

Yep. Link the binary (i.e. "date") statically or run it inside jail/chroot.
Otherwise, /libexec/ld-elf.so.1 references the host system, which on amd64
wouldn't recognize aarch64 shared libraries.

> I read, on https://wiki.freebsd.org/QemuUserModeHowTo, that "Currently
> only "TARGET=mips TARGET_ARCH=mips64 and "TARGET=arm
> TARGET_ARCH=armv6" has enough machine dependent code in place to do
> everything described below", but OTOH it seems people are using
> poudriere to cross build aarch64 ports (which is what I'd like to do).

That page is a bit out of date. Nowadays building for aarch64 is as simple as

  $ pkg install poudriere qemu-user-static
  $ service qemu_user_static onestart
  $ poudriere jail -cj 111aarch64 -a arm64.aarch64 -v 11.1-RELEASE
  $ poudriere bulk -j 111aarch64 category/port

To speed up port builds you may want to consider using native
cross-toolchain by creating a jail with -x flag.



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?fucq-0zjk-wny>