compiling system binutils as cross tools
Julian Elischer
julian at elischer.org
Thu May 21 17:49:24 UTC 2009
Robert Watson wrote:
>
> 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.
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 at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
More information about the freebsd-hackers
mailing list