From owner-freebsd-questions@FreeBSD.ORG Mon Feb 8 01:35:20 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 866BD106566B for ; Mon, 8 Feb 2010 01:35:20 +0000 (UTC) (envelope-from pieter@degoeje.nl) Received: from smtp.utwente.nl (smtp2.utsp.utwente.nl [130.89.2.9]) by mx1.freebsd.org (Postfix) with ESMTP id 2305B8FC16 for ; Mon, 8 Feb 2010 01:35:19 +0000 (UTC) Received: from nox-laptop.student.utwente.nl (nox-laptop.student.utwente.nl [130.89.160.140]) by smtp.utwente.nl (8.12.10/SuSE Linux 0.7) with ESMTP id o181Xx0E018259; Mon, 8 Feb 2010 02:33:59 +0100 From: Pieter de Goeje To: freebsd-questions@freebsd.org Date: Mon, 8 Feb 2010 02:33:58 +0100 User-Agent: KMail/1.9.10 References: <7B9397B189EB6E46A5EE7B4C8A4BB7CB383B24D6@MBX03.exg5.exghost.com> <7B9397B189EB6E46A5EE7B4C8A4BB7CB383B2501@MBX03.exg5.exghost.com> <7B9397B189EB6E46A5EE7B4C8A4BB7CB383B255E@MBX03.exg5.exghost.com> In-Reply-To: <7B9397B189EB6E46A5EE7B4C8A4BB7CB383B255E@MBX03.exg5.exghost.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201002080233.59464.pieter@degoeje.nl> X-UTwente-MailScanner-Information: Scanned by MailScanner. Contact icts.servicedesk@utwente.nl for more information. X-UTwente-MailScanner: Found to be clean X-UTwente-MailScanner-From: pieter@degoeje.nl X-Spam-Status: No Cc: Peter Steele Subject: Re: What is easiest way to build a BSD 8 binary on a BSD 7 box? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 01:35:20 -0000 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