From patchwork Wed Jan 19 10:15:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 12717397 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D1ADC43219 for ; Wed, 19 Jan 2022 10:16:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0A48A6B0074; Wed, 19 Jan 2022 05:16:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 054FB6B0075; Wed, 19 Jan 2022 05:16:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EAD9A6B0078; Wed, 19 Jan 2022 05:16:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0137.hostedemail.com [216.40.44.137]) by kanga.kvack.org (Postfix) with ESMTP id DCA146B0074 for ; Wed, 19 Jan 2022 05:16:06 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 9A3F793D97 for ; Wed, 19 Jan 2022 10:16:06 +0000 (UTC) X-FDA: 79046631132.18.A6DF54A Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by imf01.hostedemail.com (Postfix) with ESMTP id A14DA40008 for ; Wed, 19 Jan 2022 10:16:05 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: usama.anjum) with ESMTPSA id 2D8DE1F4442D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1642587364; bh=dpLad+4CdJOaMlTWmTiAawK1sEdubzbwv8rkOkH0hpM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X94KRF9XESjNH/MFzgeFityMIjUQybaERD8qsUFghk8zoDhqkES3+vIeeTefMBTlR wSPtHkYEQg6WOxXZCIux4337NUprYwMy2nj4sUfAExaH0OxLP/w+mXgYq12JLzlpQh TU/GM0DHMnSz+pgkV41s59PcN74BrMCdighGngQrGotdJgpfq25+X3F8zQJ3LH6mj5 lBvfCYNhVpJmpc4yqz/w7xfd5sMdbwqZnbz5Tff9Jc8tTIIpHSE5xblpi/M08aGPpS nFELH7jgSeMGywoqv7n2Qp+eLH1vtTZpw9JCEMyBzMjq/Udx7ZlRgRI3j3x1MlXZ5O 1zZvb7mg3Y2Ww== From: Muhammad Usama Anjum To: Shuah Khan , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , =?utf-8?q?Andr=C3=A9_Almeida?= , Paolo Bonzini , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , "David S. Miller" , Jakub Kicinski , Mat Martineau , Matthieu Baerts , Andrew Morton , chiminghao , linux-kselftest@vger.kernel.org (open list:KERNEL SELFTEST FRAMEWORK), linux-kernel@vger.kernel.org (open list), kvm@vger.kernel.org (open list:KERNEL VIRTUAL MACHINE (KVM)), linux-security-module@vger.kernel.org (open list:LANDLOCK SECURITY MODULE), netdev@vger.kernel.org (open list:NETWORKING [GENERAL]), mptcp@lists.linux.dev (open list:NETWORKING [MPTCP]), linux-mm@kvack.org (open list:MEMORY MANAGEMENT) Cc: Muhammad Usama Anjum , kernel@collabora.com Subject: [PATCH V2 02/10] selftests: Add and export a kernel uapi headers path Date: Wed, 19 Jan 2022 15:15:23 +0500 Message-Id: <20220119101531.2850400-3-usama.anjum@collabora.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220119101531.2850400-1-usama.anjum@collabora.com> References: <20220119101531.2850400-1-usama.anjum@collabora.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: A14DA40008 X-Stat-Signature: b59gch8s3tq7jtohiwjjf19c6q3z5i7p Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=X94KRF9X; dmarc=pass (policy=none) header.from=collabora.com; spf=pass (imf01.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.227 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com X-Rspamd-Server: rspam03 X-HE-Tag: 1642587365-781394 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Kernel uapi headers can be present at different paths depending upon how the build was invoked. It becomes impossible for the tests to include the correct headers directory. Set and export KHDR_INCLUDES variable to make it possible for sub make files to include the header files. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index a7b63860b7bc..21f983dfd047 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -129,8 +129,11 @@ ifneq ($(KBUILD_OUTPUT),) # $(realpath ...) resolves symlinks abs_objtree := $(realpath $(abs_objtree)) BUILD := $(abs_objtree)/kselftest + KHDR_INCLUDES := -I${abs_objtree}/usr/include else BUILD := $(CURDIR) + abs_srctree := $(shell cd $(top_srcdir) && pwd) + KHDR_INCLUDES := -I${abs_srctree}/usr/include DEFAULT_INSTALL_HDR_PATH := 1 endif @@ -139,6 +142,7 @@ include $(top_srcdir)/scripts/subarch.include ARCH ?= $(SUBARCH) export KSFT_KHDR_INSTALL_DONE := 1 export BUILD +export KHDR_INCLUDES # set default goal to all, so make without a target runs all, even when # all isn't the first target in the file.