qemu-aarch64-static

Jan Beich jbeich at FreeBSD.org
Thu Aug 17 19:23:01 UTC 2017


(Redirected from https://lists.freebsd.org/pipermail/freebsd-questions/2017-August/278443.html )

Andrea Venturoli <ml at 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.


More information about the freebsd-ports mailing list