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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2110C433FE for ; Tue, 18 Jan 2022 12:41:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236801AbiARMlv (ORCPT ); Tue, 18 Jan 2022 07:41:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234111AbiARMlr (ORCPT ); Tue, 18 Jan 2022 07:41:47 -0500 X-Greylist: delayed 343 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 18 Jan 2022 04:41:47 PST Received: from smtp-42aa.mail.infomaniak.ch (smtp-42aa.mail.infomaniak.ch [IPv6:2001:1600:4:17::42aa]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AF96C061574; Tue, 18 Jan 2022 04:41:47 -0800 (PST) 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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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