Cross-compiling with go for arm on amd64. Possible?

Scott Aitken freebsd-lists-5 at thismonkey.com
Tue Dec 10 15:23:45 UTC 2019


> Scott Aitken <freebsd-lists-5 at thismonkey.com> writes:
> 
> > Unfortunately I'm using an SD image from the FreeBSD website which doesn't 
> > have a swap partition, and then chews up any free space with 'growfs' on 
> > first boot.  (Something to remember for next time - add swap before growfs 
> > runs).
> >
> > So I don't have any swap.  I had forgotten about that when I first posted.  
> > (I could plug in a USB stick for swap).
> >
> > Still if anyone has had success in cross-compiling in Go for arm I'd I'd love 
> > to know.
> 
> I had set up a swap partition after I used dd to put the image on the
> card, and before I booted the image.  You can use a USB device, or you
> can just try a swapfile[1].  I just tested the following sequence:
> 
> #-------------- Start code snip
> dd if=/dev/zero of=/var/swapfile bs=1m count=200
> echo 'md none swap sw,late,file=/var/swapfile 0 0' >>/etc/fstab
> swapon -aL
> #-------------- End code snip
> 
> That will give you 200MB on a swapfile, which I think will be enough.
> You can try more if you want, but a swap partition would probably be
> better.
> 
> [1] - The handbook also shows how to create a swapfile at:
> https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/adding-swap-space.html 
> 
> -- 
> Carl Johnson		carlj at peak.org
>
Great idea Carl,

rather than the dd I did:
# truncate -s 512M /var/swapfile
# ls -als /var/swapfile
96 -rw-r--r--  1 root  wheel  536870912 Dec 11 02:08 /var/swapfile

The fstab info was very helpful, thanks.  I've now got a 512M swapfile.

I think way back in my original post I said that I'd downloaded a pre-built 
binary for the Pi on the dnscrypt2 github site so I don't need to build go 
any more (at least not at the moment).

But I'm sure the swapfile will save my bacon in the future.

Many thanks for your help,
Scott


More information about the freebsd-questions mailing list