So as a fallback I used the standard gcc 4.8.1. As the base I used a SLES 11 SP3. Here are the steps:
- Check out gcc 4.8.1 using svn
svn checkout svn://gcc.gnu.org/svn/gcc/tags/gcc_4_8_1_release gcc481 - Create build directory (here build) and change to it
- Configure gcc with your favorite options, include go in it. I used
../gcc481/configure --prefix=/opt/gcc481 --enable-languages=c,c++,go --enable-shared --with-system-zlib --with-arch=z9-109 --enable-threads=posix --enable-__cxa_atexit --enable-checking --enable-lto - The configure script is going to complain on various missing or outdated packages. So you probably need to try multiple times in a clean directory.
Get the missing stuff from the SUSE DVDs and install them or build them from source. (I used gmp-4.2.3 and mpc2-0.8.2 from the SDK and compiled mpfr-3.1.2 from sources and installed in /usr/local) - make
- make install
export PATH=/opt/gcc481/bin:$PATH
export LD_LIBRARY_PATH=/opt/gcc481/lib64/:/opt/gcc481/lib/:$LD_LIBRARY_PATH
Finally you can enter the hellozworld.go program
package main
import "fmt"
func main() {
fmt.Printf("Hello, z-world\n")
}
and compile and run it with
gccgo hellozworld.go -o hellozworld
./hellozworld
If you think this is an interesting language please approach Red Hat and SUSE and ask for it in the next releases!
0 comments:
Post a Comment