Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Dec 2019 15:49:40 -0500
From:      Paul Mather <paul@gromit.dlib.vt.edu>
To:        Brian Bostwick <bostwick.brian@gmail.com>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: Building rclone on aarch64
Message-ID:  <B74BB598-2E79-4203-838B-1F35A2F8D34A@gromit.dlib.vt.edu>
In-Reply-To: <CAM9he-VNQAyepvqnWVDLurVfbf-gguG7n5Dzp9P-FTY9FunuFw@mail.gmail.com>
References:  <CAM9he-VNQAyepvqnWVDLurVfbf-gguG7n5Dzp9P-FTY9FunuFw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Dec 13, 2019, at 3:16 PM, Brian Bostwick <bostwick.brian@gmail.com> wrote:

> Hi, I am trying to compile rclone on a RPI 3 B+ via ports because a bin
> does not exist on this platform, which looks normal as of now via rclone's
> website as they too don't provide one.
>
> My error:
>
> Killed
> *** Error code 137
>
> Stop.
> make[1]: stopped in /usr/ports/lang/go-devel
> *** Error code 1
>
> Stop.
> make: stopped in /usr/ports/net/rclone
> root@generic:/usr/ports/net/rclone # go build cmd/compile/internal/ssa:
> /usr/ports/lang/go-devel/work/go-498eaee461/pkg/tool/freebsd_arm64/compile:
> signal: killed
>
> Pretty generic, not sure where I can find more detailed information on why
> it failed.


The release version of Go does not support "arm64" as a supported  
architecture for GOOS=freebsd.  At least that is the case according to  
https://golang.org/doc/install/source#environment

Contemporary Go (1.5+) supports cross-compilation for other supported OS  
and ARCHes by setting the GOOS and GOARCH environment variables.  Here's  
what happens when I try to build for FreeBSD/arm64 on macOS:

=====
mather ~% env GOOS=freebsd GOARCH=arm64 go build -v test.go
cmd/go: unsupported GOOS/GOARCH pair freebsd/arm64
mather ~% go version
go version go1.13.4 darwin/amd64
=====

I have had luck cross-compiling for FreeBSD/arm.  For example, I built  
restic from source under macOS  
(https://restic.readthedocs.io/en/latest/020_installation.html#from-source)  
and was able to copy and run the static binary that resulted on my  
FreeBSD/arm 12-STABLE system just fine.

Looking at https://golang.org/doc/install/source#environment it appears  
aarch64 is currently only supported on GOOS=android, darwin, linux, and  
openbsd.

Maybe the lang/go-devel port actually does support freebsd/arm64, but given  
that the port failed to build for you, I'm doubtful.  Having said that,  
perhaps resource limits caused the port to fail to build on your Raspberry  
Pi 3 B+?  Lack of RAM has been a problem in building ports natively on  
Raspberry Pi.


> Besides this, is it possible to run 32 bit arm bins on aarch64? I really
> would like to use this program for syncing some things to the cloud. I
> tried myself, but got an ELF error.


That would be good to know.  I'm in the same boat as you, in that I would  
like to run Go binaries on my FreeBSD/arm64 12-STABLE Raspberry Pi 3 B+  
system.  It would be nice to know when Go is supported (well) on that  
platform...

Cheers,

Paul.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B74BB598-2E79-4203-838B-1F35A2F8D34A>