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

Kai Wang kaiwang27 at gmail.com
Thu Feb 21 13:41:12 UTC 2008

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.

Best Regards,

More information about the freebsd-current mailing list