building on macos

Jeffrey Walton noloader@gmail.com
Sun Jul 14 15:13:00 GMT 2013


On Sat, Jul 13, 2013 at 2:03 PM, Timothy Schumacher, Ph.D.
<schumact@gmail.com> wrote:
> Hi All,
>
> I am trying to build gcc/binutils on my mac laptop in a similar way that I
> do on my linux boxes.  I am running into some trouble...  I *think* my basic
> question is: what build/target/host options do I need for binutils and gcc
> for it to work on the system?  My normal linux procedure is to do something
> like:
>
> in binutils,   ./configure --prefix=$prefix --disable-shared --disable-nls;
> make; make install;
> in gcc,         ./configure --prefix=$prefix --disable-shared --disable-nls
> --enable-languages=c,c++; make; make install;
>
> On my linux boxes this gives me a working binutils/gcc placed in $prefix
> that has no shared libraries and the gcc knows to use the binutils from
> inside $prefix.  This is what I would like to duplicate on my mac system if
> possible, but I have read hints here and there that suggest there is
> something about the mach-O files that binutils has a hard time with?
Apple does not provide upstream patches, so Binutils and GCC will
likely have gaps. Plus, Apple has moved on to LLVM/Clang. Its why, for
example, GCC is stuck at 4.2 and gdb-7.x does not work as expected on
OS X.

Your best would probably be to download "Command Line Tools" from
Apple. I believe its available at download.apple.com, but you have to
be logged in as a developer to see them. Apple offers a free Xcode,
and I believe you can download Command Line Tools from Xcode's
Preferences -> Downloads.

I'm not trying to talk you out of building Binutils/GCC. I'm just
pointing out you will encounter hardships and difficulties.

Jeff



More information about the Gcc-help mailing list