From 1d5e1f578cd14a15cbdaa09086302ffebda1462d Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 29 Dec 2009 14:59:08 -0800 Subject: [PATCH] Document how to build gccgo to use gold. This provides full support for discontiguous stacks. R=r CC=golang-dev https://golang.org/cl/183088 --- doc/gccgo_install.html | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/doc/gccgo_install.html b/doc/gccgo_install.html index 587e4dd8fc5..5766f91142a 100644 --- a/doc/gccgo_install.html +++ b/doc/gccgo_install.html @@ -43,21 +43,47 @@ using the configure option --with-arch=i586 run).

+

+On x86 GNU/Linux systems the gccgo compiler is able to +use a small discontiguous stack for goroutines. This permits programs +to run many more goroutines, since each goroutine can use a relatively +small stack. Doing this requires using a development version of +the gold linker. The easiest way to do this is to build +the GNU binutils, using --enable-gold when you run +the configure script, and to +use --with-ld=GOLD_BINARY when you +configure gccgo. A typical sequence would look like +this (you can replace /opt/gold with any directory to +which you have write access): +

+ +
+cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src login
+[password is "anoncvs"]
+cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src co binutils
+mkdir binutils-objdir
+cd binutils-objdir
+../src/configure --enable-gold --prefix=/opt/gold
+make
+make install
+
+

A number of prerequisites are required to build gcc, as -described on the gcc web site. If those are all -available, then a typical build and install sequence would look like -this: +described on the gcc web site. If +those are all available, then a typical build and install sequence +would look like this (only use the --with-ld option if +you built and installed the gold linker as described above): +

 svn checkout svn://gcc.gnu.org/svn/gcc/branches/gccgo gccgo
 mkdir objdir
 cd objdir
-../gccgo/configure --enable-languages=c,c++,go
+../gccgo/configure --enable-languages=c,c++,go --with-ld=/opt/gold/bin/ld
 make
 make install
 
-

Using gccgo