Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp521768rwb; Sat, 13 Aug 2022 03:12:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR7XuHV7ZsFZlhPCeZzAdxBurT0+TOxMCg9MAGLVpoO6PUnT/dciS9F6P8vT0994JYg12O5m X-Received: by 2002:a63:5c59:0:b0:41d:131d:e98b with SMTP id n25-20020a635c59000000b0041d131de98bmr6314403pgm.312.1660385566350; Sat, 13 Aug 2022 03:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660385566; cv=none; d=google.com; s=arc-20160816; b=IMH2zpkDatSPnl7wqyR9urvNGsPRloTRmODT49Apusj4d25K/eKgQaAIVVsIgAIpaD 5woWuFrm/oC6Doudcf5nOWWM9LZnUqdwrVO0vVlrLPex4D5QV2JeewOtB5S4/5KnFAGJ 3/PIKyipHspKSK8moWelUYtmiyIf65hp6A/P/DMnIaAQqXwy4KdUGrYGHlUeL8CoORp8 gm8Nk5fizdorbaUr8sksuN35oVgSRoc/GYoq/P9Zw/SDQxvqKD3tVMEZ22ILTyq4fTrJ QUl/bucZ7lyivaOgUxwoN7M+Zmgz/ZwKilICXhO0iealP4u7L/ggxtgVq2UU/Z2xz3Db 3s1w== 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=rXjZq7TyJRpGA36wuNWeax0N/DTCuezFM2I6n+kaOFc=; b=mvntHspcDVx4ask4cPtCwROsEvVNiem9LwZYl0jWw+iuQgQjBa1Sr65x6ZW1Rl8EVE /Y588nU9cydeea6MqjohnWIutluexg5+SSiyr4WBKhe8m8unSsw1Fp8GnPijjO0w0kOu eZFRIj2fojGczkDZgp01B7gfZIi1Rz35QeqdhocgHz6YvicguldXU05UiBtRrknLj/9q +reWlWrE4rEmPkkZZPcTzDz6ukQRRmaPMwvnxkyGU6/tlkHx/wYcey5Gqi7bl5jYL2uV DShDwaOZKZk21wUydE0LBKNx9IbpsciC+tkqgGB98frN5S+LU5sZi4++GLhsBEK2k4g7 /sXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uludQ0lL; 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 s20-20020a056a00195400b0052d38770f4bsi4856910pfk.341.2022.08.13.03.12.32; Sat, 13 Aug 2022 03:12:46 -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=uludQ0lL; 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 S238935AbiHMKBc (ORCPT + 99 others); Sat, 13 Aug 2022 06:01:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238856AbiHMKB0 (ORCPT ); Sat, 13 Aug 2022 06:01:26 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75ACE7678 for ; Sat, 13 Aug 2022 03:01:24 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id o3-20020a17090a0a0300b001f7649cd317so10421109pjo.0 for ; Sat, 13 Aug 2022 03:01:24 -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=rXjZq7TyJRpGA36wuNWeax0N/DTCuezFM2I6n+kaOFc=; b=uludQ0lLYxsMsamFFMGEAF4NjuSBTl68G7b7d5T0Xyrr1vKPHVnSigosbzHsNWpJ6c lnun7Gx5kbIHOBuPvWXq/znBa6WjZh6uG+avVo3AtMmdq8io6sddwwKHRAkQ+S7vq2eN A/Pou91K9q3DcouiBrvJRDkTzd6GtgxnNDt8HTi3XXlHiDBoI8FYWGvak7noJLaoqHQq fjvj83QfEkS3s38zh/DRL/tHYz901CKghNoqoIKn/mRAvXgvIcKvb+ZW8emMfm5MZGyo /s3fYXOxL8Y5m0xY4qz7twAk94MjBZulAuxffst0EQEGfOfw0c7eEVh5Dc+njTqxPd9U MnPQ== 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=rXjZq7TyJRpGA36wuNWeax0N/DTCuezFM2I6n+kaOFc=; b=SNezUE/2gX6xBZ6gO4S0Pg+N27cu4rrOuo5zLdTKeYQ143ybYPftnXvwPmz5hgNIE9 yxmnodRe0umoG0T/f4DCE2nNVAKfQnTayqqQNRNnqlAD1uIDKXjCUShplXHs0W2eiQ7/ /LgeTwxhNjKJBanAeg2iA88wV4AhAfJR8zrh1lrQwVv72Qiw76oKzn6LL0CVI/NnepEJ +d2L7/rqHUvicZ5Tc/03FzwNo8cqp0Ju4sNY+pjoN0yVHYqItIu2GXT6s5EFXYZ8bSrb fyEx48CAGqXQVNO/Ik6mFfq2yac5m7rdYy7MGe9dVNjsmMfdovnmI5TtGTWpMsmtxkuB 297g== X-Gm-Message-State: ACgBeo0vc2t1cvMKIOOeYCNqzH7NlmzgKvsgDvggDewZR1NIomNp/4Ox oWZT3lQcFpME145QfYwkmc3xqtofQk/H32yaeIvXuw== X-Received: by 2002:a17:902:8683:b0:171:3114:7678 with SMTP id g3-20020a170902868300b0017131147678mr7861379plo.172.1660384883745; Sat, 13 Aug 2022 03:01:23 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Anders Roxell Date: Sat, 13 Aug 2022 12:01:12 +0200 Message-ID: Subject: Re: [PATCH] selftests/landlock: fix broken include of linux/landlock.h To: Guillaume Tucker Cc: Guillaume , Shuah Khan , =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= , 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 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 depende= ncy") > 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_test', 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_instal= l ARCH=3Dx86_64 CROSS_COMPILE=3Dx86_64-linux-gnu- kselftest-install 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/base_tes= t -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_test -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_test -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' 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/se= lftests/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_har= ness.h common.h > + $(LINK.c) $< $(LDLIBS) -o $@ -lcap -I$(khdr_dir) > -- > 2.30.2 >