Skip to content

Commit c2ee9f5

Browse files
broonietorvalds
authored andcommitted
KVM: selftests: Fix build on on non-x86 architectures
Commit 9a40006 ("KVM: selftests: x86: Avoid using SSE/AVX instructions") unconditionally added -march=x86-64-v2 to the CFLAGS used to build the KVM selftests which does not work on non-x86 architectures: cc1: error: unknown value ‘x86-64-v2’ for ‘-march’ Fix this by making the addition of this x86 specific command line flag conditional on building for x86. Fixes: 9a40006 ("KVM: selftests: x86: Avoid using SSE/AVX instructions") Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent a360f31 commit c2ee9f5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/testing/selftests/kvm/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,13 @@ CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
244244
-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
245245
-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
246246
-I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \
247-
-march=x86-64-v2 \
248247
$(KHDR_INCLUDES)
249248
ifeq ($(ARCH),s390)
250249
CFLAGS += -march=z10
251250
endif
251+
ifeq ($(ARCH),x86)
252+
CFLAGS += -march=x86-64-v2
253+
endif
252254
ifeq ($(ARCH),arm64)
253255
tools_dir := $(top_srcdir)/tools
254256
arm64_tools_dir := $(tools_dir)/arch/arm64/tools/

0 commit comments

Comments
 (0)