suicidally ambitious compilation?

Norbert Koch NKoch at demig.de
Thu Jul 21 15:57:13 GMT 2005


> > > I'm thinking of setting up a jail specifically to try and compile an
> > > OpenBSD release on FreeBSD. No 'cross compiling' will be
> involved (same
> > > target hardware architecture).
> > >
> > > Has anybody here ever tried, or heard of anybody trying this?
> > >
> > > I don't expect the journey to be without large potholes...
> >
> > That won't work. A jail is not something like vmware. It's
> > just a FreeBSD inside a FreeBSD.
> > I used emulators/qemu to install NetBSD into an
> > image file from the installation cd. That worked for me
> > as long as I did not try to start X inside qemu.
> > So I think that OpenBSD will work too.
> > (Interestingly the Knoppix live-cd runs emulated
> > even in graphics mode!)
>
> Hi.
>
> I should have explained myself a little better. What I'm actually trying
> to do is compile a minimal OpenBSD snapshot so that I can
> distribute binaries
> to my very slow firewall machine (which also lacks a compiler, for
> security reasons). The jail is purely there because the OpenBSD
> compilation process seems to make the assumption that it's working in
> /usr/src so I thought it would be a good idea to partition the process
> off from the rest of the system.

Although I think it is possible, to build OpenBSD under FreeBSD, I wouldn't
try it.
The problem is to correctly re-create the _complete_ OpenBSD build
environment.
That means compiler, linker, make, and other tools that may be used for
building.
For the compiler, that means to build a cross compiler. The cpu may be the
same,
but gcc is always configured for a combination of <operating system/target
cpu/binary format>.
And you have to find out what gcc version OpenBSD is usually been built
with.
Other tools may differ in behaviour or command line options. For example,
may be FreeBSD is using a gnu tool while OpenBSD is using a non-gnu tool.
What about e.g. make? There is make and gmake under FreeBSD.

So again I suggest you try the qemu solution (or buy an additional computer
;-).

Norbert



More information about the freebsd-questions mailing list