building cross compiler in OS X?

Kai Ruottu kai.ruottu@wippies.com
Fri May 29 09:18:00 GMT 2009


Geoff Oltmans wrote:
> Hello!
> 
> I'm trying to build a gcc cross compiler for a coldfire target on a 
> Intel OS X  (10.5.7) machine. I get the following error when trying to 
> build (in libgcc):
> 
> checking for suffix of object files... configure: error: cannot compute 
> suffix of object files: cannot compile
> 
> This is while compiling under: i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 
> (Apple Inc. build 5490)
> 
> I'm building gcc-4.3.3, using mpfr-2.4.1 and gmp-4.1.4.
> 
> Here's the configure line I used:
> 
> ./gcc-4.3.3/configure --target=m68k-elf --program-prefix=cf- --with-arch=cf

What was the configure command with GNU binutils?  An assembler for
m68k-elf and a linker for m68k-elf are separate from the native
i686-apple-darwin9 ones...  Having the target binutils and the target
C library installed before starting to build GCC are the default
prerequisites...

The GCC build tries to check the target C library unless one uses
the '--with-newlib' in the GCC configure. Then only the newlib
headers (from 'newlib/libc/include' in the newlib sources) will
be needed to seen in '$prefix/$target/include' and
'$prefix/$target/sys-include' (the second a symlink to the first).
In your case the $prefix will be '/usr/local' when no '--prefix=$prefix'
was given...

> /Users/Oltmans/Downloads/gccbuild/./gcc/xgcc 
> -B/Users/Oltmans/Downloads/gccbuild/./gcc/
 > -B/usr/local/m68k-elf/bin/

The target 'as' and 'ld' should be here...

> -B/usr/local/m68k-elf/lib/

The target C library binaries could be here...

 > -isystem /usr/local/m68k-elf/include
 > -isystem /usr/local/m68k-elf/sys-include

The target C library headers should be here...

> /Users/Oltmans/Downloads/gccbuild/./gcc/as: line 77: exec: : not found

Probaly this script points to the native i686 'as'...



More information about the Gcc-help mailing list