Skip to content

cmd/go: allow CGO CFLAGS -fexcess-precision= #80304

Description

@saphirion-ab

Go version

go version go1.26.3 linux/amd64

Output of go env in your module/workspace:

<snip>

What did you do?

We're building a Go library which uses math functions via CGO. For correct behaviour, we require compiling with -fexcess-precision=standard:

// #cgo CFLAGS: -fexcess-precision=standard
// #cgo LDFLAGS: -lm
import "C"

Currently, that compiler flag is not allowed in the explicit allow list (https://go.dev/wiki/InvalidFlag). We can of course ad-hoc allow it in the documented way via setting CGO_CFLAGS_ALLOW="-fexcess-precision=standard". We'd prefer, though, for that flag to be added to the allow list.

What did you see happen?

calc: invalid flag in #cgo CFLAGS: -fexcess-precision=standard (see https://go.dev/s/invalidflag)

What did you expect to see?

Please add -fexcess-precision= to the list of explicitly allowed CGO compiler flags.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions