From owner-freebsd-current@FreeBSD.ORG Mon Jun 30 20:07:23 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5F99D37B401 for ; Mon, 30 Jun 2003 20:07:23 -0700 (PDT) Received: from kientzle.com (h-66-166-149-50.SNVACAID.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 89DAE43FE9 for ; Mon, 30 Jun 2003 20:07:22 -0700 (PDT) (envelope-from kientzle@acm.org) Received: from acm.org (big.x.kientzle.com [66.166.149.54] (may be forged)) by kientzle.com (8.12.9/8.12.9) with ESMTP id h6137LtJ004648; Mon, 30 Jun 2003 20:07:22 -0700 (PDT) (envelope-from kientzle@acm.org) Message-ID: <3F00FB8A.10607@acm.org> Date: Mon, 30 Jun 2003 20:10:02 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.0.1) Gecko/20021005 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Marcel Moolenaar References: <20030630222353.GH57432@sunbay.com> <20030630222820.GV70590@roark.gnf.org> <20030630225206.GA57854@ns1.xcllnt.net> <20030630235402.GC70590@roark.gnf.org> <20030701003516.GA3516@dhcp01.pn.xcllnt.net> Content-Type: multipart/mixed; boundary="------------090203060106090001000100" cc: current@freebsd.org Subject: Re: rescue/ broke cross compiles X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: kientzle@acm.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2003 03:07:23 -0000 This is a multi-part message in MIME format. --------------090203060106090001000100 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Marcel Moolenaar wrote: > On Mon, Jun 30, 2003 at 04:54:02PM -0700, Gordon Tetlow wrote: >>>That's why ru@ suggested to add a build-tools target. That way you >>>populate the seperate tree in sync with the phases of a world, >>>thereby avoiding the phase ordering problem. >> >>Is there a way to leverage the existing build-tools so we don't have >>to do extra compiling that isn't necessary? > > Build tools are most of the time so small or trivial (gcc is > probably the exception, before that perl probably was) that > building them again is lost in creating the rescue bits itself. > We could possibly copy the object directory of those tools that > have build tools, but if there are paths embedded in generated > scripts, we have to regenerate them anyway. > > What about this: rebuild the build tools to get things sorted > out and working and then look if we can optimize? Looking through the build tools for /bin/sh, it's definitely not worth the effort to try copying build tools around. Although it sounds easy to add a build-tools target to handle this, I'm not sure I see exactly how to do this. Any suggestions? For the longer term, perhaps it would be desirable to simply eliminate as many of the build-tools as possible? For example, the attached is a pretty close substitute for mkinit.c in the /bin/sh build. It's crude, but it seems to work and eliminates the need to compile mkinit at build time. I'll see if I can scrape together something similar for the other /bin/sh tools. Tim Kientzle --------------090203060106090001000100 Content-Type: text/plain; name="mkinit.sh" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mkinit.sh" #!/bin/sh echo "/*" echo " * This file was generated by the mkinit program." echo " */" echo "" echo '#include "shell.h"' echo '#include "mystring.h"' cat $@ | grep '^INCLUDE' | sed -e "s/INCLUDE/#include/" echo echo echo cat $@ | sed -n -e '/^#define/ s/#define //p' | grep -v '\\$' | egrep -v '^[A-Z_]+\(' | awk '{print "#undef ",$1; print "#define",$0; }' echo echo for f in $@ do cat $f | sed -n -e '/^MKINIT$/,/^}/ p' -e '/^MKINIT / s/^MKINIT/extern/p' | grep -v '^MKINIT$' echo done echo echo echo "/*" echo " * Initialization code." echo " */" echo echo "void" echo "init() {" for f in $@ do echo " /* from $f: */" cat $f | sed -n -e '/^INIT/,/^}/ p' | sed -e 's/INIT //' | \ awk '{print " ",$0;}' OFS='' echo done echo "}" echo echo echo echo "/*" echo " * This routine is called when an error or an interrupt occurs in an" echo " * interactive shell and control is returned to the main command loop." echo " */" echo echo "void" echo "reset() {" for f in $@ do echo " /* from $f: */" cat $f | sed -n -e '/^RESET/,/^}/ p' | sed -e 's/RESET //' | \ awk '{print " ",$0;}' OFS='' echo done echo "}" echo echo echo echo "/*" echo " * This routine is called to initialize the shell to run a shell procedure." echo " */" echo echo "void" echo "initshellproc() {" for f in $@ do echo " /* from $f: */" cat $f | sed -n -e '/^SHELLPROC/,/^}/ p' | sed -e 's/SHELLPROC //' | \ awk '{print " ",$0;}' OFS='' echo done echo "}" --------------090203060106090001000100--