Re: Cross-compiling CURRENT

From: Ruslan Ermilov <ru_at_freebsd.org>
Date: Fri, 11 Nov 2005 23:13:13 +0200
On Fri, Nov 11, 2005 at 12:59:45PM -0800, Nate Eldredge wrote:
> Hi all,
> 
> I have a test machine "tester" on which I am tracking CURRENT.  However 
> the machine is old and slow and takes a long time to compile the source. 
> I want to do the compilation on another machine "builder" which is faster. 
> However "builder" is a production machine running 5.4-RELEASE, with its 
> own copy of the 5.4 source, and I want to leave that as it is.  To further 
> complicate matters "tester" is i386 while "builder" is amd64, so I must 
> cross compile by setting TARGET_ARCH=i386.
> 
> I have run into various snags while doing this and I was just wondering if 
> there is a "right" way to do this, or if anyone has any useful advice.  I 
> have read the section of the handbook on "Tracking for Multiple Machines" 
> but it assumes the test and build machines are homogeneous, which is not 
> my situation.
> 
> The first problem is that "tester" has various compilation options set in 
> its /etc/make.conf which disagree with those of "builder".  I worked 
> around this by setting the undocumented __MAKE_CONF to point to tester's 
> make.conf when compiling on builder.  Is this right?
> 
> After this "builder" is able to compile the whole tree, but there are 
> problems trying to install it on "tester" due to path names.  Currently on 
> "builder" the source resides in /foo/src and is compiled into /bar/obj (by 
> setting MAKEOBJDIRPREFIX to /bar/obj).  These are NFS mounted on 
> tester:/usr/src and tester:/usr/obj.  But when I run "make install" in 
> tester:/usr/src, it looks for the binaries in /usr/obj/usr/src/* whereas 
> they really appear in /usr/obj/i386/foo/src/*.  I could correct this with 
> symlinks, or by creating and mounting on tester:/foo/src and 
> tester:/bar/obj so that the paths agree, but this is sort of annoying. 
> Any better ways?
> 
> Lastly, I would rather have src/ and obj/ mounted read-only on tester. 
> (The filesystem on builder where they are located already has some other 
> things NFS-exported readonly, and as you probably know FreeBSD won't allow 
> you to export directories from the same fs with different options.)  Is 
> this going to work, or do these have to be writable for install to 
> succeed?
> 
The only way it can work is to do everything on builder, including
installing bits on tester.  I do this by NFS-mounting /, /var and
/usr partitions from tester on builder's /mnt, and doing install
(kernel+world) with the same options as build*, and specifying
DESTDIR=/mnt.  Make sure to "chflags -R 0" on tester before doing
this for the first time.  I also use top-level "distrib-dirs" and
"distribution" targets with TARGET_ARCH to populate
/mnt/var/tmp/`date +%Y%m%d` directory, to update /etc etc.
I have no idea if mergemaster(8) works with TARGET_ARCH and/or
DESTDIR.


Cheers,
-- 
Ruslan Ermilov
ru_at_FreeBSD.org
FreeBSD committer

Received on Fri Nov 11 2005 - 20:13:41 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:47 UTC