lkml.org 
[lkml]   [2020]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC v3 3/3] kvm: selftests: Fix header path when built from parent level with O specified
Date
When build kvm selftests in tools/testing/selftests directory with

make O=/home/lxy/kselftests TARGETS=kvm

it fails building some kvm test binaries due to lack of header files,
e.g.,

x86_64/vmx_set_nested_state_test.c: In function ‘set_default_vmx_state’:
x86_64/vmx_set_nested_state_test.c:85:7: error: ‘struct
kvm_nested_state’ has no member named ‘hdr’
state->hdr.vmx.vmxon_pa = 0x1000;
...

With "O" is specified, it also takes effect on "make headers_install",
which causes no header files generated in "kernel-src/usr".

Fix INSTALL_HDR_PATH with correct path for this case.

Opportunistically fix the case when KBUILD_OUTPUT specified as well,
even though it can work currently.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
tools/testing/selftests/kvm/Makefile | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 6a95878b2ab7..bf8f56488914 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -50,7 +50,11 @@ ifeq (0,$(MAKELEVEL))
INSTALL_HDR_PATH := $(top_srcdir)/usr
endif
else
+ ifneq ($(O)$(KBUILD_OUTPUT),)
+ INSTALL_HDR_PATH := $(BUILD)/usr
+ else
INSTALL_HDR_PATH := $(top_srcdir)/usr
+ endif
endif
LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/
LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include
--
2.20.1
\
 
 \ /
  Last update: 2020-03-26 04:26    [W:0.160 / U:8.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site