Skip to contentSkip to conversation

KVM: allow disabling -Werror

PATCH New Paolo Bonzini 1 participant 1 message Feb 28, 2020

Subsystems (3)
lore
Share & tools
lore

Paolo Bonzini

author maintainer
#0 lore raw

PATCH 1/1 KVM: allow disabling -Werror

Restrict -Werror to well-tested configurations and allow disabling it via Kconfig.

---
 arch/x86/kvm/Kconfig  | 13 +++++++++++++
 arch/x86/kvm/Makefile |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
arch/x86/kvm/Kconfig +13 -0
index 991019d5eee1..1bb4927030af 100644
@@ -59,6 +59,19 @@ config KVM
 
 	  If unsure, say N.
 
+config KVM_WERROR
+	bool "Compile KVM with -Werror"
+	# KASAN may cause the build to fail due to larger frames
+	default y if X86_64 && !KASAN
+	# We use the dependency on !COMPILE_TEST to not be enabled
+	# blindly in allmodconfig or allyesconfig configurations
+	depends on (X86_64 && !KASAN) || !COMPILE_TEST
+	depends on EXPERT
+	help
+	  Add -Werror to the build flags for (and only for) i915.ko.
+
+	  If in doubt, say "N".
+
 config KVM_INTEL
 	tristate "KVM for Intel (and compatible) processors support"
 	depends on KVM && IA32_FEAT_CTL
arch/x86/kvm/Makefile +1 -1
index 4654e97a05cc..e553f0fdd87d 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 
 ccflags-y += -Iarch/x86/kvm
-ccflags-y += -Werror
+ccflags-$(CONFIG_KVM_WERROR) += -Werror
 
 KVM := ../../../virt/kvm
 
Signature · 1 line
1.8.3.1