Skip to content

proposal: cmd/go: add GO$GOARCH=all #80501

Description

@Jorropo

Proposal Details

You can currently use things like GOAMD64, GOARM64, ... to indicate to the compiler and assembler that certain optional CPU features are always supported.
it's also possible to use that information in a go program like by using amd64.v3 tag.


This is fairly limited, the defaults are sometime outdated (GOAMD64=v2 is supported by nearly anything still we default to v1).
This either mean we do not use newer instruction sets, or we waste CPU cycles checking for them at runtime.

Instead I propose GOAMD64=all (and others). This would build the program with all levels; then before the binary start the dynamic loader patch the binary to use the best supported level on the current CPU.
Most functions compile no differently between v1, v2, ... thus theses can be deduped by the linker.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions