Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: selftests: Fix build on on non-x86 architectures

Commit 9a400068a158 ("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: 9a400068a158 ("KVM: selftests: x86: Avoid using SSE/AVX instructions")
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Mark Brown and committed by
Linus Torvalds
c2ee9f59 a360f311

+3 -1
+3 -1
tools/testing/selftests/kvm/Makefile
··· 244 244 -fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \ 245 245 -I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \ 246 246 -I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \ 247 - -march=x86-64-v2 \ 248 247 $(KHDR_INCLUDES) 249 248 ifeq ($(ARCH),s390) 250 249 CFLAGS += -march=z10 250 + endif 251 + ifeq ($(ARCH),x86) 252 + CFLAGS += -march=x86-64-v2 251 253 endif 252 254 ifeq ($(ARCH),arm64) 253 255 tools_dir := $(top_srcdir)/tools