Skip to content

runtime: Add error message when running non GOAMD64=v1 on unsupported hardware #48506

@martisch

Description

@martisch

With #45453 we are introducing GOAMD64 to build binaries that are not supported on all amd64 machines.

This can lead to an illegal instruction exception when running such a binary.

We should make best effort to report when such a binary with GOAMD64 > v1 is run on unsupported hardware.

One way to check is to add some assembly early in the runtime startup like it is done to detect MMX on 386 and print a short error message then exit the go program:

TESTL $(1<<23), DX // MMX

Waiting for internal/cpu to initialise to then do the minimum hardware checks in go code is likely to late as by that time an instruction that was emitted by the go compiler could have been used that already is unsupported.

/cc @mdempsky @randall77

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions