Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I compile GCC on a mac so compiled executables will work on earlier versions of OS X?

I'm attempting to build a program (Dwarf Fortress) that uses C++0x features that aren't well supported in the latest Leopard version of XCode. As there is also a significant speed boost from using GCC 4.5, we've decided to build our own.

However, this causes the resulting executables to not work on Tiger, citing missing symbols in libc. Presumably, GCC is being built against the Leopard SDK, not the installed Tiger SDK, which is reasonable but annoying. How would I make it build against Tiger's?

like image 892
Baughn Avatar asked Nov 05 '22 08:11

Baughn


1 Answers

You need to pass -mmacosx-version-min=10.5 to ld, which will tell it to link against the appropriate symbols in libc.

like image 129
Ben Stiglitz Avatar answered Nov 09 '22 09:11

Ben Stiglitz