gccgo on illumos and Solaris (x86_64/SPARC)

760 views
Skip to first unread message

Devon H. O'Dell

unread,
Apr 6, 2012, 4:24:52 AM4/6/12
to golang-nuts
Hi all,

Just wanted to send a note that I managed to get a relocatable,
multi-lib gccgo (from gcc-4.7.0) to compile with a little help from
Ian, Aram, and a search engine. I'm happy to share my insight but I'd
like to get something easier to automate first (as well as submit a
couple of patches if they're not already there) before I post
instructions. It's working fine -- if you were holding back at work
because you needed support for Solaris and / or SPARC, you don't have
to anymore :)

Also thanks for the help, guys.

--dho

Dave Cheney

unread,
Apr 6, 2012, 4:46:57 AM4/6/12
to Devon H. O'Dell, golang-nuts
awesome work!

Sent from my iPad

Andrew Wilkins

unread,
Apr 6, 2012, 10:47:19 PM4/6/12
to golan...@googlegroups.com
On Friday, 6 April 2012 16:24:52 UTC+8, Devon H. O'Dell wrote:

instructions. It's working fine -- if you were holding back at work
because you needed support for Solaris and / or SPARC, you don't have
to anymore :)

 
Cool! Very keen to hear more.
Now I just need HP-UX PA-RISC, zLinux, POWER Linux, and POWER AIX ;)

Aram Hăvărneanu

unread,
Jan 30, 2013, 5:14:12 PM1/30/13
to James Jackson, golan...@googlegroups.com
I should have a build script somewhere...

From what I remember, you need gcc 4.6 from SFE, and a copy of mpfr,
mpc and gmp. You need
PATH=/usr/gcc4.6/bin:/usr/sfw/bin:/usr/gnu/bin:/usr/bin or something
similar and LD_OPTIONS='-R$ORIGIN/../lib/ -R/usr/gnu/lib
-R/usr/sfw/lib'. Please note that $ORIGIN is a literal
dollar-sign-ORIGIN string, not an environment variable.

You will want to use the Solaris linker, but GNU as, so you want
something like --with-as=/usr/sfw/bin/gas --with-gnu-as
--with-ld=/usr/bin/ld --without-gnu-ld --with-gmp=/usr/gnu
--with-mpfr=/usr/gnu --with-mpc=/usr/gnu --disable-nls
--with-build-time-tools=/usr/sfw.

--enable-static used to be required, not sure if that's still the case.

After you compile gccgo, you probably want
LD_OPTIONS='-R$ORIGIN/../gccgo/lib -R$ORIGIN/../gccgo/lib/$ISALIST'
when compiling Go bianaries.

Note that the gold linker is not available on Solaris, so you don't
get small stacks and goroutines are mapped onto threads.

--
Aram Hăvărneanu
Reply all
Reply to author
Forward
0 new messages