Freebsd - Raspberry and Go from Source

231 views
Skip to first unread message

alex martin

unread,
Jun 23, 2015, 4:14:05 PM6/23/15
to golan...@googlegroups.com
Hi i'm trying to install Go in a raspberry board with Freebsd 11 and I've this error

os/user/lookup_unix.go:49:10: type C.struct_passwd: undefined C type 'struct passwd'
os/user/lookup_unix.go:50:14: type C.struct_passwd: undefined C type 'struct passwd'
os/user/lookup_unix.go:52:14: type C.long: undefined C type 'long'
os/user/lookup_unix.go:59:13: call of non-function C.sysconf
os/user/lookup_unix.go:64:9: call of non-function C.malloc
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x0 addr=0x0 pc=0x1d9ec]

some suggest ?

Thanks Alex

Andrew Gerrand

unread,
Jun 23, 2015, 7:43:52 PM6/23/15
to alex martin, Dave Cheney, golang-nuts
Hi,

The FreeBSD/arm support for Go is "experimental". I say this because we're not currently running a continuous builder for that platform, so I would not be surprised if Go is broken there.

I've cc'd Dave Cheney on this thread, as he is the last person I know that ran Go on freebsd/arm.

Would you mind filing a bug with the full details of what you're doing?

Thanks,
Andrew

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dave Cheney

unread,
Jun 23, 2015, 8:59:47 PM6/23/15
to golan...@googlegroups.com, da...@cheney.net, a.mart...@gmail.com
Thanks for trying Go on freebsd. I tried for a long time to get a working freebsd builder on an original model B raspberry pi but gave up every time due to the bad performance and kernel bugs.

I'd suggest building with cgo disabled.

env CGO_ENABLED GOARM=5 ./all.bash

This will take about three hours to complete.

I have had some success running freebsd/arm on a pandaboard, which has working floating point and mulitprocessor support. 

I've also tried using a Beaglebone Black, but kernel bugs mean the BBB always runs in low power mode (~550mhz) which ended up making it slower than the raspberry pi.

Dave Cheney

unread,
Jun 23, 2015, 9:00:51 PM6/23/15
to golang-nuts, Dave Cheney, alex martin
I'm sorry this should have been

env CGO_ENABLED=1 GOARM=5 ./all.bash

Dave Cheney

unread,
Jun 23, 2015, 9:02:07 PM6/23/15
to golang-nuts, Dave Cheney, alex martin
sigh. to correct myself again, the proper invocation is

env CGO_ENABLED=0 GOARM=5 ./all.bash

CGO_ENABLED=0 disables cgo entirely
GOARM=5 disables the use of the floating point unit on the raspberry
pi, as it will lock up the kernel if probed.

Low Eel

unread,
May 18, 2017, 6:35:45 AM5/18/17
to golang-nuts, da...@cheney.net, a.mart...@gmail.com
Actualy the secret is this GOARM=5 . Seems it impacts also on the error about struct_passwd, somehow.

I had GOARM set to 6 because I took the settings from a linux machine (running on ODROID XU4) and it was failing like that.

About compilation times of 3 hours, they depend mostly by disk performance, where "disk" is the SD card. When I did it on the external SSD disk I connected with the Raspi on USB,
the time was about 20 minutes. 

Hope this helps too.

Dave Cheney

unread,
May 18, 2017, 7:24:59 AM5/18/17
to Low Eel, golang-nuts, alex martin
It looks like FreeBSD on the Odroid does not support floating point. I
believe at some point floating point support was added to the broadcom
chip in the raspberry pi 2, but I haven't tried to use freebsd on any
arm platform since the previous reply to this thread in 2015.

low...@gmx.de

unread,
May 18, 2017, 9:23:05 AM5/18/17
to Dave Cheney, golang-nuts

I don't know about the C1, just because I only own a Odroid XU4. Not sure if there will be a FreeBSD port
of it, at all. What I have are 1 Raspi 1, 2 raspi 2 and one ODROID XU4.

Actually Freebsd runs only on one Raspi2, and I confirm putting the GOARM to 5 was allowing the bootstrap
to compile. Nevertheless, when I compiled the 1.8.1 , it stopped because of one subsystem 5l hanged and got killed after a while.

I will try to cross compile it using a linux machine , maybe I'll be lucky.


> Gesendet: Donnerstag, 18. Mai 2017 um 13:24 Uhr
> Von: "Dave Cheney" <da...@cheney.net>
> An: "Low Eel" <low...@gmx.de>
> Cc: golang-nuts <golan...@googlegroups.com>, "alex martin" <a.mart...@gmail.com>
> Betreff: Re: [go-nuts] Freebsd - Raspberry and Go from Source

Dave Cheney

unread,
May 18, 2017, 3:51:02 PM5/18/17
to golang-nuts, da...@cheney.net


On Thursday, 18 May 2017 23:23:05 UTC+10, Low Eel wrote:

I don't know about the C1, just because I only own a Odroid XU4. Not sure if there will be a FreeBSD port
of it, at all. What I have are 1 Raspi 1, 2 raspi 2 and one ODROID XU4.

Actually Freebsd runs only on one Raspi2, and I confirm putting the GOARM to 5 was allowing the bootstrap
to compile. Nevertheless, when  I compiled the 1.8.1 , it stopped because of one subsystem 5l hanged and got killed after a while.

This is unexpected -- 5l is written in c.

It it possible that your machine was swapping hard? 

Low Eel

unread,
May 20, 2017, 10:57:11 AM5/20/17
to golang-nuts, da...@cheney.net


Actually Freebsd runs only on one Raspi2, and I confirm putting the GOARM to 5 was allowing the bootstrap
to compile. Nevertheless, when  I compiled the 1.8.1 , it stopped because of one subsystem 5l hanged and got killed after a while.

This is unexpected -- 5l is written in c.

It it possible that your machine was swapping hard? 


I didn't pay attention to that, I will repeat a test tomorrow. Nevertheless, I have no way to add RAM to a raspberry (not that I know), and the machine was
only doing this task. So that, if it swapped, I'm afraid there is a little I can do...


 
Reply all
Reply to author
Forward
0 new messages