http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47762
--- Comment #15 from Iain Sandoe <iains at gcc dot gnu.org> 2012-04-18 12:31:06 UTC --- (In reply to comment #14) > But anyway -static-libstdc++ works on Linux too to avoid the link-time > problem. > Still (on x86_64-linux) the testcase runs Ok for me. OK. Just for the record - in case anyone is trying permutations; libc, libm, libpthread etc. are combined into libSystem.dylib on Darwin - which is always required to be a dynamic link for User space code. The compiler target libraries (less the NeXT objc one) can be linked statically - including libgomp (since pthreads are always available via libSystem), so static-lib{stdcc++, fortran, gcc} will work (barring other errors). Note, however, that using -static-libgcc will *only* work so long as you don't want to use any library [other than libSystem] or framework from /usr/lib or /System or /Library that uses the unwinder. Also, there is another (so far unhandled) bug with unwind generated by gcc > 4.5 - if you want to test code 'by hand' you should do DYLD_LIBRARY_PATH=/path/to/gcc/build/dir executable. Sorry, it's on my TODO - but only applies to Darwin 9 (Darwin >= 10 is OK, so far).