From owner-freebsd-current@FreeBSD.ORG Thu Feb 21 16:01:18 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDFBA16A405 for ; Thu, 21 Feb 2008 16:01:18 +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 4D1CF13C45B for ; Thu, 21 Feb 2008 16:01:18 +0000 (UTC) (envelope-from rermilov@team.vega.ru) Received: from [87.242.97.68] (port=2012 helo=edoofus.dev.vega.ru) by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68 (FreeBSD)) (envelope-from ) id 1JSD9w-000IYb-2Z for freebsd-current@freebsd.org; Thu, 21 Feb 2008 15:16:28 +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 m1LFGRkS021682 for ; Thu, 21 Feb 2008 18:16:27 +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 m1LFGRXK021681 for freebsd-current@freebsd.org; Thu, 21 Feb 2008 18:16:27 +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: Thu, 21 Feb 2008 18:16:27 +0300 From: Ruslan Ermilov To: freebsd-current@freebsd.org Message-ID: <20080221151627.GA21518@team.vega.ru> References: <20080221131209.GA2022@plan0.kaiwan.csbnet.se> <20080221140247.GC2022@plan0.kaiwan.csbnet.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080221140247.GC2022@plan0.kaiwan.csbnet.se> User-Agent: Mutt/1.5.17 (2007-11-01) 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: Thu, 21 Feb 2008 16:01:18 -0000 On Thu, Feb 21, 2008 at 03:02:47PM +0100, Kai Wang wrote: > On Thu, Feb 21, 2008 at 02:12:09PM +0100, Kai Wang wrote: > > Hello list, > > > > I just committed ar(1) front-end. Note that you NEED update your > > world before you can successfully perform cross platform buildworld. > > > > You can update your system by: > > make buildworld > > ... > > make installworld > > > > or you can just install ar(1) by hand. > > (replace /usr/bin/ar and /usr/bin/ranlib by hand) > > > > This is needed because GNU Binutils ar and ranlib gets renamed to gar > > and granlib, and when you perform a cross platform buildworld, the > > build system will instead use /usr/bin/ar and /usr/bin/ranlib, which > > is not capable of cross build. > > I think it's neccessary to explain it a bit. When you start > cross-platform world build, the toolchain targarting that platform > will be built first. Then the resulting cross-platform toolchain is > used to build the world for that platform. ar(1) and ranlib(1) are > part of the toolchain. > > After I renamed them to gar and granlib, the build system can no > longer find them, as a result it will use default ones, i.e., > /usr/bin/ar and /usr/bin/ranlib, which target your current platform > and thus can not be used to cross build. > > You can solve this problem by updating your own world first, or by > replacing '/usr/bin/ar' and '/usr/bin/ranlib' with 'BSD' ar and ranlib > by hand. 'BSD' ar is platform independent and handles all the ELF > targets thus can be used directly (no need to recompile itself for > target platform) by the build system. > If BSD ar(1) is crossplatform-neutral, you just need to add it to bootstrap-tools, like this: : Index: Makefile.inc1 : =================================================================== : RCS file: /home/ncvs/src/Makefile.inc1,v : retrieving revision 1.598 : diff -u -p -r1.598 Makefile.inc1 : --- Makefile.inc1 5 Feb 2008 15:41:58 -0000 1.598 : +++ Makefile.inc1 21 Feb 2008 15:11:07 -0000 : @@ -885,8 +885,13 @@ _crunchgen= usr.sbin/crunch/crunchgen : _mklocale= usr.bin/mklocale : .endif : : +.if ${BOOTSTRAPPING} < 800022 : +_ar= usr.bin/ar : +.endif : + : bootstrap-tools: : .for _tool in \ : + ${_ar} \ : ${_mklocale} \ : ${_strfile} \ : ${_gperf} \ Then the breakage will be gone. With this change, we also bump the minimum requirement for source upgrades from 6.0-RELEASE to "7.0-CURRENT at some point" because new ar(1) requires libelf which is not available in previous releases of FreeBSD. Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer