From owner-freebsd-current@FreeBSD.ORG Fri Feb 22 10:24:13 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2053B16A405; Fri, 22 Feb 2008 10:24:13 +0000 (UTC) (envelope-from rermilov@team.vega.ru) Received: from mail.vega.ru (infra.dev.vega.ru [90.156.167.14]) by mx1.freebsd.org (Postfix) with ESMTP id C654A13C474; Fri, 22 Feb 2008 10:24:11 +0000 (UTC) (envelope-from rermilov@team.vega.ru) Received: from [87.242.97.68] (port=60019 helo=edoofus.dev.vega.ru) by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68 (FreeBSD)) (envelope-from ) id 1JSV4c-000BEm-Mg; Fri, 22 Feb 2008 10:24:10 +0000 Received: from edoofus.dev.vega.ru (localhost [127.0.0.1]) by edoofus.dev.vega.ru (8.14.2/8.14.2) with ESMTP id m1MAO9aW094152; Fri, 22 Feb 2008 13:24:09 +0300 (MSK) (envelope-from rermilov@team.vega.ru) Received: (from ru@localhost) by edoofus.dev.vega.ru (8.14.2/8.14.2/Submit) id m1MAO95H094151; Fri, 22 Feb 2008 13:24:09 +0300 (MSK) (envelope-from rermilov@team.vega.ru) X-Authentication-Warning: edoofus.dev.vega.ru: ru set sender to rermilov@team.vega.ru using -f Date: Fri, 22 Feb 2008 13:24:09 +0300 From: Ruslan Ermilov To: obrien@freebsd.org, Kai Wang , "Dag-Erling C. Smorgrav" , Joseph Koshy , current@freebsd.org Message-ID: <20080222102409.GD57428@team.vega.ru> References: <20080221131209.GA2022@plan0.kaiwan.csbnet.se> <20080221140247.GC2022@plan0.kaiwan.csbnet.se> <20080221143351.GP57756@deviant.kiev.zoral.com.ua> <20080221152549.GB21518@team.vega.ru> <20080221173150.GA93693@dragon.NUXI.org> <20080222070728.GA56282@team.vega.ru> <20080222091642.GB57428@team.vega.ru> <20080222093234.GB17107@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080222093234.GB17107@dragon.NUXI.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Subject: Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2008 10:24:13 -0000 On Fri, Feb 22, 2008 at 01:32:34AM -0800, David O'Brien wrote: > On Fri, Feb 22, 2008 at 12:16:42PM +0300, Ruslan Ermilov wrote: > > Here's the promised patch. What it does: > > - Switch again to using BSD ar(1) by default, but provide a knob > > to use GNU ar(1) as the system ar(1). (Option WITH_BSDAR is > > replaced with option WITH_GNUAR.) > > > > - Install BSD ar(1) as bsdar(1) with the necessary links: > > bsdranlib(1), ar(1), and ranlib(1) (the latter two unless we > > build WITH_GNUAR). > .. > > - ar.1 moved to bsdar.1 along with some bugfixing. > > I don't quite follow what you want the end state to be. If it is to > quickly convert to the new BSDLed ar & ranlib, then I don't care for the > "creatation" of a bsdar binary and manpage (below you delete > src/usr.bin/ar/ar.1 and create bsdar.1). The FreeBSD 8 official 'ar' > should have its man page named "ar.1" - I don't see what is gained > otherwise. bsdtar could be mentioned as an example where we went this > path - but I think bsdtar (and associated libarchive) has a large life > outside of FreeBSD. I really see that for 'ar'. > I don't mind reverting this. > > - Handle upgrades nicely: use GNU ar(1) during the build on older > > systems, and use BSD ar(1) on newer systems. > > If we need GNU ar for the upgrade path - then lets just install it (and > its manage) as gnu-ar and let that be that. > I don't get you, GNU ar(1) is always installed. Only the name is changes. But let me explain more about the upgrades. Currently, we always build binutils as part of cross-tools, including GNU ar(1) and ranlib(1). These binaries are then used during the build. The BSD ar(1) doesn't need to be a cross-tool -- it doesn't depend on TARGET_ARCH/TARGET and is platform-neutral. (I hope I'm right about it, otherwise it all doesn't make sense and cross-builds are broken.) We could just use /usr/bin/ar and don't bother bootstrapping it if we knew it's a BSD ar(1) without known bugs (determined by __FreeBSD_version). If it has compatibility issues or bugs, we can bootstrap it. Unfortunalely, since we provide the WITH_GNUAR option, we don't know if /usr/bin/ar and /usr/bin/ranlib are GNU or BSD versions, so we should always bootstrap BSD ar(1). The short version is as simple as this: You have You specified ar(1) used for builds =================== ======================= ===================== OS before bsdar WITH_GNUAR GNU ar OS before bsdar - GNU ar OS after bsdar WITH_GNUAR GNU ar OS after bsdar - BSD ar (*) (*) We need to bootstrap BSD ar(1) because we don't know if /usr/bin/ar is GNU ar(1) or BSD ar(1), and GNU ar(1) for one arch cannot be used to cross-build to a different arch. Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer