From: Guillaume Tucker <guillaume.tucker@collabora.com>
To: "Mickaël Salaün" <mic@digikod.net>, "Shuah Khan" <shuah@kernel.org>
Cc: Anders Roxell <anders.roxell@linaro.org>,
Tim.Bird@sony.com, kernel@collabora.com,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-security-module@vger.kernel.org
Subject: Re: [PATCH] selftests/landlock: fix broken include of linux/landlock.h
Date: Thu, 4 Aug 2022 21:38:34 +0200 [thread overview]
Message-ID: <76a2ac43-6e3d-0b62-7c8c-eec5f247f8f8@collabora.com> (raw)
In-Reply-To: <f1fc4e6e-e2a6-3ec7-2d3b-215111a4b9ae@digikod.net>
On 04/08/2022 12:36, Mickaël Salaün wrote:
>
> On 03/08/2022 22:13, 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ël Salaün <mic@digikod.net>
>> Fixes: a917dd94b832 ("selftests/landlock: drop deprecated headers dependency")
>> Fixes: f2745dc0ba3d ("selftests: stop using KSFT_KHDR_INSTALL")
>> Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
>> ---
>> 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 := $(src_test:.c=)
>> TEST_GEN_PROGS_EXTENDED := true
>> OVERRIDE_TARGETS := 1
>> +top_srcdir := ../../../..
>
> Not sure it changes much, but most other selftests Makefiles use "top_srcdir = ../../../.." (without ":="). Why this change?
I didn't simply apply your diff but edited the file by hand to
test various combinations and see what side effects it might
have. So when I added top_srcdir I typed it by hand and used :=
as a reflex since it's the standard way of assigning variables.
Using = instead only makes a difference when the r-value has
something dynamic as it will be re-evaluated every time it's
used. So for constant values, I guess it's more of a question of
coding style and conventions. Maybe all the top_srcdir variables
should be changed to := but that's unnecessary churn... Either
way, it's benign.
Shuah, feel free to change this back to = in this particular case
if it's more consistent with other Makefiles. Consistency is
often better than arbitrary rules. Or conversely, change to :=
for the khdr_dir definition... Entirely up to you I think.
Thanks,
Guillaume
>> include ../lib.mk
>> +khdr_dir = $(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)
next prev parent reply other threads:[~2022-08-04 19:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-03 20:13 Guillaume Tucker
2022-08-03 23:08 ` Shuah Khan
2022-08-04 10:36 ` Mickaël Salaün
2022-08-04 19:38 ` Guillaume Tucker [this message]
2022-08-05 17:16 ` Mickaël Salaün
2022-08-12 15:29 ` Mickaël Salaün
2022-08-15 17:17 ` Shuah Khan
2022-08-16 16:57 ` Mickaël Salaün
2022-08-13 10:01 ` Anders Roxell
2022-08-13 12:31 ` Mickaël Salaün
2022-08-22 14:00 ` Anders Roxell
2022-08-25 9:31 ` Mickaël Salaün
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=76a2ac43-6e3d-0b62-7c8c-eec5f247f8f8@collabora.com \
--to=guillaume.tucker@collabora.com \
--cc=Tim.Bird@sony.com \
--cc=anders.roxell@linaro.org \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mic@digikod.net \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®