Skip to content

cmd/go: allow combining -race and -buildmode=PIE again #75868

Description

@aktau

Go version

Go 1.26-dev

Output of go env in your module/workspace:

N/A

What did you do?

cc @cherrymui

The following is not supported:

$ go build -race -buildmode=pie hello.go 
-buildmode=pie not supported when -race is enabled on linux/amd64

What did you see happen?

The go tool does not allow it.

What did you expect to see?

It probably should be allowed.

For reference, it was disabled in https://go.dev/cl/41333 for #20038. Back then (in 2017), @dvyukov stated that the race detector did not support PIE. I believe this has changed:

Metadata

Metadata

Assignees

Labels

GoCommandcmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolProposalIssues describing a requested change to a Go tool or command-line program.compiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions