-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeGoCommandcmd/gocmd/goNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
What version of Go are you using (go version
)?
$ go version 18.4
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="amd64" GOBIN="" GOCACHE="/home/capnspacehook/.cache/go-build" GOENV="/home/capnspacehook/.config/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/capnspacehook/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/capnspacehook/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.18.4" GCCGO="gccgo" GOAMD64="v3" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/dev/null" GOWORK="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4110434964=/tmp/go-build -gno-record-gcc-switches"
What did you do?
go build -o hello hello.go
go version -m hello
go build -buildmode pie -o hello-pie hello.go
go version -m hello-pie
hello.go:
package main
import "fmt"
func main() {
fmt.Println("yo")
}
What did you expect to see?
hello: go1.18.4
path command-line-arguments
build -compiler=gc
build -buildmode=exe
build CGO_ENABLED=1
build CGO_CFLAGS=
build CGO_CPPFLAGS=
build CGO_CXXFLAGS=
build CGO_LDFLAGS=
build GOARCH=amd64
build GOOS=linux
build GOAMD64=v3
hello-pie: go1.18.4
path command-line-arguments
build -compiler=gc
build -buildmode=pie
build CGO_ENABLED=1
build CGO_CFLAGS=
build CGO_CPPFLAGS=
build CGO_CXXFLAGS=
build CGO_LDFLAGS=
build GOARCH=amd64
build GOOS=linux
build GOAMD64=v3
What did you see instead?
hello: go1.18.4
path command-line-arguments
build -compiler=gc
build CGO_ENABLED=1
build CGO_CFLAGS=
build CGO_CPPFLAGS=
build CGO_CXXFLAGS=
build CGO_LDFLAGS=
build GOARCH=amd64
build GOOS=linux
build GOAMD64=v3
hello-pie: go1.18.4
path command-line-arguments
build -compiler=gc
build CGO_ENABLED=1
build CGO_CFLAGS=
build CGO_CPPFLAGS=
build CGO_CXXFLAGS=
build CGO_LDFLAGS=
build GOARCH=amd64
build GOOS=linux
build GOAMD64=v3
I expected to see the -buildmode
flag in the build settings. I can see that it is not added here:
go/src/cmd/go/internal/load/pkg.go
Line 2349 in f956941
appendSetting("-compiler", cfg.BuildContext.Compiler) |
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeGoCommandcmd/gocmd/goNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.