From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28518 invoked by alias); 26 Feb 2011 23:25:52 -0000 Received: (qmail 28508 invoked by uid 22791); 26 Feb 2011 23:25:51 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 26 Feb 2011 23:25:47 +0000 From: "comexk at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug go/46986] Go is not supported on Darwin X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: go X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: comexk at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ian at airs dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Sat, 26 Feb 2011 23:42:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-02/txt/msg02973.txt.bz2 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"