From mboxrd@z Thu Jan 1 00:00:00 1970 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 4C8B9C433F5 for ; Tue, 18 Jan 2022 12:36:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C4E8A6B0072; Tue, 18 Jan 2022 07:36:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BFDA96B0073; Tue, 18 Jan 2022 07:36:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AECBE6B0074; Tue, 18 Jan 2022 07:36:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0233.hostedemail.com [216.40.44.233]) by kanga.kvack.org (Postfix) with ESMTP id A17F66B0072 for ; Tue, 18 Jan 2022 07:36:04 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 0147F95180 for ; Tue, 18 Jan 2022 12:36:04 +0000 (UTC) X-FDA: 79043355048.10.F8EC119 Received: from smtp-bc08.mail.infomaniak.ch (smtp-bc08.mail.infomaniak.ch [45.157.188.8]) by imf25.hostedemail.com (Postfix) with ESMTP id 3D63EA0002 for ; Tue, 18 Jan 2022 12:36:03 +0000 (UTC) Received: from smtp-3-0001.mail.infomaniak.ch (unknown [10.4.36.108]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4JdStT1zBDzMq01B; Tue, 18 Jan 2022 13:36:01 +0100 (CET) Received: from ns3096276.ip-94-23-54.eu (unknown [23.97.221.149]) by smtp-3-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4JdStQ5z5tzlhMBj; Tue, 18 Jan 2022 13:35:58 +0100 (CET) Message-ID: <8ea3bd61-8251-a5b6-c0b4-6d15bac4d2c5@digikod.net> Date: Tue, 18 Jan 2022 13:35:46 +0100 MIME-Version: 1.0 User-Agent: Content-Language: en-US To: Muhammad Usama Anjum , Shuah Khan , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , =?UTF-8?Q?Andr=c3=a9_Almeida?= , Paolo Bonzini , "David S. Miller" , Jakub Kicinski , Mat Martineau , Matthieu Baerts , Andrew Morton , chiminghao , "open list:KERNEL SELFTEST FRAMEWORK" , open list , "open list:KERNEL VIRTUAL MACHINE (KVM)" , "open list:LANDLOCK SECURITY MODULE" , "open list:NETWORKING [GENERAL]" , "open list:NETWORKING [MPTCP]" , "open list:MEMORY MANAGEMENT" Cc: kernel@collabora.com References: <20220118112909.1885705-1-usama.anjum@collabora.com> <20220118112909.1885705-7-usama.anjum@collabora.com> From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= Subject: Re: [PATCH 06/10] selftests: landlock: Add the uapi headers include variable In-Reply-To: <20220118112909.1885705-7-usama.anjum@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 3D63EA0002 X-Stat-Signature: ao1bpjyi5iu6usy9dbh83rx78o9gu9x7 Authentication-Results: imf25.hostedemail.com; dkim=none; spf=pass (imf25.hostedemail.com: domain of mic@digikod.net designates 45.157.188.8 as permitted sender) smtp.mailfrom=mic@digikod.net; dmarc=none X-Rspamd-Server: rspam08 X-HE-Tag: 1642509363-665260 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000007, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 18/01/2022 12:29, Muhammad Usama Anjum wrote: > Out of tree build of this test fails if relative path of the output > directory is specified. Remove the un-needed include paths and use > KHDR_INCLUDES to correctly reach the headers. > > Signed-off-by: Muhammad Usama Anjum > --- > tools/testing/selftests/landlock/Makefile | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) > > diff --git a/tools/testing/selftests/landlock/Makefile b/tools/testing/selftests/landlock/Makefile > index a99596ca9882..44c724b38a37 100644 > --- a/tools/testing/selftests/landlock/Makefile > +++ b/tools/testing/selftests/landlock/Makefile > @@ -1,6 +1,6 @@ > # SPDX-License-Identifier: GPL-2.0 > > -CFLAGS += -Wall -O2 > +CFLAGS += -Wall -O2 $(KHDR_INCLUDES) > > src_test := $(wildcard *_test.c) > > @@ -12,13 +12,8 @@ KSFT_KHDR_INSTALL := 1 > OVERRIDE_TARGETS := 1 > include ../lib.mk > > -khdr_dir = $(top_srcdir)/usr/include This should be updated to: khdr_dir = ${abs_srctree}/usr/include Using a global KHDR_DIR instead of khdr_dir could be useful for others too. > - > -$(khdr_dir)/linux/landlock.h: khdr > - @: This should be kept as is, otherwise we loose this check to rebuild the headers if linux/landlock.h is updated, which is handy for development. KVM lost a similar behavior with this patch series. > - > $(OUTPUT)/true: true.c > $(LINK.c) $< $(LDLIBS) -o $@ -static > > -$(OUTPUT)/%_test: %_test.c $(khdr_dir)/linux/landlock.h ../kselftest_harness.h common.h This should not be changed. > - $(LINK.c) $< $(LDLIBS) -o $@ -lcap -I$(khdr_dir) > +$(OUTPUT)/%_test: %_test.c ../kselftest_harness.h common.h > + $(LINK.c) $< $(LDLIBS) -o $@ -lcap This doesn't work when building in the local directory because $abs_srctree and $KHDR_INCLUDES are empty: cd tools/testing/selftests/landlock && make