From owner-freebsd-embedded@FreeBSD.ORG Thu Dec 25 00:35:09 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 9668F80F for ; Thu, 25 Dec 2014 00:35:09 +0000 (UTC) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) (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 0C4541B32 for ; Thu, 25 Dec 2014 00:35:08 +0000 (UTC) Received: by mail-lb0-f174.google.com with SMTP id 10so7295232lbg.19 for ; Wed, 24 Dec 2014 16:35:01 -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:from:date:message-id:subject:to :content-type; bh=ND1h2Uep76y0fibZa7vMzY8xGnanRp0SmFuvhwYGktQ=; b=BMUPWmc24JLfN5CteH3S/yX4Lwi428tlzrue0ohyF+6GlIEUDkjawCurTphxvDUY1C gLWk/6J8cy+WE8XfAjnz/x+tKeQvRtrB/kPMK02jbTCwBisgdhkt32uyx4W8GkIEXAK+ oDhyh4YQdEgfRtHH++CuuhOb4blncU+A7Y/18CvtVWlHypx2lX3vApgfD5ZYIW/LSp3S QWpM8zHP0dvxvMb4BcD8Rrw0nQnCyaj3TgMUhRTX6f84Npu2MvZriBaUS0GI71erIbN+ TQofx4duQpxh8zLdN1pPOvpbvmgbxu+hvHUkaAQ41luzo5uxftIQjwfzd2HH5oDpnM5L FvNg== X-Gm-Message-State: ALoCoQmJgmno7O8OD/660oy2ufcDdoHDuxo4khzw28HD3G8JcXinOmsmtxcefgkewnYErriWZ+Z7 X-Received: by 10.152.3.100 with SMTP id b4mr35037391lab.68.1419467701454; Wed, 24 Dec 2014 16:35:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.142.198 with HTTP; Wed, 24 Dec 2014 16:34:21 -0800 (PST) X-Originating-IP: [74.60.193.70] From: Jeremy Brown Date: Wed, 24 Dec 2014 19:34:21 -0500 Message-ID: Subject: Help Compiling armv6 Ports from x64 To: freebsd-embedded@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 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 00:35:09 -0000 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 , here , here , here ), 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 From owner-freebsd-embedded@FreeBSD.ORG Thu Dec 25 01:17:01 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 6F0AC27B for ; Thu, 25 Dec 2014 01:17:01 +0000 (UTC) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 370282C84 for ; Thu, 25 Dec 2014 01:17:00 +0000 (UTC) Received: from [192.168.200.211] (unknown [50.136.155.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id D1BCF192A3B; Thu, 25 Dec 2014 01:16:53 +0000 (UTC) Message-ID: <549B6584.3000608@ignoranthack.me> Date: Wed, 24 Dec 2014 17:16:52 -0800 From: Sean Bruno Reply-To: sbruno@freebsd.org User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: freebsd-embedded@freebsd.org, mischif@mischivous.com Subject: Re: Help Compiling armv6 Ports from x64 References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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:17:01 -0000 -----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 > > > , here > > > , here , here > ), > > 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----- 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----- > From owner-freebsd-embedded@FreeBSD.ORG Thu Dec 25 01:56:07 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 0C21C494 for ; Thu, 25 Dec 2014 01:56:07 +0000 (UTC) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDA1B3441 for ; Thu, 25 Dec 2014 01:56:06 +0000 (UTC) Received: from [192.168.200.211] (unknown [50.136.155.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id A4F8F192A3B; Thu, 25 Dec 2014 01:56:05 +0000 (UTC) Message-ID: <549B6EB3.90204@ignoranthack.me> Date: Wed, 24 Dec 2014 17:56:03 -0800 From: Sean Bruno Reply-To: sbruno@freebsd.org User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Jeremy Brown Subject: Re: Help Compiling armv6 Ports from x64 References: <549B6584.3000608@ignoranthack.me> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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:56:07 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 12/24/14 17:29, Jeremy Brown wrote: > 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. > Poudirere's main purpose is to create a package repo for remote installation. So, I'm guessing that you don't want that. What you "want" is the magical binmiscctl command on your host system and then copy /usr/local/qemu-user-arm into your jail. Modify the binmiscctl(8) command I pointed you at below to point to /usr/local/bin/qemu-user-arm. Then you should be able to "chroot" into your existing chroot and it will act like an arm box. It will be slow, but currently there's no reliable way that I am aware of to get what you and other need done. sean > 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: > > 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 iQF8BAEBCgBmBQJUm26wXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw MDAwMDAwMDAwMDAwMDAwAAoJEBIB78oecn5kcoAH/RqUaEJdWYo3hjimFzaTWlR6 v6DzcuV3agbc5pf47JU7OszU2BQC7oSlRKfgL3yPqosK6gVGYwr5ZxIXet5YKvnG aaLQ6b++7PjXm9WvLRufShYusO1QVuwa5Witj3zAKbjgC3F6e0qFyRdX/wbOpnFW 871Jc/QdxNrgHWw2o31m3GsVi4OtondB2Fifz7us9bSYNFn84S3pz73Nf8DV9KtS HXG42qDGNFz7Ov/k9apDC1Jr1ejMhfP3sX9Jnsg1z2vqDHZC2KuB6fGOEvL9n1DJ 45R2H5UYgXH/T+rJ36lrTkVxVSvwt+s+oEIdDDFbOsGJx/rqP79adrAcWUzWD/I= =uOZl -----END PGP SIGNATURE----- From owner-freebsd-embedded@FreeBSD.ORG Thu Dec 25 15:17:55 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 921FD4D4 for ; Thu, 25 Dec 2014 15:17:55 +0000 (UTC) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) (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 23D3C1FF8 for ; Thu, 25 Dec 2014 15:17:54 +0000 (UTC) Received: by mail-la0-f41.google.com with SMTP id hv19so8033613lab.0 for ; Thu, 25 Dec 2014 07:17:47 -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=L9zA46cgm1X9uGcJwoCaxtxn7aVbnV9PweTTGtTvems=; b=amIkqPAPkJi3lux0AXGHy0WJCj+PwFD6kHzbXOMuK8OCbIaILlhUEjAyuXh3CQUnI+ PbGBqXv1aZrx0PtEpoO+J/gJXUvSKS6KjVnQ0G3J7ASUx6rR8acz6N2zMzhTbOvk8WWI +8LdYDki0DewyHjsyof9ubbIUh+Eh7/DWBIqsp+wjfSVTHLtp/+arqPiZPmoX8QvNgeN f5Ue9Ow5xH4nqE6ihRvKlceQfhiHdQIH8Vms9+TcMSxk7m0bRmZ+Di5TcDUArqWTYcAK VSx8suciRH+eR+H856zn8up4MsA5Hii270rCRJZEVi6StnqBx2lX8LPpWYZOT9VSbixB 3Kgw== X-Gm-Message-State: ALoCoQk6KZ8SmIf8hVNlgrq4aaSm00+gBjdYgIqqibR32cxGt5hWSQPV/13/zTCdOQWIt+09+BpO X-Received: by 10.152.88.44 with SMTP id bd12mr38743809lab.88.1419520667354; Thu, 25 Dec 2014 07:17:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.142.198 with HTTP; Thu, 25 Dec 2014 07:17:05 -0800 (PST) X-Originating-IP: [74.60.193.70] In-Reply-To: <549B6EB3.90204@ignoranthack.me> References: <549B6584.3000608@ignoranthack.me> <549B6EB3.90204@ignoranthack.me> From: Jeremy Brown Date: Thu, 25 Dec 2014 10:17:05 -0500 Message-ID: Subject: Re: Help Compiling armv6 Ports from x64 To: Sean Bruno 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 15:17:55 -0000 Sean, It seems the binmiscctl command was the last part of the puzzle, now everything's working. But I have one last issue I'm trying to solve: Now I'm trying to use the x64 cross compiler instead of emulating through the arm one. I've copied my toolchain over and I've set up variables for CC, et al to refer to the x64 versions in /root/.profile, but I can't get make to pick up on them. Is there something else I need to do? -Jeremy On Wed, Dec 24, 2014 at 8:56 PM, Sean Bruno wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On 12/24/14 17:29, Jeremy Brown wrote: > > 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. > > > > Poudirere's main purpose is to create a package repo for remote > installation. > > So, I'm guessing that you don't want that. > > What you "want" is the magical binmiscctl command on your host system > and then copy /usr/local/qemu-user-arm into your jail. > > Modify the binmiscctl(8) command I pointed you at below to point to > /usr/local/bin/qemu-user-arm. > > Then you should be able to "chroot" into your existing chroot and it > will act like an arm box. It will be slow, but currently there's no > reliable way that I am aware of to get what you and other need done. > > > sean > > > 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: > > > > 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 > > iQF8BAEBCgBmBQJUm26wXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w > ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw > MDAwMDAwMDAwMDAwMDAwAAoJEBIB78oecn5kcoAH/RqUaEJdWYo3hjimFzaTWlR6 > v6DzcuV3agbc5pf47JU7OszU2BQC7oSlRKfgL3yPqosK6gVGYwr5ZxIXet5YKvnG > aaLQ6b++7PjXm9WvLRufShYusO1QVuwa5Witj3zAKbjgC3F6e0qFyRdX/wbOpnFW > 871Jc/QdxNrgHWw2o31m3GsVi4OtondB2Fifz7us9bSYNFn84S3pz73Nf8DV9KtS > HXG42qDGNFz7Ov/k9apDC1Jr1ejMhfP3sX9Jnsg1z2vqDHZC2KuB6fGOEvL9n1DJ > 45R2H5UYgXH/T+rJ36lrTkVxVSvwt+s+oEIdDDFbOsGJx/rqP79adrAcWUzWD/I= > =uOZl > -----END PGP SIGNATURE----- > From owner-freebsd-embedded@FreeBSD.ORG Fri Dec 26 21:11:16 2014 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8941BA9A for ; Fri, 26 Dec 2014 21:11:16 +0000 (UTC) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64A0F671BF for ; Fri, 26 Dec 2014 21:11:15 +0000 (UTC) Received: from [192.168.200.212] (unknown [50.136.155.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 57473192A3B; Fri, 26 Dec 2014 21:11:14 +0000 (UTC) Message-ID: <549DCEF1.2040401@ignoranthack.me> Date: Fri, 26 Dec 2014 13:11:13 -0800 From: Sean Bruno Reply-To: sbruno@freebsd.org User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Jeremy Brown Subject: Re: Help Compiling armv6 Ports from x64 References: <549B6584.3000608@ignoranthack.me> <549B6EB3.90204@ignoranthack.me> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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: Fri, 26 Dec 2014 21:11:16 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 12/25/14 07:17, Jeremy Brown wrote: > Sean, > > It seems the binmiscctl command was the last part of the puzzle, > now everything's working. But I have one last issue I'm trying to > solve: > > Now I'm trying to use the x64 cross compiler instead of emulating > through the arm one. I've copied my toolchain over and I've set up > variables for CC, et al to refer to the x64 versions in > /root/.profile, but I can't get make to pick up on them. Is there > something else I need to do? > > -Jeremy I think these things are actually controlled by /etc/make.conf in the jail/chroot that you are using. e.g. poudriere sets up some CC= and friends that does some of this for me, but you'll have to replicate by hand: % cat /usr/local/poudriere/jails/11-armv6/etc/make.conf CC=/nxb-bin/usr/bin/cc CPP=/nxb-bin/usr/bin/cpp CXX=/nxb-bin/usr/bin/c++ AS=/nxb-bin/usr/bin/as NM=/nxb-bin/usr/bin/nm LD=/nxb-bin/usr/bin/ld OBJCOPY=/nxb-bin/usr/bin/objcopy SIZE=/nxb-bin/usr/bin/size STRIPBIN=/nxb-bin/usr/bin/strip SED=/nxb-bin/usr/bin/sed READELF=/nxb-bin/usr/bin/readelf RANLIB=/nxb-bin/usr/bin/ranlib YACC=/nxb-bin/usr/bin/yacc NM=/nxb-bin/usr/bin/nm MAKE=/nxb-bin/usr/bin/make STRINGS=/nxb-bin/usr/bin/strings AWK=/nxb-bin/usr/bin/awk FLEX=/nxb-bin/usr/bin/flex > > On Wed, Dec 24, 2014 at 8:56 PM, Sean Bruno > wrote: > > On 12/24/14 17:29, Jeremy Brown wrote: >>>> 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. >>>> > > Poudirere's main purpose is to create a package repo for remote > installation. > > So, I'm guessing that you don't want that. > > What you "want" is the magical binmiscctl command on your host > system and then copy /usr/local/qemu-user-arm into your jail. > > Modify the binmiscctl(8) command I pointed you at below to point > to /usr/local/bin/qemu-user-arm. > > Then you should be able to "chroot" into your existing chroot and > it will act like an arm box. It will be slow, but currently > there's no reliable way that I am aware of to get what you and > other need done. > > > sean > >>>> 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: >>>> >>>> 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 iQF8BAEBCgBmBQJUnc7vXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw MDAwMDAwMDAwMDAwMDAwAAoJEBIB78oecn5k5cYH/2NxHEtE8sgVzoWZ84nHL26B 2U7IRHypCrPuSxtkcBb8hnQJk1F2ybeC/i56BwuT1Gjois/0Yu3EeybBw2zHxU5q hvyyvGJXptUTnXD/JQHEcV/hqbD6j5ng5iXds+LB8htmbfoROtH1Bxs+ZXhmwqsH aJ7cL4Ufmx0/VtbPevFU9Lzxes1r3JpbeOrX54DfLgLmEEe8sbj+eSNW/St49so9 jk5wXxPy6VbSz/YC4gMl0S6Ev1VQtBeyEg+2kRmaUf/1JlxYh+dG8j5FaihZnjo9 SBloROfgjIRzWRtEgCKZVsOjlREg8kvIik0s3jOUgwjwvRJW3Pc4UnyFyBmoEMc= =8zMx -----END PGP SIGNATURE----- From owner-freebsd-embedded@FreeBSD.ORG Sat Dec 27 19:05:31 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 D54B953F for ; Sat, 27 Dec 2014 19:05:31 +0000 (UTC) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) (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 41557FA for ; Sat, 27 Dec 2014 19:05:30 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id p9so9366384lbv.7 for ; Sat, 27 Dec 2014 11:05:23 -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=99q4NoU9GphkXhwcNy/wJ4hk4lBhVrf48MBwHtCT4U0=; b=elEHWgG9skmUwaBPR3vIpt5U0xlvOgkIwacAXvPF9xvqo5sc0sguzjjgRww/VT9p+7 B7PylASuBNfAe8Excy0A9KsaDCGYUJ1VPZp5g1FE/A5gpobHJ8qJhYv9gD2GGTI6tcwn fBpkLH9aDtA7jwHfqFsvDxs1CE04fJusWAi4PS4iIYk3mt5/6n83bYQVkrsO5FJhb26F hHXU+sxpFw05GcxbZrEUVIkPDfmpwrTpl4cGruOsbZpxKr/wkjttNVh8maI0bpq2WFfW XWIK9Ivg3e4ltcQYNoMnsLI5GuXpMkXmx5IK074W5gfEyhV2uUaPUtrydfMeM637keR7 vkXg== X-Gm-Message-State: ALoCoQlI+cDgBpV6L0PV2Vbhqdl+1UoG0PJURrFN3z1wKFLpJADgkNNb+zit1933XxEWByu3Cfgu X-Received: by 10.153.8.132 with SMTP id dk4mr44809600lad.56.1419707122738; Sat, 27 Dec 2014 11:05:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.142.198 with HTTP; Sat, 27 Dec 2014 11:04:42 -0800 (PST) X-Originating-IP: [74.60.193.70] In-Reply-To: <549DCEF1.2040401@ignoranthack.me> References: <549B6584.3000608@ignoranthack.me> <549B6EB3.90204@ignoranthack.me> <549DCEF1.2040401@ignoranthack.me> From: Jeremy Brown Date: Sat, 27 Dec 2014 14:04:42 -0500 Message-ID: Subject: Re: Help Compiling armv6 Ports from x64 To: Sean Bruno 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: Sat, 27 Dec 2014 19:05:31 -0000 Okay, I just had to add the directory they were in to my PATH and now they're being picked up, but I'm getting two new errors during configuration, and I think solving one might lead to solving the other. The first is that cpp is failing the sanity check, it throws a syntax error when it tries to compile the test file. The second error is that /libexec/ld-elf.so.1 cannot be found; I assume this is due to some incompatibility between the x64 binaries I'm trying to use and the armv6 chroot, but is there any way to solve it? -Jeremy On Fri, Dec 26, 2014 at 4:11 PM, Sean Bruno wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On 12/25/14 07:17, Jeremy Brown wrote: > > Sean, > > > > It seems the binmiscctl command was the last part of the puzzle, > > now everything's working. But I have one last issue I'm trying to > > solve: > > > > Now I'm trying to use the x64 cross compiler instead of emulating > > through the arm one. I've copied my toolchain over and I've set up > > variables for CC, et al to refer to the x64 versions in > > /root/.profile, but I can't get make to pick up on them. Is there > > something else I need to do? > > > > -Jeremy > > I think these things are actually controlled by /etc/make.conf in the > jail/chroot that you are using. > > e.g. poudriere sets up some CC= and friends that does some of this for > me, but you'll have to replicate by hand: > > % cat /usr/local/poudriere/jails/11-armv6/etc/make.conf > CC=/nxb-bin/usr/bin/cc > CPP=/nxb-bin/usr/bin/cpp > CXX=/nxb-bin/usr/bin/c++ > AS=/nxb-bin/usr/bin/as > NM=/nxb-bin/usr/bin/nm > LD=/nxb-bin/usr/bin/ld > OBJCOPY=/nxb-bin/usr/bin/objcopy > SIZE=/nxb-bin/usr/bin/size > STRIPBIN=/nxb-bin/usr/bin/strip > SED=/nxb-bin/usr/bin/sed > READELF=/nxb-bin/usr/bin/readelf > RANLIB=/nxb-bin/usr/bin/ranlib > YACC=/nxb-bin/usr/bin/yacc > NM=/nxb-bin/usr/bin/nm > MAKE=/nxb-bin/usr/bin/make > STRINGS=/nxb-bin/usr/bin/strings > AWK=/nxb-bin/usr/bin/awk > FLEX=/nxb-bin/usr/bin/flex > > > > > > On Wed, Dec 24, 2014 at 8:56 PM, Sean Bruno > > wrote: > > > > On 12/24/14 17:29, Jeremy Brown wrote: > >>>> 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. > >>>> > > > > Poudirere's main purpose is to create a package repo for remote > > installation. > > > > So, I'm guessing that you don't want that. > > > > What you "want" is the magical binmiscctl command on your host > > system and then copy /usr/local/qemu-user-arm into your jail. > > > > Modify the binmiscctl(8) command I pointed you at below to point > > to /usr/local/bin/qemu-user-arm. > > > > Then you should be able to "chroot" into your existing chroot and > > it will act like an arm box. It will be slow, but currently > > there's no reliable way that I am aware of to get what you and > > other need done. > > > > > > sean > > > >>>> 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: > >>>> > >>>> 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 > > iQF8BAEBCgBmBQJUnc7vXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w > ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw > MDAwMDAwMDAwMDAwMDAwAAoJEBIB78oecn5k5cYH/2NxHEtE8sgVzoWZ84nHL26B > 2U7IRHypCrPuSxtkcBb8hnQJk1F2ybeC/i56BwuT1Gjois/0Yu3EeybBw2zHxU5q > hvyyvGJXptUTnXD/JQHEcV/hqbD6j5ng5iXds+LB8htmbfoROtH1Bxs+ZXhmwqsH > aJ7cL4Ufmx0/VtbPevFU9Lzxes1r3JpbeOrX54DfLgLmEEe8sbj+eSNW/St49so9 > jk5wXxPy6VbSz/YC4gMl0S6Ev1VQtBeyEg+2kRmaUf/1JlxYh+dG8j5FaihZnjo9 > SBloROfgjIRzWRtEgCKZVsOjlREg8kvIik0s3jOUgwjwvRJW3Pc4UnyFyBmoEMc= > =8zMx > -----END PGP SIGNATURE----- >