From owner-freebsd-embedded@FreeBSD.ORG Thu Dec 25 01:30:11 2014 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A36C37A3 for ; Thu, 25 Dec 2014 01:30:11 +0000 (UTC) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19B0D2FD6 for ; Thu, 25 Dec 2014 01:30:10 +0000 (UTC) Received: by mail-lb0-f169.google.com with SMTP id p9so7433355lbv.28 for ; Wed, 24 Dec 2014 17:30:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=XE+MMkueGmLNV6kdi1iHwx+VfMC+K1satp2+0o8mL1o=; b=IlXuhOArwvy9PN8MWJQZm+bk3wVO1od9J5xXAOOknStccOY8zzqb1bdFXINXqJ+E8A RwwDD3TOxmuQ2sAXkamgOzm/YjH21D4gPie/SpqYKO6W2dy3lNuvrDhnyzqRS6+joy1I SnflzauagsG2cqcYtEtQTy+ckHr1A+rTC9JAWW+teZwyIAzTisQ7qvlU/6oRcXutwfK3 V4o03bG6xE4cJ8Hgi0BOdumuIUuFu3k3PXJ4ZFQMYnvJFau/0HN6eLrvUwp1oxWG7vo0 DMeMxV5yCr30O04gQ9rKnVs4ektNHqb6qkGi0JrDKpSc20qNO4+wdqYkKbeKZ9OGfBu6 MyEA== X-Gm-Message-State: ALoCoQm9Z4tcHZj9eCuHSWtgMn0gMOrThR0tZbQNB80P+jbttJA1hnj55hSozSbFAh086R0MQH57 X-Received: by 10.113.11.12 with SMTP id ee12mr10673325lbd.79.1419471001987; Wed, 24 Dec 2014 17:30:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.142.198 with HTTP; Wed, 24 Dec 2014 17:29:21 -0800 (PST) X-Originating-IP: [74.60.193.70] In-Reply-To: <549B6584.3000608@ignoranthack.me> References: <549B6584.3000608@ignoranthack.me> From: Jeremy Brown Date: Wed, 24 Dec 2014 20:29:21 -0500 Message-ID: Subject: Re: Help Compiling armv6 Ports from x64 To: sbruno@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: freebsd-embedded@freebsd.org X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Dec 2014 01:30:11 -0000 Sean, Does poudriere work with previously-established roots or does it have to generate its own? I'm using crochet to create my image, so I can do whatever I want to the filesystem it creates and have it apply to the image. Also, will poudriere actually install a package and modify necessary files to let the system know a port is installed, or does it only create the package and leave it to me to install? -Jeremy On Wed, Dec 24, 2014 at 8:16 PM, Sean Bruno wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On 12/24/14 16:34, Jeremy Brown wrote: > > I have a VM running FreeBSD 10.1 x64 that I'm trying to use to > > create an image that will run on a Raspberry Pi. I've managed to > > get the base system working, but I can't figure out how to compile > > ports for the image. I know my cross-compilation toolchain is > > working, as I can build the kernel and world without issue. > > > > For sake of example, say my arm root is at /tmp/rootfs, my > > toolchain is at /usr/armv6-freebsd/usr/bin and some other assorted > > cross-compilation items are at /usr/obj/armv6-freebsd. > > > > Some of the commands I have tried to build a port are: > > > > PATH=/path/to/toolchain:${PATH} make TARGET=arm TARGET_ARCH=armv6 > > install (this typically fails during compilation) > > > > PATH=/path/to/toolchain:${PATH} make TARGET=arm TARGET_ARCH=armv6 > > configure install (this typically fails during configuration, the > > error I get is something along the lines of "cannot read C-compiled > > file"; in addition the configure script never notices that I am > > trying to cross-compile) > > > > PATH=/path/to/toolchain:${PATH} make > > CONFIGURE_ARGS="--host=armv6-freebsd" configure install (this > > typically fails during compilation for varying reasons, but at > > least it'll recognize that I'm cross-compiling; including TARGET > > and TARGET_ARCH makes no difference) > > > > make TARGET=arm TARGET_ARCH=armv6 DESTDIR=/tmp/rootfs install > > (this was what I originally tried, when the chroot kicked in it > > would try to run the ARM version of /bin/sh; as the VM is x64 this > > would always give an exec format error before failing) > > > > make TARGET=arm TARGET_ARCH=armv6 DESTDIR=/tmp/rootfs CHROOTED=no > > install (this would seem to work, but would install the port to the > > VM instead of the filesystem for the image, and in addition would > > be compiled x64 instead of armv6) > > > > There are others, but these are the ones I can remember the best > > right now. I understand there won't be any precompiled ports, and I > > don't want to have to build my desired ports on the Pi itself > > (despite the fact that doing so would be agonizingly slow, the > > space required to store the ports tree and compile what I need > > would explode the size of the image from ~400MB to > >> 2GB). > > > > I've tried many different websites (see here > > , here > > < > http://allskyee.blogspot.com/2014/02/freebsd-10-ports-cross-compile-amd64-to.html > > > > > > > , here > > < > http://ray-freebsd.blogspot.kr/2011/09/cross-compiling-ports-for-freebsd.html > > > > > > > , here , here > > < > http://lists.freebsd.org/pipermail/freebsd-current/2012-November/037469.html > >), > > > > > but none of their methods have resulted in a successful compilation. > > > > Do you know of a method to compile armv6 ports on an x64 machine, > > or can you direct me to someone who might? > > > > -Jeremy > > At this point, poudriere can build packages by default. > > If you want armv6 packages for RPi or BBB, get poudriere 3.1 on your > system with qemu-bsd-user. > > Setup this arcane binmiscctl(8) command: > /usr/sbin/binmiscctl add armv6 --interpreter "/usr/local/bin/qemu-arm" \ > - --magic > > "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00" > \ > - --mask > > "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff" > \ > - --size 20 --set-enabled > > > That is the command that will redirect execution of armv6 binaries to > qemu-bsd-user. > > Build an armv6 jail with: > > poudriere jail -c -j armv6 -m svn -v head -a arm.armv6 -x > > And build your ports with poudriere via: > poudriere bulk -j amrv6 > > You can fetch packages from the freebsd cluster arm builder if you > wish as well: > > http://chips.ysv.freebsd.org/packages/11armv6-11armv6/ > > Sean > > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQF8BAEBCgBmBQJUm2WBXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w > ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw > MDAwMDAwMDAwMDAwMDAwAAoJEBIB78oecn5kDx0H/0UnXCslpqnT1JrHDCuN+trS > IvC2eMIaaLa2jZ/6BM6FVqmMdRpt+sGnToZSL/3iaFyLQhgadOqojBtsuna8W2rd > jagvmhQaZtG0TOfCBPI6B0LDAZMwzAcczgSc+ta+39rU3sGrI3u9Cu7aUf6xWOJZ > GMmbvH3idiLLcyVzwKSL2D8B3y7mg1E+cNB5y61nNxpnrIsQNLmaASjikaJXOif4 > 8AV7/yzq5tLkeiBkxjnsq0t3UBCUh/omMwGwQn6jXD8qa4JfjtFWFN23hpVyPBpi > jfL6IycR7JauqXK1JQzYHiNCgGD8JthNNCwp4UQvvDfY8w/0cwFwXPdzy4qedYc= > =lkbv > -----END PGP SIGNATURE----- >