I downloaded and ran `go env` with both the 32-bit and 64-bit Go toolchains from go.dev, and the GOGCCFLAGS results were:

64-bit: GOGCCFLAGS='-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2828356582=/tmp/go-build -gno-record-gcc-switches'

32-bit: GOGCCFLAGS='-fPIC -marm -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3860201885=/tmp/go-build -gno-record-gcc-switches'

Since you're on a newer Raspberry Pi with a 64-bit ARM environment, you should download the 64-bit Go toolchain, not the 32-bit one.

Stephen Illingworth:
Hello,

I'm trying to build a project on the Raspberry Pi, natively.

Using "go env" I can see that Go has the following value for GOGCCFLAGS

GOGCCFLAGS='-fPIC -marm -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build745518569=/tmp/go-build -gno-record-gcc-switches'

However, the native compiler (gcc 12.2) does not have the -marm flag. The compilation of the project fails.

I know you can't edit the GOGCCFLAGS environment variable directly but it's not clear to me how to remove this unneeded flag.

I've tried the CGO_CFLAGS_DISALLOW environment variable but that doesn't seem work. But maybe I'm misusing it.

This is a brand new installation of Raspbian. The only other software I've installed is Go for Arm from the official Go distribution site.

Help
Stephen

--
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+unsubscr...@googlegroups.com <mailto:golang-nuts+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/82a69c96-5cbd-4aa2-a911-8141071b2610n%40googlegroups.com <https://groups.google.com/d/msgid/golang-nuts/82a69c96-5cbd-4aa2-a911-8141071b2610n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/178af2a6-a611-40c8-9e1f-ac0881d14af6%40gmail.com.

Reply via email to