Skip to content
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

cmd/go: building with -buildmode=pie on windows/arm64 fails #56872

Closed
qmuntal opened this issue Nov 21, 2022 · 1 comment
Closed

cmd/go: building with -buildmode=pie on windows/arm64 fails #56872

qmuntal opened this issue Nov 21, 2022 · 1 comment

Comments

@qmuntal
Copy link
Contributor

qmuntal commented Nov 21, 2022

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

$ go version
go version go1.19.3 windows/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
set GO111MODULE=
set GOARCH=arm64
set GOBIN=
set GOCACHE=C:\Users\qmuntaldiaz\AppData\Local\go-build
set GOENV=C:\Users\qmuntaldiaz\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=arm64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\qmuntaldiaz\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\qmuntaldiaz\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_arm64
set GOVCS=
set GOVERSION=go1.19.3
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\qmuntaldiaz\code\delve\go.mod
set GOWORK=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\QMUNTA~1\AppData\Local\Temp\go-build4172460094=/tmp/go-build -gno-record-gcc-switches

What did you do?

Build whatever go program using -buildmode=pie, e.g.:

go build -buildmode=pie hash

What did you expect to see?

Program built successfully.

What did you see instead?

-buildmode=pie not supported on windows/arm64

Additional notes

windows/arm64 does support pie build mode. In fact, it does not support exe and it falls back to pie if exe is specified:

case "exe":
switch buildcfg.GOOS + "/" + buildcfg.GOARCH {
case "darwin/arm64", "windows/arm", "windows/arm64": // On these platforms, everything is PIE
*mode = BuildModePIE
default:
*mode = BuildModeExe
}

@qmuntal qmuntal changed the title cmd/go: cmd/go: building with -buildmode=pie on windows/arm64 fails Nov 21, 2022
@gopherbot
Copy link

Change https://go.dev/cl/452415 mentions this issue: cmd/go,internal/platform: enable pie buildmode for windows/arm64

@qmuntal qmuntal self-assigned this Nov 21, 2022
felixge pushed a commit to felixge/go that referenced this issue Nov 21, 2022
This CL adds windows/arm64 to the list of ports that supports PIE
build mode. It is probably an oversight that this port is not marked
as pie-capable because windows/arm64 only supports PIE build mode.

Fixes golang#56872

Change-Id: I2bdd3ac207280f47ddcf8c2582f13025dafb9278
Reviewed-on: https://go-review.googlesource.com/c/go/+/452415
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
@golang golang locked and limited conversation to collaborators Nov 21, 2023
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

2 participants