From owner-freebsd-ports@freebsd.org Thu Aug 17 19:23:01 2017 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CC7CDD163C for ; Thu, 17 Aug 2017 19:23:01 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E2C910F4; Thu, 17 Aug 2017 19:23:01 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 466301747A; Thu, 17 Aug 2017 19:23:00 +0000 (UTC) From: Jan Beich To: Andrea Venturoli Cc: freebsd-ports@freebsd.org Subject: Re: qemu-aarch64-static References: <29906b14-8efa-ba65-985a-fd5b90c76b9b@netfence.it> Date: Thu, 17 Aug 2017 21:22:55 +0200 In-Reply-To: <29906b14-8efa-ba65-985a-fd5b90c76b9b@netfence.it> (Andrea Venturoli's message of "Thu, 17 Aug 2017 20:42:06 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2017 19:23:01 -0000 (Redirected from https://lists.freebsd.org/pipermail/freebsd-questions/2017-August/278443.html ) Andrea Venturoli 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.