Cross-compiling on x86 to amd64

David O'Brien obrien at freebsd.org
Wed Dec 1 01:17:32 PST 2004


On Tue, Nov 23, 2004 at 12:45:05PM +0100, a.degroot at science.ru.nl wrote:
> For various large compiles (KDE, mostly), I'm looking into setting up a
> compile farm to produce amd64 inaries. A basic distcc setup, to start with
> (icecream, the teambuilder-alike with some pretty neat features, is still
> horribly linux-specific and I need to fix that some time), but I'm
> somewhat lacking on the number-of-amd64 machines front, as in I've got 1.
> 
> So I got to thinking: why should the x86 machines in the house get a
> break? They should be able to produce amd64 code at the least.
> 
> The system gcc on 5.3-R on x86 doesn't like -m64:
> 
> -bash-2.05b$ g++ -c -m64 t.cc
> t.cc:1: sorry, unimplemented: 64-bit mode not compiled in
> 
> which is unfortunate, because if I understand correctly, that's the only
> flag I would really need to use to make gcc on x86en produce code for
> amd64 (ie.
> 
> 	x86box$ g++ -m64 t.cc
> 	amd64box$ g++ t.cc

Nope, you need a lot more than 'gcc -m64' to be accepted.  You also need
a 64-bit capable 'as' and 'ld'.  You also need 64-bit libs (matching
what's in /lib and /usr/lib), and 64-bit /usr/include/machine headers.

We're no where near ready to support cross building for 64-bits on a
32-bit machine and vice-versa.  I've got a WIP patch set for GCC on
FreeBSD/amd64 to enable one to build 32-bit binaries, provided 32-bit
libs are available.  But it will be a little while longer until things
are ready for use.

-- 
-- David  (obrien at FreeBSD.org)


More information about the freebsd-amd64 mailing list