Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

From: Ruslan Ermilov <ru_at_freebsd.org>
Date: Thu, 21 Feb 2008 18:16:27 +0300
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
: _at__at_ -885,8 +885,13 _at__at_ _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_at_FreeBSD.org
FreeBSD committer
Received on Thu Feb 21 2008 - 15:01:18 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:27 UTC