Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Oct 2013 16:45:56 -0400
From:      "illoai@gmail.com" <illoai@gmail.com>
To:        Jason Birch <jbirch@jbirch.net>
Cc:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: Kernel/World/Ports compilation within jails; targeting many platforms.
Message-ID:  <CAHHBGkpgLQBhfF3qV09m5ANAggcLyMeZO9_ig3iMz-VMJ-Vx2A@mail.gmail.com>
In-Reply-To: <CAA=KUht4Kyz=-J6yGJdPfO4Bnr0a8-qU8k_Aj2Gp0MKjjPM=Qw@mail.gmail.com>
References:  <CAA=KUht4Kyz=-J6yGJdPfO4Bnr0a8-qU8k_Aj2Gp0MKjjPM=Qw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 26 October 2013 06:53, Jason Birch <jbirch@jbirch.net> wrote:
> Is it considered 'good form' to do compilation for other machines,
> architectures, and FreeBSD versions within jails?
>
> As a concrete example, my 'main' system is a FreeBSD 9.1-RELEASE amd64
> system, and I would like to compile FreeBSD 11-CURRENT for my BeagleBone
> Black (ARMv7). Does it make more sense to create a jail environment on my
> 9.1-RELEASE machine to do all compilation and 'staging' for the BeagleBlack?
>
> Originally I had just compiled gcc targeting arm and checked out sources
> into a location that wasn't /usr/src/. This is simple enough for one
> different target, but I'm wondering if I'll be a little bit more sane if
> I've got a jail for each individual target I'm compiling for. Each jail can
> then be set up with one, consistent compiler and source tree in the same
> location -- even if the compiler (GCC/Clang) and source (X-RELEASE vs
> Y-STABLE vs CURRENT) differ between targets?
>
> Are this a sane thing to be doing? For those of you that have several
> FreeBSD targets but do most of your set up on a single machine, how do you
> logically separate your 'worlds'?

Your system sounds a bit involved.  FreeBSD is designed to be
cross compiled fairly easily.

For building wine on amd64, I just created an i386 chroot.
A jail is targeted at running services within a chroot-like
environment, I suppose it could be used to cross compile.

You can cross build with:
# make buildworld TARGET=arm (you may need to specify TARGET_ARCH=
as well with ARM, I don't know)

You might have to specify CC= CXX= & CPP=

In the case of TARGET=i386 it places the object files under
/usr/obj/i386.i386/, I'd assume something similar for ARM.

You'll also have to build a kernel.  You'll have to do other stuff, too.

There's stuff here:
https://wiki.freebsd.org/A_Brief_Guide_To_Cross_Compiling_FreeBSD

-- 
--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHHBGkpgLQBhfF3qV09m5ANAggcLyMeZO9_ig3iMz-VMJ-Vx2A>