From patchwork Wed Mar 25 14:01:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoyao Li X-Patchwork-Id: 11457969 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 25A59139A for ; Wed, 25 Mar 2020 14:19:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 056EE20936 for ; Wed, 25 Mar 2020 14:19:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727702AbgCYOTM (ORCPT ); Wed, 25 Mar 2020 10:19:12 -0400 Received: from mga04.intel.com ([192.55.52.120]:42324 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727505AbgCYOTL (ORCPT ); Wed, 25 Mar 2020 10:19:11 -0400 IronPort-SDR: gXYpgOiS8QxktuKIAtLDG3QsmRtve/otHRnsBw45b99XqkJFW9q33QdVhTiX+I1kcLoSWc21E0 NJfWVzeB4kmA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 07:19:11 -0700 IronPort-SDR: AbZJ1HHcIw0fp+5/Lfc/do6mA+kSLGmHIYjxgBaP2nI33NpXdYsbbyawUwK1AD3HfREyBq2Hnx tUg5Eavt/Scw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,304,1580803200"; d="scan'208";a="270811075" Received: from lxy-clx-4s.sh.intel.com ([10.239.43.39]) by fmsmga004.fm.intel.com with ESMTP; 25 Mar 2020 07:19:10 -0700 From: Xiaoyao Li To: Shuah Khan , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Xiaoyao Li Subject: [PATCH v2 1/6] selftests: Create directory when OUTPUT specified Date: Wed, 25 Mar 2020 22:01:28 +0800 Message-Id: <20200325140133.103236-2-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200325140133.103236-1-xiaoyao.li@intel.com> References: <20200325140133.103236-1-xiaoyao.li@intel.com> MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org When OUTPUT specified, it may encounter no directory error if there is subdir in $TARGET for any of TEST_GEN_PROGS, TEST_GEN_PROGS_EXTENDED, or TEST_GEN_FILES. This issue is found by running make OUTPUT=/path/to/output in tools/testing/selftests/kvm Signed-off-by: Xiaoyao Li --- tools/testing/selftests/lib.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 1c8a1963d03f..78fb00bdf5c4 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -20,6 +20,16 @@ TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS)) TEST_GEN_PROGS_EXTENDED := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS_EXTENDED)) TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES)) +ifneq ($(TEST_GEN_PROGS),) +$(shell mkdir -p $(sort $(dir $(TEST_GEN_PROGS)))) +endif +ifneq ($(TEST_GEN_PROGS_EXTENDED),) +$(shell mkdir -p $(sort $(dir $(TEST_GEN_PROGS_EXTENDED)))) +endif +ifneq ($(TEST_GEN_FILES),) +$(shell mkdir -p $(sort $(dir $(TEST_GEN_FILES)))) +endif + ifdef KSFT_KHDR_INSTALL top_srcdir ?= ../../../.. include $(top_srcdir)/scripts/subarch.include From patchwork Wed Mar 25 14:01:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoyao Li X-Patchwork-Id: 11457965 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6B50D1731 for ; Wed, 25 Mar 2020 14:19:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4A51D20936 for ; Wed, 25 Mar 2020 14:19:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727731AbgCYOTO (ORCPT ); Wed, 25 Mar 2020 10:19:14 -0400 Received: from mga04.intel.com ([192.55.52.120]:42324 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727722AbgCYOTN (ORCPT ); Wed, 25 Mar 2020 10:19:13 -0400 IronPort-SDR: BVfOXygjUs27JU5dfykGrBJyiWV/fneE3FhEteFNCYtVgPZtcHMLGsiKW+KeNHvqJAL9GKy1Su 5sc2eTj9NERg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 07:19:13 -0700 IronPort-SDR: SDkxVKOvB38VMkJiYWvbZ6iaVl6FimGKpYU/8lim85lOR8OdDR/jtTKip8gnEXHGmtjKgM8M4D whp6ZdZ9/SZQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,304,1580803200"; d="scan'208";a="270811083" Received: from lxy-clx-4s.sh.intel.com ([10.239.43.39]) by fmsmga004.fm.intel.com with ESMTP; 25 Mar 2020 07:19:11 -0700 From: Xiaoyao Li To: Shuah Khan , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Xiaoyao Li Subject: [PATCH v2 2/6] selftests: kvm: Include lib.mk earlier Date: Wed, 25 Mar 2020 22:01:29 +0800 Message-Id: <20200325140133.103236-3-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200325140133.103236-1-xiaoyao.li@intel.com> References: <20200325140133.103236-1-xiaoyao.li@intel.com> MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Include lib.mk a little bit earlier so that common lib.mk can setup environment earlier. This is for the following patch to prepare INSTALL_HDR_PATH earlier. Signed-off-by: Xiaoyao Li --- tools/testing/selftests/kvm/Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile index 67abc1dd50ee..504a5fb0fa71 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -43,6 +43,10 @@ TEST_GEN_PROGS_s390x += kvm_create_max_vcpus TEST_GEN_PROGS += $(TEST_GEN_PROGS_$(UNAME_M)) LIBKVM += $(LIBKVM_$(UNAME_M)) +# After inclusion, $(OUTPUT) is defined and +# $(TEST_GEN_PROGS) starts with $(OUTPUT)/ +include ../lib.mk + INSTALL_HDR_PATH = $(top_srcdir)/usr LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/ LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include @@ -62,9 +66,6 @@ pgste-option = $(call try-run, echo 'int main() { return 0; }' | \ LDFLAGS += -pthread $(no-pie-option) $(pgste-option) -# After inclusion, $(OUTPUT) is defined and -# $(TEST_GEN_PROGS) starts with $(OUTPUT)/ -include ../lib.mk STATIC_LIBS := $(OUTPUT)/libkvm.a LIBKVM_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM)) From patchwork Wed Mar 25 14:01:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoyao Li X-Patchwork-Id: 11457959 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 512E91731 for ; Wed, 25 Mar 2020 14:19:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3044F208E0 for ; Wed, 25 Mar 2020 14:19:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727768AbgCYOTR (ORCPT ); Wed, 25 Mar 2020 10:19:17 -0400 Received: from mga04.intel.com ([192.55.52.120]:42324 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727738AbgCYOTP (ORCPT ); Wed, 25 Mar 2020 10:19:15 -0400 IronPort-SDR: rJ+wH8GBTdJTMvBtX4w0Sgc6lgubU4NN5qD4e93iNYyF2H6Fg8mQ4sh/caxmyFnJ4BM+HO/99U 32bvRxZ5yt+Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 07:19:14 -0700 IronPort-SDR: 4H79Xduv0tr8WhWLlYX2sZf/cFARLTnkV0zUg9oyVLp/e7zBA78wp5ouHmwOYjqAEfAUPre3zy PEDsw/BCRJaQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,304,1580803200"; d="scan'208";a="270811091" Received: from lxy-clx-4s.sh.intel.com ([10.239.43.39]) by fmsmga004.fm.intel.com with ESMTP; 25 Mar 2020 07:19:13 -0700 From: Xiaoyao Li To: Shuah Khan , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Xiaoyao Li Subject: [PATCH v2 3/6] selftests: kvm: Use the default linux header path only when INSTALL_HDR_PATH not defined Date: Wed, 25 Mar 2020 22:01:30 +0800 Message-Id: <20200325140133.103236-4-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200325140133.103236-1-xiaoyao.li@intel.com> References: <20200325140133.103236-1-xiaoyao.li@intel.com> MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org This provides a way for lib.mk or parent Makefile to tell where the linux headers are installed. Signed-off-by: Xiaoyao Li --- tools/testing/selftests/kvm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile index 504a5fb0fa71..6f08cc512e15 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -47,7 +47,7 @@ LIBKVM += $(LIBKVM_$(UNAME_M)) # $(TEST_GEN_PROGS) starts with $(OUTPUT)/ include ../lib.mk -INSTALL_HDR_PATH = $(top_srcdir)/usr +INSTALL_HDR_PATH ?= $(top_srcdir)/usr LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/ LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/x86/include From patchwork Wed Mar 25 14:01:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoyao Li X-Patchwork-Id: 11457947 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 205DE1731 for ; Wed, 25 Mar 2020 14:19:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0B3B5208E0 for ; Wed, 25 Mar 2020 14:19:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727752AbgCYOTR (ORCPT ); Wed, 25 Mar 2020 10:19:17 -0400 Received: from mga04.intel.com ([192.55.52.120]:42324 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727722AbgCYOTQ (ORCPT ); Wed, 25 Mar 2020 10:19:16 -0400 IronPort-SDR: d7l3aC7Um9OM+yxINAWhTHFEUhEjP0KPKsn9TcKEJZDVkRFyti/Af/SM/lDA8eodrGLDMm4rpo aYdS/4Zqmpxw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 07:19:16 -0700 IronPort-SDR: CEX/lDNwY/UVmG+SfZNiGN6lBwlOu/j8P3BXx3W0dbMmr1Q2hn2HrqpQpXaMbBwmVen1LIxVuq xsPqN+YtrvXg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,304,1580803200"; d="scan'208";a="270811108" Received: from lxy-clx-4s.sh.intel.com ([10.239.43.39]) by fmsmga004.fm.intel.com with ESMTP; 25 Mar 2020 07:19:15 -0700 From: Xiaoyao Li To: Shuah Khan , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Xiaoyao Li Subject: [PATCH v2 4/6] selftests: Create variable INSTALL_HDR_PATH if need to install linux headers to $(OUTPUT)/usr Date: Wed, 25 Mar 2020 22:01:31 +0800 Message-Id: <20200325140133.103236-5-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200325140133.103236-1-xiaoyao.li@intel.com> References: <20200325140133.103236-1-xiaoyao.li@intel.com> MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org So sub TARGETs of selftest can know where the linux headers installed by checking INSTALL_HDR_PATH. Signed-off-by: Xiaoyao Li --- tools/testing/selftests/lib.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 78fb00bdf5c4..b51ff93da4de 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -35,6 +35,12 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/scripts/subarch.include ARCH ?= $(SUBARCH) +ifndef KSFT_KHDR_INSTALL_DONE +ifneq (1,$(DEFAULT_INSTALL_HDR_PATH)) +INSTALL_HDR_PATH := $(OUTPUT)/usr +endif +endif + # set default goal to all, so make without a target runs all, even when # all isn't the first target in the file. .DEFAULT_GOAL := all @@ -59,7 +65,7 @@ ifndef KSFT_KHDR_INSTALL_DONE ifeq (1,$(DEFAULT_INSTALL_HDR_PATH)) make --no-builtin-rules ARCH=$(ARCH) -C $(top_srcdir) headers_install else - make --no-builtin-rules INSTALL_HDR_PATH=$$OUTPUT/usr \ + make --no-builtin-rules INSTALL_HDR_PATH=$(INSTALL_HDR_PATH) \ ARCH=$(ARCH) -C $(top_srcdir) headers_install endif endif From patchwork Wed Mar 25 14:01:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoyao Li X-Patchwork-Id: 11457957 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 941C8139A for ; Wed, 25 Mar 2020 14:19:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7D162208E0 for ; Wed, 25 Mar 2020 14:19:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727803AbgCYOT1 (ORCPT ); Wed, 25 Mar 2020 10:19:27 -0400 Received: from mga04.intel.com ([192.55.52.120]:42324 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727780AbgCYOTS (ORCPT ); Wed, 25 Mar 2020 10:19:18 -0400 IronPort-SDR: jdWQvCxxTRj4iV6A7OAmTec6DGI/ZOs9OX3yKxFEwbr3ZShEO+lW/3AHkRROBWF2nwyofWxCyL ThqyBWC7zdNQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 07:19:18 -0700 IronPort-SDR: EBZTjwGrszcrOJd1OusRu6pAF/QeY9h6z1Hf9EGzkMHDjiJjEnasC6FGVKWVIRngdfL6Ppj0aU 0KtJluk4LtAw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,304,1580803200"; d="scan'208";a="270811112" Received: from lxy-clx-4s.sh.intel.com ([10.239.43.39]) by fmsmga004.fm.intel.com with ESMTP; 25 Mar 2020 07:19:16 -0700 From: Xiaoyao Li To: Shuah Khan , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Xiaoyao Li Subject: [PATCH v2 5/6] selftests: Generate build output of linux headers to $(OUTPUT)/linux-header-build Date: Wed, 25 Mar 2020 22:01:32 +0800 Message-Id: <20200325140133.103236-6-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200325140133.103236-1-xiaoyao.li@intel.com> References: <20200325140133.103236-1-xiaoyao.li@intel.com> MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org When build linux headers for selftests with OUTPUT specified, it makes linux src tree not clean. Fix it by generating the output file of "headers_install" to a fixed dir in $(OUTPUT). Signed-off-by: Xiaoyao Li --- tools/testing/selftests/lib.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index b51ff93da4de..bb830e4817fc 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -66,6 +66,7 @@ ifeq (1,$(DEFAULT_INSTALL_HDR_PATH)) make --no-builtin-rules ARCH=$(ARCH) -C $(top_srcdir) headers_install else make --no-builtin-rules INSTALL_HDR_PATH=$(INSTALL_HDR_PATH) \ + O=$(OUTPUT)/linux-header-build \ ARCH=$(ARCH) -C $(top_srcdir) headers_install endif endif From patchwork Wed Mar 25 14:01:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoyao Li X-Patchwork-Id: 11457953 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 95F3B17D4 for ; Wed, 25 Mar 2020 14:19:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 74D0720936 for ; Wed, 25 Mar 2020 14:19:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727811AbgCYOTW (ORCPT ); Wed, 25 Mar 2020 10:19:22 -0400 Received: from mga04.intel.com ([192.55.52.120]:42324 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727798AbgCYOTU (ORCPT ); Wed, 25 Mar 2020 10:19:20 -0400 IronPort-SDR: vjyoTQg0jyvM4M5OV46TTG/DxYuafbapKcVl0TSyug8xLRNpOnTdzFsMgxahoZva4EkI2hXyyx Sx8PLXRMarkg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 07:19:19 -0700 IronPort-SDR: ux9/FqZYumwPtHqSRHQhRwW6ySALvzV344N9CP/GbSZ+/Lp51W8/VhzNb5xos62WI+MLi4fa9O c8smGgnGbOxw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,304,1580803200"; d="scan'208";a="270811117" Received: from lxy-clx-4s.sh.intel.com ([10.239.43.39]) by fmsmga004.fm.intel.com with ESMTP; 25 Mar 2020 07:19:18 -0700 From: Xiaoyao Li To: Shuah Khan , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Xiaoyao Li Subject: [PATCH v2 6/6] selftests: export INSTALL_HDR_PATH if using "O" to specify output dir Date: Wed, 25 Mar 2020 22:01:33 +0800 Message-Id: <20200325140133.103236-7-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200325140133.103236-1-xiaoyao.li@intel.com> References: <20200325140133.103236-1-xiaoyao.li@intel.com> MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org When build kvm selftests in tools/testing/selftests directory with make O=/path/to/kselftests TARGETS=kvm it fails building some kvm test binaries due to lack of header files. Export INSTALL_HDR_PATH when "O" is specified, so that sub TARGET can get the right kernel headers with INSTALL_HDR_PATH. Signed-off-by: Xiaoyao Li --- tools/testing/selftests/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index be22dbe94a4c..f36bc6fd8086 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -110,6 +110,10 @@ ARCH ?= $(SUBARCH) export KSFT_KHDR_INSTALL_DONE := 1 export BUILD +ifneq (1,$(DEFAULT_INSTALL_HDR_PATH)) +export INSTALL_HDR_PATH := $(BUILD)/usr +endif + # build and run gpio when output directory is the src dir. # gpio has dependency on tools/gpio and builds tools/gpio # objects in the src directory in all cases making the src @@ -142,7 +146,7 @@ khdr: ifeq (1,$(DEFAULT_INSTALL_HDR_PATH)) $(MAKE) --no-builtin-rules ARCH=$(ARCH) -C $(top_srcdir) headers_install else - $(MAKE) --no-builtin-rules INSTALL_HDR_PATH=$$BUILD/usr \ + $(MAKE) --no-builtin-rules INSTALL_HDR_PATH=$(INSTALL_HDR_PATH) \ ARCH=$(ARCH) -C $(top_srcdir) headers_install endif