Date: Thu, 21 May 2009 10:49:23 -0700 From: Julian Elischer <julian@elischer.org> To: Robert Watson <rwatson@FreeBSD.org> Cc: freebsd-hackers@freebsd.org, xorquewasp@googlemail.com Subject: Re: compiling system binutils as cross tools Message-ID: <4A159423.2040500@elischer.org> In-Reply-To: <alpine.BSF.2.00.0905211116310.25537@fledge.watson.org> References: <20090521095305.GA27043@logik.internal.network> <alpine.BSF.2.00.0905211116310.25537@fledge.watson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Robert Watson wrote: > > On Thu, 21 May 2009, xorquewasp@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. I munged that once to create a nested jail/chroot set up so that default toolchain was the cross set. so if you did 'cc foo.c' you got a cross binary.. if you needed a native cc you did it in the outside chroot. worked like a charm. from the outside, you just did 'chroot cross cc foo.c' to get cross binary. > Robert N M Watson > Computer Laboratory > University of Cambridge > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A159423.2040500>