Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Feb 2010 18:51:37 -0600
From:      Peter Steele <psteele@maxiscale.com>
To:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   RE: What is easiest way to build a BSD 8 binary on a BSD 7 box?
Message-ID:  <7B9397B189EB6E46A5EE7B4C8A4BB7CB383B255E@MBX03.exg5.exghost.com>
In-Reply-To: <7B9397B189EB6E46A5EE7B4C8A4BB7CB383B2501@MBX03.exg5.exghost.com>
References:  <7B9397B189EB6E46A5EE7B4C8A4BB7CB383B24D6@MBX03.exg5.exghost.com> <201002070227.48003.pieter@degoeje.nl> <7B9397B189EB6E46A5EE7B4C8A4BB7CB383B2501@MBX03.exg5.exghost.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>The easiest way would probably be the following.
>
># SOMEDIR=3D/path/to/fbsd8buildenv
># mkdir -p ${SOMEDIR}
># cd /path/to/FreeBSD-8.0/src
># make buildworld
># make installworld DESTDIR=3D${SOMEDIR}
>
>Then adding --sysroot=3D${SOMEDIR} to all invocations of gcc/ld and/or lib=
eral use of -I and -L gcc options should do the trick.
>
>For example:
># export CFLAGS=3D"-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 t=
he libraries are coming from my BSD 8 repository. My makefile is generating=
 gcc commands that look like this:

gcc -m64 -DHAVE_INT64_T --sysroot=3D/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 B=
SD 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?




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