Skip to content

GOARCH error #64264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jayofelony opened this issue Nov 19, 2023 · 1 comment
Closed

GOARCH error #64264

jayofelony opened this issue Nov 19, 2023 · 1 comment

Comments

@jayofelony
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.21.4 linux/arm64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/home/pi/.cache/go-build'
GOENV='/home/pi/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/pi/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/pi/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_arm64'
GOVCS=''
GOVERSION='go1.21.4'
GCCGO='gccgo'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='0'
GOMOD='/home/pi/opwngrid/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1647992961=/tmp/go-build -gno-record-gcc-switches'

What did you do?

release_files: clean
	@mkdir build
	@echo building for linux/armv6l ...
	@CGO_ENABLED=1 GOARM=6 GOARCH=arm GOOS=linux go build -o build/pwngrid cmd/pwngrid/*.go
	@zip -j "build/pwngrid_linux_armv6l_$(VERSION).zip" build/pwngrid > /dev/null
	@rm -rf build/pwngrid
	@echo building for linux/armv7l
	@CGO_ENABLED=1 GOARM=7 GOARCH=arm GOOS=linux go build -o build/pwngrid cmd/pwngrid/*.go
	@zip -j "build/pwngrid_linux_armv7l_$(VERSION).zip" build/pwngrid > /dev/null
	@rm -rf build/pwngrid
	@echo building for linux/armv8l ...
	@CGO_ENABLED=1 GOARCH=arm64 GOOS=linux go build -o build/pwngrid cmd/pwngrid/*.go
	@zip -j "build/pwngrid_linux_aarch64_$(VERSION).zip" build/pwngrid > /dev/null
	@rm -rf build/pwngrid
	@openssl dgst -sha256 "build/pwngrid_linux_armv6l_$(VERSION).zip" > "build/pwngrid-hashes.sha256"
	@openssl dgst -sha256 "build/pwngrid_linux_armv7l_$(VERSION).zip" > "build/pwngrid-hashes.sha256"
	@openssl dgst -sha256 "build/pwngrid_linux_aarch64_$(VERSION).zip" > "build/pwngrid-hashes.sha256"
	@ls -la build

What did you expect to see?

A successful build without error.

What did you see instead?

Error thrown is:

building for linux/armv6l ...
# runtime/cgo
gcc: error: unrecognized command-line option '-marm'
make: *** [Makefile:24: release_files] Error 1

I think the GOARCH is calling the wrong gcc option:
https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html#index-march-2

@jayofelony jayofelony changed the title affected/package: GOARCH error Nov 19, 2023
@seankhliao
Copy link
Member

marm is a valid flag: https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html#index-marm

You'll need a valid gcc installation for arm (https://bugzilla.redhat.com/show_bug.cgi?id=1409962)

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Nov 19, 2023
@golang golang locked and limited conversation to collaborators Nov 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants