Skip to contentSkip to conversation

KVM: make: Fix out-of-source module builds

PATCH Applied Siddharth Chandrasekaran 2 participants 2 messages Mar 24, 2021 – Mar 26, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: make: Fix out-of-source module builds

Building kvm module out-of-source with,

    make -C $SRC O=$BIN M=arch/x86/kvm

fails to find "irq.h" as the include dir passed to cflags-y does not prefix the source dir. Fix this by prefixing $(srctree) to the include dir path.

---
 arch/x86/kvm/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/Makefile +1 -1
index 1b4766fe1de2..eafc4d601f25 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 
-ccflags-y += -Iarch/x86/kvm
+ccflags-y += -I $(srctree)/arch/x86/kvm
 ccflags-$(CONFIG_KVM_WERROR) += -Werror
 
 ifeq ($(CONFIG_FRAME_POINTER),y)
Signature · 12 lines
2.17.1




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879
maintainer Applied
#1 lore raw
Quoted 19 lines · Siddharth Chandrasekaran

Building kvm module out-of-source with,

     make -C $SRC O=$BIN M=arch/x86/kvm

fails to find "irq.h" as the include dir passed to cflags-y does not prefix the source dir. Fix this by prefixing $(srctree) to the include dir path.

---
  arch/x86/kvm/Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/Makefile +0 -0
index 1b4766fe1de2..eafc4d601f25 100644

arch/x86/kvm/Makefile line 6

Quoted 7 lines
arch/x86/kvm/Makefile +1 -1
@@ -1,6 +1,6 @@
  # SPDX-License-Identifier: GPL-2.0
 
-ccflags-y += -Iarch/x86/kvm
+ccflags-y += -I $(srctree)/arch/x86/kvm
  ccflags-$(CONFIG_KVM_WERROR) += -Werror
 
  ifeq ($(CONFIG_FRAME_POINTER),y)

Queued, thanks.

Paolo