Solaris 11 x86 binaries for GO language

The GO programming language is an interesting one, although rarely used. It IS used for some key google projects, so getting it is important. Unfortunately, they pulled a classic opensource jerk move, by requiring that to get the latest version of it.. requires that you already have a working OLDER version of it. This becomes rather difficult if you are on a non-supported platform.

They have lots of downloads for go, but no Solaris binaries.

Bootstrap binaries

The latest versions of Go, require a PREVIOUS version of go to compile it. If you dont have a prior version, you first have to compile one of their earlier versions, to bootstrp it I managed to compile their "bootstrap" distribution, on Solaris 11 x86, as of 2018. You can use this to compile later versions of go.
(You can get the latest bootstrap source code tarfile, by going to the download page above,
then going to the bottom of the archived versions,
THEN going to "go1".
Oddly, that is where they keep the special "go 1.4" patched up distro for people to download and compile. (would be nice if they made a nice clear "bootstrap source" section in their download page)

Here is the binary distribution I made from their 20170518.tar file:
go-1.4-bootstrap-sol_amd64.tar.gz

To use, you will need to add (extractdir)/go/bin to your PATH.

Building the bootstrap yourself

If you would rather compile it yourself, here are some tips.
It is important to note, that I built it with Solaris 11.3, and gcc 4.5.
It DID NOT LIKE gcc5, or sunpro 12.4, on Solaris 11.3

Go version 1.10 binaries

Using my bootstrap go 1.4 binaries, I managed to build the latest official version of go, as of March 2018.
go1.10-solaris_amd64.tar.gz

Compiling GCCGO

Alternatively, there is a frontend for GNU gcc, that acts mostly equivalent to the standard go language. See the GCC gccgo documentation page for more details on that

See the following post, for details on compiling gccgo on solaris 11:
https://groups.google.com/forum/#!topic/golang-nuts/k-tThKdYjhg

most crucial bits seem to be:

 --with-as=/usr/sfw/bin/gas --with-gnu-as --with-ld=/usr/bin/ld --without-gnu-ld \
 --disable-nls --disable-libquadmath --disable-libssp --disable-lto --disable-libgomp

GccGo v7.3.0

(this patch require for gcc 7.3.0)

Resulting binaries for gcc 7.3.0 with gccgo frontend here:
gcc7.3go-x86-sol11.tar.gz
These will extract to /usr/local/gcc/bin.
You may have to add these to your environment:

  export LD_LIBRARY_PATH=/usr/local/gcc/lib
  export LD_LIBRARY_PATH_64=/usr/local/gcc/lib/amd64
  export PATH=/usr/local/gcc/bin:$PATH
  # and when compiling standalone executables with gcc or gccgo, you may 
  # also need
  # export LD_OPTIONS=-R/usr/local/gcc/lib

For anyone who is curious, I compiled it with the oracle provided gcc 5.4 in /usr/bin. I also needed to export OBJCOPY=gobjcopy

I successfully did: "go get golang.org/x/text", and "go test" in that source dir.

I also got it to compile and run, for solaris 11 SPARC.
gcc7.3go-sparc-sol11.tar.bz


This material is copyrighted by Philip Brown
Bolthole Top - Solaris Top - Search Bolthole.com