# go-1.4,1 is only for i386 amd64, while you are running armv6.



## rpi-user (Jan 8, 2015)

I attempted to install lang/go and got the error message you see above.

I find it strange that it claims this because I have previously used go-1.4 on armv6 in Debian.


----------



## SirDice (Jan 8, 2015)

ARM is still a Tier 2 platform. So not everything is fully tested or guaranteed to work. You could try to remark the ONLY_FOR_ARCHS line in the port's Makefile and see how far it'll go.


----------



## rpi-user (Jan 8, 2015)

I edited the Makefile like this: 
	
	



```
27c27
< ONLY_FOR_ARCHS=   i386 amd64
---
> ONLY_FOR_ARCHS=   armv6
31,38c31,32
< .if ${ARCH} == "i386"
< GOARCH=386
< GOOBJ=8
< PLIST_SUB+=   I386_ONLY=""
< PLIST_SUB+=   AMD64_ONLY="@comment "
< .else
< GOARCH=amd64
< GOOBJ=6
---
> GOARCH=arm
> GOOBJ=5
40,41c34
< PLIST_SUB+=   AMD64_ONLY=""
< .endif
---
> PLIST_SUB+=   AMD64_ONLY="@comment "
```
 Since I wasn't sure how to say _else if_ in the Makefile, I just took the lazy road of removing the _i386_ and _amd64_ stuff and replace those with the _armv6_ and _arm_ stuff. Now I'm waiting for it to finish building.

_Edit_ for anyone wondering what the GOOBJ number means: 





> The Go compilers support three instruction sets. There are important differences in the quality of the compilers for the different architectures.
> 
> amd64 (a.k.a. x86-64); 6g,6l,6c,6a
> A mature implementation. The compiler has an effective optimizer (registerizer) and generates good code (although gccgo can do noticeably better sometimes).​386 (a.k.a. x86 or x86-32); 8g,8l,8c,8a
> ...


 From https://golang.org/doc/install/source. So there you see why I set it to 5.


----------



## SirDice (Jan 8, 2015)

Excellent. If it properly builds and works could you please create a PR for it? The port can then be modified so it'll work on ARM too.


----------



## rpi-user (Jan 8, 2015)

Installed and `go version` reports 
	
	



```
go version go1.4 freebsd/arm
```
 In other words, it seems to be working.



SirDice said:


> Excellent. If it properly builds and works could you please create a PR for it? The port can then be modified so it'll work on ARM too.


 Yes, I'd love to do that. Where is it described how I do that?


----------



## SirDice (Jan 8, 2015)

rpi-user said:


> Installed and `go version` reports
> 
> 
> 
> ...


Even better! Getting a port to build doesn't necessarily mean it will actually work  



> Yes, I'd love to do that. Where is it described how I do that?


https://bugs.freebsd.org/bugzilla/

If you don't know how to create a complete patch, just describe what you did and/or changed and I'm sure the maintainer can include the necessary changes. It seems like a popular language (I've never used it myself) so I'm sure there are others who'd like to have it running on ARM too. Someone else may even write a proper patch for it using your directions and add to the PR. It's a community effort after all


----------



## rpi-user (Jan 8, 2015)

I've posted about it to bugzilla now: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196623


----------



## acheron (Jan 8, 2015)

As I replied in the PR can you provide a unified diff `diff -du file.orig file` and a poudriere build log (or a simple build log)?
I'm not sure I read your diff properly (it's not a unified one) but make sure that 
ONLY_FOR_ARCHS contains i386 amd64 armv6
Thanks!


----------



## rpi-user (Jan 9, 2015)

Hello, I didn't want to pollute the bugzilla report with this additional information, so I'm posting it here:

`poudriere jail -c -j pitest -v 10.1-STABLE` fails with

```
[00:00:00] ====>> FREEBSD_HOST from config invalid; defaulting to http://ftp.freebsd.org
[00:00:00] ====>> Fetching base.txz for FreeBSD 10.1-STABLE arm.armv6
fetch: http://ftp.freebsd.org/pub/FreeBSD/snapshots/arm.armv6/arm.armv6/10.1-STABLE/base.txz: Not Found
fetch: http://ftp.freebsd.org/pub/FreeBSD/snapshots/arm.armv6/arm.armv6/10.1-STABLE/base.txz: Not Found
[00:00:00] ====>> Error: Failed to fetch from http://ftp.freebsd.org/pub/FreeBSD/snapshots/arm.armv6/arm.armv6/10.1-STABLE/base.txz
[00:00:00] ====>> Error while creating jail, cleaning up.
[00:00:00] ====>> Removing pitest jail... done
```
 I have changed the Makefile in the way that it will be usable and am waiting for my current rebuild to finish and will then post in the PR the unified diff and a simple build log (I am creating the simple build log by running `make build 2>&1 | tee -a build.log`).

I will try and get poudriere jail working for me once I am done with the current PR. One thing at a time is best, I think 

_edit_ to add: I've now put the proposed patch along with simple build log and install log as attachments to the PR.


----------



## rpi-user (Jan 9, 2015)

I'd also like to add that I have now tested the resulting installed lang/go on my ARMv6 computer with a project from GitHub and it is able to build and run. The project is question is https://github.com/shazow/ssh-chat on branch "refactor".

(Additionally, though it doesn't matter much to others, that project is what motivated me to want to install Go on my Raspberry Pi in the first place.)


----------



## junovitch@ (Jan 15, 2015)

Take a look at http://ftp.freebsd.org/pub/FreeBSD/snapshots/.  There's no pre-built snapshots for ARM there so that is why the Poudriere setup is failing.  Try again with the -m svn option.  See the blog below for some quick info I've found useful on kicking things off with Poudriere/SVN combination.

http://blog.ignoranthack.me/?p=129


----------

