Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Feb 2010 02:33:58 +0100
From:      Pieter de Goeje <pieter@degoeje.nl>
To:        freebsd-questions@freebsd.org
Cc:        Peter Steele <psteele@maxiscale.com>
Subject:   Re: What is easiest way to build a BSD 8 binary on a BSD 7 box?
Message-ID:  <201002080233.59464.pieter@degoeje.nl>
In-Reply-To: <7B9397B189EB6E46A5EE7B4C8A4BB7CB383B255E@MBX03.exg5.exghost.com>
References:  <7B9397B189EB6E46A5EE7B4C8A4BB7CB383B24D6@MBX03.exg5.exghost.com> <7B9397B189EB6E46A5EE7B4C8A4BB7CB383B2501@MBX03.exg5.exghost.com> <7B9397B189EB6E46A5EE7B4C8A4BB7CB383B255E@MBX03.exg5.exghost.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 08 February 2010 01:51:37 Peter Steele wrote:
> >The easiest way would probably be the following.
> >
> ># SOMEDIR=/path/to/fbsd8buildenv
> ># mkdir -p ${SOMEDIR}
> ># cd /path/to/FreeBSD-8.0/src
> ># make buildworld
> ># make installworld DESTDIR=${SOMEDIR}
> >
> >Then adding --sysroot=${SOMEDIR} to all invocations of gcc/ld and/or
> > liberal use of -I and -L gcc options should do the trick.
> >
> >For example:
> ># export CFLAGS="-I${SOMEDIR}/usr/include -L${SOMEDIR}/lib
> > -L${SOMEDIR}/usr/lib # make
>
> I've done this and it's clearly working, at least in the sense I can tell
> the libraries are coming from my BSD 8 repository. My makefile is
> generating gcc commands that look like this:
>
> gcc -m64 -DHAVE_INT64_T --sysroot=/usr/local/buildrepo/bsd/v8/obj
> -L/usr/local/buildrepo/bsd/v8/obj/usr/lib ...
>
> I know it's working because if I rename the directory pointed to by sysroot
> the link fails. My tool is still failing though in exactly the same way in
> a call to kvm_read. The same call works fine when the tool is built on a
> BSD 8 box. Is there anything else I need to do to make sure the BSD 7 built
> binary is a fully complaint BSD 8 binary?

You could check that the tool is actually linked to the correct libraries with 
ldd(1). If all else fails, you could try building a full FreeBSD 8 jail or 
chroot. However running FBSD 8 userland on a 7 kernel is unsupported so I 
have no idea if that will actually work well enough to build software...

-- 
Pieter de Goeje



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