From owner-freebsd-arch@FreeBSD.ORG Sun Feb 13 08:05:11 2005 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E5DF516A4CF for ; Sun, 13 Feb 2005 08:05:10 +0000 (GMT) Received: from mail25.sea5.speakeasy.net (mail25.sea5.speakeasy.net [69.17.117.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 46A8E43D2F for ; Sun, 13 Feb 2005 08:05:10 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: (qmail 10501 invoked from network); 13 Feb 2005 08:05:09 -0000 Received: from gate.funkthat.com (HELO hydrogen.funkthat.com) ([69.17.45.168]) (envelope-sender ) by mail25.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 13 Feb 2005 08:05:09 -0000 Received: from hydrogen.funkthat.com (forgfe@localhost.funkthat.com [127.0.0.1])j1D859GH082888; Sun, 13 Feb 2005 00:05:09 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.10/8.12.10/Submit) id j1D8582H082885; Sun, 13 Feb 2005 00:05:08 -0800 (PST) Date: Sun, 13 Feb 2005 00:05:08 -0800 From: John-Mark Gurney To: "David O'Brien" Message-ID: <20050213080508.GB40468@funkthat.com> Mail-Followup-To: David O'Brien , freebsd-arch@FreeBSD.org References: <20050213001752.GA40468@funkthat.com> <20050213062910.GC83950@dragon.nuxi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050213062910.GC83950@dragon.nuxi.com> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html cc: freebsd-arch@FreeBSD.org Subject: Re: buildenv target X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Feb 2005 08:05:11 -0000 David O'Brien wrote this message on Sat, Feb 12, 2005 at 22:29 -0800: > On Sat, Feb 12, 2005 at 04:17:52PM -0800, John-Mark Gurney wrote: > > Does anyone object to adding a buildenv target to our Makefile, so that > > when crossbuilding you can get the tools setup in a shell. Useful for > > doing crossbuild testing w/ a cross-built world eaiser. > .. > > so: > > bash-2.05b$ which config > > /usr/sbin/config > > bash-2.05b$ make buildenv TARGET_ARCH=arm > > Entering world for arm:arm > > bash-2.05b$ which config > > /usr/obj/arm/usr/home/jmg/arm/src/i386/legacy/usr/sbin/config > > I don't quite follow what you're going to do with in it. > The problem is the more we bend this to do what the random person wants > to do we build a garantium thing that is hard to change w/o breaking some > "established" behavior. Much like the huge mess we had in binutils to > support cross assembling to non-FreeBSD platforms. what you can do with it is: cd ~jmg/arm/src/sys/arm/conf config TS7200 cd ../../compile/TS7200 make depend && make -j 4 and now hack to your hearts content on an arm kernel on your i386 box with out having to do things like cognet suggests on his arm text file (from http://people.freebsd.org/~cognet/freebsd_arm.txt): make TARGET_ARCH=arm TOOLS_PREFIX=/usr/cross depend all make TARGET_ARCH=arm TOOLS_PREFIX=/usr/cross DESTDIR=/usr/cross install Then go in /usr/src/gnu/usr.bin/binutils, and do : make TARGET_ARCH=arm TOOLS_PREFIX=/usr/cross depend all make TARGET_ARCH=arm TOOLS_PREFIX=/usr/cross DESTDIR=/usr/cross install You should get what is needed to cross-compile a kernel. You need to set the following environment varibles for cross-compiling : export CC=/usr/cross/usr/bin/gcc export AS=/usr/cross/usr/bin/as export NM=/usr/cross/usr/bin/nm export RANLIB=/usr/cross/usr/bin/ranlib export LD=/usr/cross/usr/bin/ld export OBJCOPY=/usr/cross/usr/bin/objcopy export SIZE=/usr/cross/usr/bin/size export MACHINE=arm export MACHINE_ARCH=arm Then you can compile the kernel the usual way, ie : cd /sys/arm/conf config IQ31244 cd ../compile/IQ31244 && make depend all so, you now do: make buildworld TARGET_ARCH=arm make buildenv TARGET_ARCH=arm and build your kernel as you normally would... a bit easier, wouldn't you say? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."