From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris McGee Content-Type: multipart/alternative; boundary=Apple-Mail-D36ACDE9-2F26-4D42-853F-5BAB96B06F62 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (1.0) Message-Id: Date: Tue, 12 Apr 2016 20:18:59 -0400 References: In-Reply-To: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] Go on Plan 9? Topicbox-Message-UUID: 8cebf578-ead9-11e9-9d60-3106f5b1d025 --Apple-Mail-D36ACDE9-2F26-4D42-853F-5BAB96B06F62 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Thanks, I'll give it a shot. I noticed that there are some assembly files in golang for plan9/386 and no e= quivalent for plan9/arm so I assumed that it wouldn't work with that combina= tion. Chris > On Apr 12, 2016, at 5:26 PM, Skip Tavakkolian = wrote: >=20 > i've not built Go under plan9/arm. however, in practice (in a real Plan 9= environment) this is not an issue. the way authentication and namespaces (i= ncluding file server) work in a Plan 9 envrionment, it is natural to use the= fastest cpu available to (cross) compile apps. typical sessions are like th= is: >=20 > supermic% ls -l > d-rwxrwxr-x M 5543 fst fst 0 Jul 21 2015 .hg > --rw-rw-r-- M 5543 fst fst 1071 Feb 10 2013 LICENSE > --rw-rw-r-- M 5543 fst fst 206 Feb 10 2013 README > --rw-rw-r-- M 5543 fst fst 12477 Feb 10 2013 admui.go > --rw-rw-r-- M 5543 fst fst 6332 Feb 10 2013 client.go > --rw-rw-r-- M 5543 fst fst 8623 Feb 10 2013 index.html > --rw-rw-r-- M 5543 fst fst 450 Feb 10 2013 logger.go > --rw-rw-r-- M 5543 fst fst 1307 Feb 10 2013 main.go > --rw-rw-r-- M 5543 fst fst 4232 May 13 2013 server.go > --rwxrwxr-x M 5543 fst fst 5977542 Apr 12 13:57 tcpmeter > supermic% rm tcpmeter > supermic% go build > supermic% ls -ltr > --rw-rw-r-- M 5543 fst fst 6332 Feb 10 2013 client.go > --rw-rw-r-- M 5543 fst fst 450 Feb 10 2013 logger.go > --rw-rw-r-- M 5543 fst fst 1071 Feb 10 2013 LICENSE > --rw-rw-r-- M 5543 fst fst 1307 Feb 10 2013 main.go > --rw-rw-r-- M 5543 fst fst 206 Feb 10 2013 README > --rw-rw-r-- M 5543 fst fst 12477 Feb 10 2013 admui.go > --rw-rw-r-- M 5543 fst fst 8623 Feb 10 2013 index.html > --rw-rw-r-- M 5543 fst fst 4232 May 13 2013 server.go > d-rwxrwxr-x M 5543 fst fst 0 Jul 21 2015 .hg > --rwxrwxr-x M 5543 fst fst 5855281 Apr 12 14:00 tcpmeter > supermic% file tcpmeter > tcpmeter: 386 plan 9 executable > supermic% ./tcpmeter -? > flag provided but not defined: -? > 2016/04/12 14:00:31 usage: ./tcpmeter (-c|-s) [-r [host:]port] [-h [host:]= port] [-l logfile] > supermic% GOARCH=3Darm go build > supermic% file tcpmeter > tcpmeter: arm plan 9 executable > supermic% cpu -h rpi2 > rpi2% ./tcpmeter -? > flag provided but not defined: -? > 2016/04/12 14:04:35 usage: ./tcpmeter (-c|-s) [-r [host:]port] [-h [host:]= port] [-l logfile] > rpi2% pwd > /usr/fst/GoApps/src/tcpmeter > rpi2% exit > supermic% pwd > /usr/fst/GoApps/src/tcpmeter > supermic%=20 >=20 > Similar setup could be done under Linux/MacOSX with some work. I found thi= s article very helpful: > https://medium.com/@rakyll/go-1-5-cross-compilation-488092ba44ec#.635w6yhi= 5 >=20 > btw, building Go on rpi/linux, took some time. i have not tried rpi3 yet (= waiting for 64bit plan9 or linux). building Go on odroid-c2 (linux/arm64) "= feels" as speedy as on atom or i3. >=20 >=20 >> On Tue, Apr 12, 2016 at 12:21 PM, Chris McGee wro= te: >> Hi Skip, >>=20 >> Have you managed to get Go running on an RPi this way? >>=20 >> Cheers, >> Chris >>=20 >> > >> > 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 compil= e for 9Pi: >> > $ GOOS=3Dplan9 GOARCH=3Darm go build >> > >> > >=20 --Apple-Mail-D36ACDE9-2F26-4D42-853F-5BAB96B06F62 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Thanks,

I'll give it a shot.

I notic= ed that there are some assembly files in golang for plan9/386 and no equival= ent for plan9/arm so I assumed that it wouldn't work with that combination.<= /div>

Chris

On Apr 12, 2016, at 5:26 PM, Skip Tavakkolian <skip.tavakkolian@gmail.com> w= rote:

i've not b= uilt Go under plan9/arm.  however, in practice (in a real Plan 9 enviro= nment) this is not an issue. the way authentication and namespaces (includin= g file server) work in a Plan 9 envrionment, it is natural to use the fastes= t cpu available to (cross) compile apps. typical sessions are like this:
supermic% ls -l
d-rwxrwxr-x M 5543 fst f= st       0 Jul 21  2015 .hg
--rw-rw-r-- M 5543= fst fst    1071 Feb 10  2013 LICENSE
--rw-rw-r-- M= 5543 fst fst     206 Feb 10  2013 README
--rw-rw-r= -- M 5543 fst fst   12477 Feb 10  2013 admui.go
--rw-rw-= r-- M 5543 fst fst    6332 Feb 10  2013 client.go
-= -rw-rw-r-- M 5543 fst fst    8623 Feb 10  2013 index.html
--rw-rw-r-- M 5543 fst fst     450 Feb 10  2013 logger= .go
--rw-rw-r-- M 5543 fst fst    1307 Feb 10  2013= main.go
--rw-rw-r-- M 5543 fst fst    4232 May 13  = ;2013 server.go
--rwxrwxr-x M 5543 fst fst 5977542 Apr 12 13:57 tc= pmeter
supermic% rm tcpmeter
supermic% go build
supermic% ls -ltr
--rw-rw-r-- M 5543 fst fst    6332 Fe= b 10  2013 client.go
--rw-rw-r-- M 5543 fst fst    = 450 Feb 10  2013 logger.go
--rw-rw-r-- M 5543 fst fst  =  1071 Feb 10  2013 LICENSE
--rw-rw-r-- M 5543 fst fst &= nbsp;  1307 Feb 10  2013 main.go
--rw-rw-r-- M 5543 fst f= st     206 Feb 10  2013 README
--rw-rw-r-- M 5543 f= st fst   12477 Feb 10  2013 admui.go
--rw-rw-r-- M 5543 f= st fst    8623 Feb 10  2013 index.html
--rw-rw-r-- M= 5543 fst fst    4232 May 13  2013 server.go
d-rwxr= wxr-x M 5543 fst fst       0 Jul 21  2015 .hg
= --rwxrwxr-x M 5543 fst fst 5855281 Apr 12 14:00 tcpmeter
supermic%= file tcpmeter
tcpmeter: 386 plan 9 executable
supermic%= ./tcpmeter -?
flag provided but not defined: -?
2016/04= /12 14:00:31 usage: ./tcpmeter (-c|-s) [-r [host:]port] [-h [host:]port] [-l= logfile]
supermic% GOARCH=3Darm go build
supermic% file= tcpmeter
tcpmeter: arm plan 9 executable
supermic% cpu -= h rpi2
rpi2% ./tcpmeter -?
flag provided but not defined= : -?
2016/04/12 14:04:35 usage: ./tcpmeter (-c|-s) [-r [host:]port= ] [-h [host:]port] [-l logfile]
rpi2% pwd
/usr/fst/GoApp= s/src/tcpmeter
rpi2% exit
supermic% pwd
/usr/f= st/GoApps/src/tcpmeter
supermic% 

<= div>Similar setup could be done under Linux/MacOSX with some work. I found t= his article very helpful:
https://medium.com/@rakyll/g= o-1-5-cross-compilation-488092ba44ec#.635w6yhi5

b= tw, building Go on rpi/linux, took some time.  i have not tried rpi3 ye= t (waiting for 64bit plan9 or linux).  building Go on odroid-c2 (linux/= arm64) "feels" as speedy as on atom or i3.

<= /div>

On Tue, Apr 1= 2, 2016 at 12:21 PM, Chris McGee <sirnewton_01@yahoo.ca> w= rote:
Hi Skip,

Have you managed to get Go running on an RPi this way?

Cheers,
Chris

>
> 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 compil= e for 9Pi:
>         $ GOOS=3Dplan9 GOARCH=3Darm go build >
>



= --Apple-Mail-D36ACDE9-2F26-4D42-853F-5BAB96B06F62--