Darwin cross-compile (i586): as fails on crtstuff.c

Jan Fabry distcc@scoco.be
Mon Nov 17 01:50:00 GMT 2003


Thank you for your quick reply.

I already had binutils installed (for the correct target), and the 
correct path was already included in $PATH. This directory contains 
i586-pc-linux-gnu-* symlinks, I guess this is correct? (I didn't specify 
this in the ./configure, they 'just appeared') The (gcc) Makefile seems 
to be prepared for this.

However, the Makefile picks up the path to $AS_FOR_TARGET by doing 
./gcc/xgcc -print-prog-name=as, which returns 'as'. I can understand it 
does this if it would first build 'as' (because the binutils source is 
unpacked in the same tree as the gcc source), but it seems this is not 
the case.

I can remove these lines from the Makefile, and then $AS_FOR_TARGET gets 
set to the correct file, but for the compilation, the wrong 'as' is used 
again.

So, I still have a few questions:
- If I unpack the binutils source in the same tree as gcc, will it 
'automagically' also be built and installed?
- If not, why does ./gcc/xgcc tell me 'as' is the assembler to use? How 
can I change this?

Greetings,

Jan Fabry

PS: I'm doing this for fun, just to see if it would work. That's why 
it's not a problem I only run it from an iBook, speed doesn't matter.

Dara Hazeghi wrote:
> Hello,
> 
> what you've described are the classic symptoms of
> building a cross-compiler without having the necessary
> tools installed.
> 
> You need to build and install binutils with the same
> target and prefix you're building gcc with.
> (--prefix=/opt/gcc-3.2.3 --target=i586-pc-linux-gnu).
> You should probable add $PREFIX to $PATH too (so gcc
> can find said binutils).
> 
> Once you do that though, you'll need i586 headers and
> libraries to be available. See
> <http://bytesex.org/cross-compiler.html> for instance.
> Also note that you'll need to pass the
> --with-headers=/path/to/i586/include/directory and
> --with-libs=/path/to/i586/libs flags when building
> (<http://gcc.gnu.org/install/configure.html> under the
> section about cross-compilers, ignore the stuff about
> sysroot, it's only for newer compilers).
> 
> For distcc, you can probably cheat (not use libraries,
> headers). To do that, instead of doing make for gcc,
> do make -k and make -k install. It'll break building
> the libraries, but distcc doesn't actually need them.
> You need binutils in any case.
> 
> That said, I can't imagine why you'd use an iBook on a
> distcc farm. My poor tiBook takes many hours just to
> compile gcc, and that's enough for me :-)
> 
> Cheers,
> 
> Dara
> 



More information about the Gcc-help mailing list