http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46986
comexk at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |comexk at gmail dot com --- Comment #3 from comexk at gmail dot com 2011-02-26 23:25:36 UTC --- I was able to get gcc to compile, and compile and run a trivial Go program on OS X with the attached patch. Since I know little about gcc, the patch is just a hack, but maybe it can help. The issues it addresses are: - some of the stuff that mksysinfo.sh generates doesn't compile. - The frontend hardcodes ".go_export" both in the C++ code and in the argument to objcopy, but Darwin wants both a segment and section name. - A lot of code relies on asm() for symbol names, but Darwin wants an underscore at the beginning (hardcode the underscore; obviously not a good plan). - SIGRTMIN is not defined (use SIGUSR1/2). - xnu doesn't support sem_init() (use pthreads). - the compiler seems to want an explicit -o with -c, but compiler_c_o in libtool somehow gets defined as no. - syscall.Sysctl isn't defined (I didn't bother to fix this but just commented out the only use). - a typo in libgo/runtime/go-new-map.c which is probably unrelated and belongs in another bug. GCC version: gcc-4.6-20110219 System: Mac OS X 10.6.6 (with MacPorts installed) Configuration: ./configure --prefix=/opt/gccgo --with-boot-ldflags="/opt/local/lib/libiconv.dylib /usr/lib/libiconv.dylib" --disable-bootstrap --with-ppl=/opt/local --with-cloog=/opt/local --with-mpfr=/opt/local --enable-gold=no --enable-ld=no --enable-languages=c,c++,go LDFLAGS="/opt/local/lib/libiconv.dylib /usr/lib/libiconv.dylib"