Help Compiling armv6 Ports from x64

Jeremy Brown mischif at mischivous.com
Thu Dec 25 00:35:09 UTC 2014


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 <http://www.cruwe.de/?p=78>,
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 <http://blog.ignoranthack.me/?p=221>, 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


More information about the freebsd-embedded mailing list