mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 15:12:13 +02:00
KVM: selftests: Don't force -march=x86-64-v2 if it's unsupported
Force -march=x86-64-v2 to avoid SSE/AVX instructions if and only if the
uarch definition is supported by the compiler, e.g. gcc 7.5 only supports
x86-64.
Fixes: 9a400068a1 ("KVM: selftests: x86: Avoid using SSE/AVX instructions")
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-and-tested-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Link: https://lore.kernel.org/r/20241031045333.1209195-1-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
parent
5b188cc486
commit
979956bc68
|
|
@ -249,8 +249,10 @@ ifeq ($(ARCH),s390)
|
|||
CFLAGS += -march=z10
|
||||
endif
|
||||
ifeq ($(ARCH),x86)
|
||||
ifeq ($(shell echo "void foo(void) { }" | $(CC) -march=x86-64-v2 -x c - -c -o /dev/null 2>/dev/null; echo "$$?"),0)
|
||||
CFLAGS += -march=x86-64-v2
|
||||
endif
|
||||
endif
|
||||
ifeq ($(ARCH),arm64)
|
||||
tools_dir := $(top_srcdir)/tools
|
||||
arm64_tools_dir := $(tools_dir)/arch/arm64/tools/
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user