From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Tue, 12 Apr 2016 12:01:15 -0700 Message-ID: From: Skip Tavakkolian To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=94eb2c0bd15e1a123a05304e49c7 Subject: Re: [9fans] Go on Plan 9? Topicbox-Message-UUID: 8cc5888e-ead9-11e9-9d60-3106f5b1d025 --94eb2c0bd15e1a123a05304e49c7 Content-Type: text/plain; charset=UTF-8 Yes, this works and is the easier of the two methods. Using a desktop OS and starting no Go compilers: 1. download the Go 1.6 binaries for your desktop OS and install them; set GOROOT_BOOTSTRAP to that directory (e.g. /usr/local/go) 2. copy the Go 1.6 sources (either the tar.gz or git clone of sources) to your desktop OS; set GOROOT to that directory (e.g. $HOME/go) 3. build the bootstrap for Plan 9 (i.e. go-plan9-386-bootstrap.tbz) on your desktop: $ cd $GOROOT/src $ GOOS=plan9 GOARCH=386 ./bootstrap.bash if all is well, this will produce ../../go-plan9-386-bootstrap.tbz 4. untar this in your Plan 9 environment and set GOROOT_BOOTSTRAP to that directory; e.g. drawterm from your desktop OS to Plan 9: % cd $home % bunzip2 -c /mnt/term/path-to-go-plan9-386-bootstrap.tbz | tar -xv % GOROOT_BOOTSTRAP=$home/go-plan9-386-bootstrap 5. copy Go 1.6 sources to your Plan 9 fs and set GOROOT to that directory; e.g. drawterm from your desktop OS to Plan 9: % mkdir $home/go % dircp /mnt/term/path-of-GOROOT-on-desktop $home/go % GOROOT=$home/go % cd $GOROOT/src % ./all.rc If you run Plan 9 in a VM, emulator or a confined device (RPi), it will be easier/faster to cross compile your app and copy it over. E.g. to compile for 9Pi: $ GOOS=plan9 GOARCH=arm go build -Skip On Mon, Apr 11, 2016 at 5:59 PM, Chris McGee wrote: > > > It may also be possible to cross compile a bootstrap of Go from > Linux/Mac/Windows using the bootstrap.sh script after setting GOOS=plan9, > GOARCH=386 and GO386=387. That bootstrap can be placed into plan9 and used > as the GOROOT_BOOTSTRAP to compile a full Go installation on the plan9 > system. > > > --94eb2c0bd15e1a123a05304e49c7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Yes, this works and is the easier of the two methods.=C2= =A0 Using a desktop OS and starting no Go compilers:

1. downlo= ad the Go 1.6 binaries for your desktop OS and install them; set GOROOT_BOO= TSTRAP to that directory (e.g. /usr/local/go)

2. c= opy the Go 1.6 sources (either the tar.gz or git clone of sources) to your = desktop OS; set GOROOT to that directory (e.g. $HOME/go)

3. build the bootstrap for Plan 9 (i.e. go-plan9-386-bootstrap.tbz) = on your desktop:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $ cd $GOROOT/src
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $ GOOS=3Dplan9 GOARCH=3D386 ./bootstrap.= bash
=C2=A0 =C2=A0if all is well, this will produce ../../go-plan= 9-386-bootstrap.tbz=C2=A0

4. untar this in your Pl= an 9 environment and set GOROOT_BOOTSTRAP to that directory; e.g. drawterm = from your desktop OS to Plan 9:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 % cd = $home
=C2=A0 =C2=A0 =C2=A0 =C2=A0 % bunzip2 -c /mnt/term/path-to-= go-plan9-386-bootstrap.tbz | tar -xv
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = % GOROOT_BOOTSTRAP=3D$home/go-plan9-386-bootstrap

= 5. copy Go 1.6 sources to your Plan 9 fs and set GOROOT to that directory; = e.g. drawterm from your desktop OS to Plan 9:
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 % mkdir $home/go
=C2=A0 =C2=A0 =C2=A0 =C2=A0 % dircp /= mnt/term/path-of-GOROOT-on-desktop $home/go
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 % GOROOT=3D$home/go
=C2=A0 =C2=A0 =C2=A0 =C2=A0 % cd $GORO= OT/src
=C2=A0 =C2=A0 =C2=A0 =C2=A0 % ./all.rc

If you run Plan 9 in a VM, emulator or a confined device (RPi), it wi= ll be easier/faster to cross compile your app and copy it over. E.g. to com= pile for 9Pi:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $ GOOS=3Dplan9 GOARCH= =3Darm go build

-Skip


On Mon, Apr 11, 2016= at 5:59 PM, Chris McGee <sirnewton_01@yahoo.ca> wrote:<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">
It may also be possible to cross compile a bootstrap of Go from Linux/Mac/W= indows using the bootstrap.sh script after setting GOOS=3Dplan9, GOARCH=3D3= 86 and GO386=3D387. That bootstrap can be placed into plan9 and used as the= GOROOT_BOOTSTRAP to compile a full Go installation on the plan9 system.


--94eb2c0bd15e1a123a05304e49c7--