all: pass -march=x86_64-vX to CGo compiler when GOAMD64=vX is set #48936
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?This only applies to Go 1.18 at the moment because GOAMD64 is WIP.
What operating system and processor architecture are you using (
go env
)?x86_64 with v1, v2, v3, v4 using GOAMD64 variable.
What did you do?
I propose that building using the
GOAMD64=vX
variable set should apply the correct-march=x86_64-vX
(i.e.GOAMD64=v3
->-march=x86_64-v3
) to the C compiler used for CGo. This allows C-code to also get optimized to use the updated target architecture with newer instructions that are supported for that target. We would need to check that the C-compiler supports these target architectures before potentially applying a target that does not exist (seems like GCC11 and Clang12 are the initial supported versions: https://www.phoronix.com/scan.php?page=news_item&px=GCC-11-x86-64-Feature-Levels).Related to #45453
The text was updated successfully, but these errors were encountered: