Building software with clang and gcc force -march=native apparently, no matter what I do:
$ clang a.c -march=x86-64 -mtune=generic -o a_clang
$ gcc a.c -march=x86-64 -mtune=generic -o a_gcc
$ readelf -n a_clang a_gcc
File: a_clang
Displaying notes found in: .note.gnu.property
Owner Data size Description
GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
Properties: x86 ISA needed: x86-64-baseline, x86-64-v2, x86-64-v3, x86-64-v4
File: a_gcc
Displaying notes found in: .note.gnu.property
Owner Data size Description
GNU 0x00000030 NT_GNU_PROPERTY_TYPE_0
Properties: x86 ISA needed: x86-64-baseline, x86-64-v2, x86-64-v3, x86-64-v4
x86 feature used: x86
x86 ISA used: x86-64-baseline
When trying to run the program on an older CPU, I get
CPU ISA level is lower than required
This is also the case with golang, which gives me
This program can only be run on AMD64 processors with v4 microarchitecture support.
However in case of golang Iām able to successfully override it with GOAMD64=v1