Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2437166rwa; Mon, 22 Aug 2022 07:43:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR74RyN9SBPnY52JUsPlhokRUghNGKmbQOavTDk8rp5bElt3shcaiBQgWOko3QaZV05EGSBf X-Received: by 2002:a17:90b:3a81:b0:1f7:2103:a8d6 with SMTP id om1-20020a17090b3a8100b001f72103a8d6mr28783262pjb.105.1661179417350; Mon, 22 Aug 2022 07:43:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661179417; cv=none; d=google.com; s=arc-20160816; b=Z4T4nXGJlFW1NLQYlCBvlnII3+wTBnkSLnSzK88N/Vzhnc+mWmGJbqEgR27/plxGtp p+zzo3xEXhD2XsK+ItK9lBVzWVWNFH5D9fzvpJE5kygUHepa1M6tR9AzTNAOir5sKH2A TVGj0U4WQ2826/ijiyQNbrjEoCL9r0C5K+VKHkMfQCyJZh8CAiZUnT3NdOJ9l4QgOush e+We02jb4PcdfrbHRqq5tXJkmd+WJmgNc6k7r2mFiB3JOUUj0xmqbRtBImljgLuqnfN7 MMfnBZl5AxURSHK/XhblICeiMs/VHoGlvV0mSTyrEukx+7YCaJBGd99et2C93hHBXQAF HROw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=kjJw1lixEQIrNLEOEvpfk899fKXlaGFwMiOH1KRB12M=; b=MqCY4JYzPzQaV1QpX2/OY1HkbHCtu/obwvgAW8oPYbdbvZ1ljEA1AvgRCrkGX2QE7r +0TNO1oJNRRwY/3g019osX/jljgznuWizr5BWQgW3yHKyZ+fC1NdNRXPMetz+O+IZ4Dd /T5vGCnuOqHDgr+SgbC4F/l1NAOs8l6ek9AzG0Qflm2V2MjJhxCv8z+kpbI98kGN0+Zd RHufrzNNos9iTpUmto3wJicbTVQeYyKSQGjJdd2ui0pl55AI3FsC2V3piAAllaTIpSE9 VTjKrvHIZHXRyN3Gxbf++IuwpChS06eqk7va5Ty65Zfj2YFkXxqVhddzV1KcnUubCWrg rsEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sbS1Hvyw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v186-20020a6389c3000000b0042a3f413a4fsi9481917pgd.356.2022.08.22.07.43.26; Mon, 22 Aug 2022 07:43:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sbS1Hvyw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235580AbiHVOBC (ORCPT + 99 others); Mon, 22 Aug 2022 10:01:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235593AbiHVOAw (ORCPT ); Mon, 22 Aug 2022 10:00:52 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DFB5371BC for ; Mon, 22 Aug 2022 07:00:50 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id pm13so2157250pjb.5 for ; Mon, 22 Aug 2022 07:00:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=kjJw1lixEQIrNLEOEvpfk899fKXlaGFwMiOH1KRB12M=; b=sbS1HvywFSfEMOSLBpwixOVInNvRZMvLa/Kj6cjMDiERtJknENs/JEaFvkLTsox6lW HD4cdPRvoxqqXTG5v+ldcmJu09E5vUo4y5L0I/ER8IAiD0ZOxI4Wo+c7YpbRruCkY90x TKXI3k0gBBHXJPm3aepPOBUOKMJ4TwA9uWK4eIa18oC/p7cgWdEweLt7eo9ssLSs55Zp rRYp8v+TiuKMipQB7gIvSf4UJogx6PjiN9ftTebRgwJBYh6jVgxg7D1cPaVMeW8UwbNo vkF4NzQlk+Pg+7XmzLnG1rD36ZCLjlE4iQbIsU+DZTRn0G9PxCoMSpoo8sbxSdOJZ8T3 1S1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=kjJw1lixEQIrNLEOEvpfk899fKXlaGFwMiOH1KRB12M=; b=HjNfFhMFxTEk2RKIb8IeLvJNwePIQepVtFFedm5o4A1fOjdxzUNDMWJ98cTgqAkPtL smTUL+G1aHQt4uviuIdsrZclJ1IDKKMraeT/JduYv02Svg168rR4ZjMozr2S5vk4trWE izaRm3gpfu+ivLhdI7RC96T9qqrqwWQky70WDwxJNQclURNUIsINr5TtSlTBIiGc2VRK xHw3vdU0YMfY0TXQelQxJ5fhh8ULHnre2MDEtKoi/mk0p118/jdtefVzmOaPBMs3uCe1 zq4+O0vef9cbfT5nkeX2SyJGB1HytMnBbRxLq3d99OqG9Abv/jYIkE/gc6mxs7kpPsnI Brjw== X-Gm-Message-State: ACgBeo3J1KqG6d/88zPc32gJAc+4tpE2fCennUKcjs2u2/nMMho1TvkL O/mMNjdS9WHSWflOvo8lANEW/sji6aSnJWnq0mILtg== X-Received: by 2002:a17:902:8683:b0:171:3114:7678 with SMTP id g3-20020a170902868300b0017131147678mr20494169plo.172.1661176849884; Mon, 22 Aug 2022 07:00:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Anders Roxell Date: Mon, 22 Aug 2022 16:00:37 +0200 Message-ID: Subject: Re: [PATCH] selftests/landlock: fix broken include of linux/landlock.h To: =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= Cc: Guillaume Tucker , Guillaume , Shuah Khan , Tim.Bird@sony.com, kernel@collabora.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 13 Aug 2022 at 14:31, Micka=C3=ABl Sala=C3=BCn wr= ote: > > > On 13/08/2022 12:01, Anders Roxell wrote: > > On Wed, 3 Aug 2022 at 22:14, Guillaume Tucker > > wrote: > >> > >> Revert part of the earlier changes to fix the kselftest build when > >> using a sub-directory from the top of the tree as this broke the > >> landlock test build as a side-effect when building with "make -C > >> tools/testing/selftests/landlock". > >> > >> Reported-by: Micka=C3=ABl Sala=C3=BCn > >> Fixes: a917dd94b832 ("selftests/landlock: drop deprecated headers depe= ndency") > >> Fixes: f2745dc0ba3d ("selftests: stop using KSFT_KHDR_INSTALL") > >> Signed-off-by: Guillaume Tucker > > > > Building with this patch doesn't work, it gives this output: > > make[3]: Entering directory > > '/home/anders/src/kernel/next/tools/testing/selftests/landlock' > > make[3]: Leaving directory > > '/home/anders/src/kernel/next/tools/testing/selftests/landlock' > > make[3]: *** No rule to make target > > '/home/anders/.cache/tuxmake/builds/78/build/kselftest/landlock/base_te= st', > > needed by 'all'. Stop. > > > > I'm building like this: > > tuxmake --runtime podman --target-arch x86_64 --toolchain gcc-12 > > --kconfig defconfig kselftest > > > > which translates into this make command: > > make --silent --keep-going --jobs=3D32 > > O=3D/home/anders/.cache/tuxmake/builds/78/build > > INSTALL_PATH=3D/home/anders/.cache/tuxmake/builds/78/build/kselftest_in= stall > > ARCH=3Dx86_64 CROSS_COMPILE=3Dx86_64-linux-gnu- kselftest-install > > This works well for me. Interesting > Which commit is checkout? I used the latest next tag, I tried to on todays tag as well next-20220822 and I see the same issue. building without 'O=3D...' I can build the landlock tests... > > > > > > building without this patch works, see below: > > > > make[3]: Entering directory > > '/home/anders/src/kernel/next/tools/testing/selftests/landlock' > > x86_64-linux-gnu-gcc -Wall -O2 -isystem > > /home/anders/.cache/tuxmake/builds/77/build/usr/include base_test.c > > -o /home/anders/.cache/tuxmake/builds/77/build/kselftest/landlock/bas= e_test > > -lcap > > x86_64-linux-gnu-gcc -Wall -O2 -isystem > > /home/anders/.cache/tuxmake/builds/77/build/usr/include fs_test.c > > -o /home/anders/.cache/tuxmake/builds/77/build/kselftest/landlock/fs_te= st > > -lcap > > x86_64-linux-gnu-gcc -Wall -O2 -isystem > > /home/anders/.cache/tuxmake/builds/77/build/usr/include > > ptrace_test.c -o > > /home/anders/.cache/tuxmake/builds/77/build/kselftest/landlock/ptrace_t= est > > -lcap > > x86_64-linux-gnu-gcc -Wall -O2 -isystem > > /home/anders/.cache/tuxmake/builds/77/build/usr/include true.c -o > > /home/anders/.cache/tuxmake/builds/77/build/kselftest/landlock/true > > -static > > make[3]: Leaving directory > > '/home/anders/src/kernel/next/tools/testing/selftests/landlock' > Does this work if you revert this patch, commit a917dd94b832 > ("selftests/landlock: drop deprecated headers dependency") and commit > f2745dc0ba3d ("selftests: stop using KSFT_KHDR_INSTALL")? > > This patch mainly revert commit a917dd94b832, so I don't see the issue. > > > > > > Cheers, > > Anders > > > >> --- > >> tools/testing/selftests/landlock/Makefile | 7 +++++-- > >> 1 file changed, 5 insertions(+), 2 deletions(-) > >> > >> diff --git a/tools/testing/selftests/landlock/Makefile b/tools/testing= /selftests/landlock/Makefile > >> index a6959df28eb0..02868ac3bc71 100644 > >> --- a/tools/testing/selftests/landlock/Makefile > >> +++ b/tools/testing/selftests/landlock/Makefile > >> @@ -9,10 +9,13 @@ TEST_GEN_PROGS :=3D $(src_test:.c=3D) > >> TEST_GEN_PROGS_EXTENDED :=3D true > >> > >> OVERRIDE_TARGETS :=3D 1 > >> +top_srcdir :=3D ../../../.. > >> include ../lib.mk > >> > >> +khdr_dir =3D $(top_srcdir)/usr/include > >> + > >> $(OUTPUT)/true: true.c > >> $(LINK.c) $< $(LDLIBS) -o $@ -static > >> > >> -$(OUTPUT)/%_test: %_test.c ../kselftest_harness.h common.h > >> - $(LINK.c) $< $(LDLIBS) -o $@ -lcap > >> +$(OUTPUT)/%_test: %_test.c $(khdr_dir)/linux/landlock.h ../kselftest_= harness.h common.h > >> + $(LINK.c) $< $(LDLIBS) -o $@ -lcap -I$(khdr_dir) > >> -- > >> 2.30.2 > >>