So far I've successfully launched the configure, but when I type make, I get the following error, after some time (there's a lot which compile successfully):

ld: unknown/unsupported architecture name for: -arch i686
/usr/bin/libtool: internal link edit command failed
make[2]: *** [libgcc_s.dylib] Error 1
make[1]: *** [libgcc.a] Error 2
make: *** [all-gcc] Error 2

Is there a way to tell gcc not to compile itself for the i686 architecture?

Here's my uname -a if it can help:

Darwin Frizlabs-Computer.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64

PS: I know gcc-4.0 is ancient, but I do need it.

  • Wh do you need gcc 4.0, surely better to fix that reason, and perhaps easier – Mark Nov 3 '12 at 12:28
  • I want to compile SheepShaver, which is a complex project and only compiles (AFAIK) with gcc-4.0. Trust me, if I could avoid compiling gcc-4.0, I would! – Frizlab Nov 3 '12 at 13:31
  • The macports port of sheepshaver seems to use the standard Apple compiler and the home page seems to show no need for gcc 4.0 (+ there are binaries there) – Mark Nov 3 '12 at 13:37
  • Using the default compiler (clang) does not work at all (the compiler crashes while compiling! I've submitted a bug report to Apple). I've also tried compiling with gcc-4.2, using the same command lines/patches used in MacPorts. The program compiles but does not work. I read somewhere SheepShaver had to be compiled with gcc-4.0, that's why I'm trying to compile it first as its not available anywhere in binary form on Mountain Lion. – Frizlab Nov 3 '12 at 13:56
  • re binaries click on the binary links to emaculation.com/forum/… – Mark Nov 3 '12 at 14:12

Someone on serverfault answered the same question. So here's the way to compile gcc-4.0 on OS X Mountain Lion (copied from serverfault):

First get the old 4.0 package that was included with XCode 3.1 from Apple's Open Source page

Download the gcc-5493 package and build using:

mkdir darwin
cd darwin
../configure --prefix=/tmp/testplace --enable-languages=objc,c++
make bootstrap
make install

I just compiled the dev version from a git clone and it compiles with gcc 4.7.2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .