Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 1 down vote accepted

GCC is included with XCode but if you really just need GCC, I also found this project on GitHub for the OSX GCC installer.

The osx-gcc-installer allows you to install the essential compilers from either pre-built binary packages or helps you create your own installer.

For Lion and Mountain Lion users, Apple now provides an official Command Line Tools for Xcode package that you can install without needing to install Xcode itself! You can download it from Apple's developer site. If you still need gcc-4.2, and you use Homebrew, you can install it using the apple-gcc42 package from homebrew/dupes.


Okay, go get the older 4.0 package that was included with XCode 3.1 from Apples Open Source page

Download the gcc-5493 package and I tested compiling using instructions from the README.Apple

BUILDING, THE APPLE WAY didn't work for me but the BUILDING, THE FSF WAY worked with modification...

To build things the FSF WAY way i need to add the --enable-languages=objc,c++,obj-c++ to restrict languages. Something was causing it to error out and I don't have time to figure out which one. But using below successfully compiled.

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

Also make sure you have XCode and Command line tools installed

Using built-in specs.
Target: i686-apple-darwin12.2.0
Configured with: ../configure --prefix=/tmp/testplace --enable-languages=objc,c++,obj-c++
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5493)
share|improve this answer
Actually I'm search for gcc-4.0, not 4.2. gcc-4.2 does not work for my needs. – Frizlab Nov 3 '12 at 6:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.