compiling system binutils as cross tools
Robert Watson
rwatson at FreeBSD.org
Thu May 21 10:20:22 UTC 2009
On Thu, 21 May 2009, xorquewasp at googlemail.com wrote:
> How do I compile the system binutils (contrib/binutils) as i386 -> x86_64
> cross utils? That is, binutils that will run on an i386 host but will
> produce x86_64 binaries?
>
> I'm trying to produce a bootstrapping compiler for a port and need to get
> these working. I've spent a while reading Makefiles but would rather get
> information from someone who actually knows rather than waste *another* week
> on this stuff.
>
> I'd rather not compile the entire world if it can be avoided.
Not really my area, but if you haven't found "make toolchain" and "make
buildenv" then you might want to take a look. Typically these will be
combined with TARGET_ARCH=foo, and in your case foo is 'amd64'. The former
builds the toolchain required for the architecture, and the latter creates a
shell environment with paths appropriately munged and environments
appropriately set to cross-compile using that chain. Normally the toolchain
step is part of our integrated buildworld/buildkernel/etc process, but you can
also use it for other things with buildenv.
Robert N M Watson
Computer Laboratory
University of Cambridge
More information about the freebsd-hackers
mailing list