mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mickaël Salaün" <mic@digikod.net>
To: Anders Roxell <anders.roxell@linaro.org>
Cc: Guillaume Tucker <guillaume.tucker@collabora.com>,
	Guillaume <guillaume.tucker@gmail.com>,
	Shuah Khan <shuah@kernel.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, 25 Aug 2022 11:31:23 +0200	[thread overview]
Message-ID: <eeb34913-5930-3e82-3d8f-a00e20798e4a@digikod.net> (raw)
In-Reply-To: <CADYN=9+CFEV9QpNbhi6gKqJr1V5Jc8Q5hGhCD_ESkRXP2X3gbQ@mail.gmail.com>


On 22/08/2022 16:00, Anders Roxell wrote:
> On Sat, 13 Aug 2022 at 14:31, Mickaël Salaün <mic@digikod.net> wrote:
>>
>>
>> On 13/08/2022 12:01, Anders Roxell wrote:
>>> On Wed, 3 Aug 2022 at 22:14, Guillaume Tucker
>>> <guillaume.tucker@collabora.com> 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>
>>>
>>> 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=32
>>> O=/home/anders/.cache/tuxmake/builds/78/build
>>> INSTALL_PATH=/home/anders/.cache/tuxmake/builds/78/build/kselftest_install
>>> ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- kselftest-install
>>
>> This works well for me.
> 
> Interesting

I used this command (inspired by yours):

make --silent --keep-going --jobs=32 "O=${HOME}/build" 
"INSTALL_PATH=${HOME}/build/kselftest_install" ARCH=x86_64 
CROSS_COMPILE=x86_64-linux-gnu- kselftest-install

Can you run this command without using tuxmake?


> 
>> 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=...' I can build the landlock tests...

Can you test it with Linux v5.19 and v6.0-rc2 and see if there is a 
difference?

Is your workspace clean?
What is the version of your make?

Can you replace this line from the Makefile with static names?
"src_test := $(wildcard *_test.c)"



> 
>>
>>
>>>
>>> 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_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_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'
>> 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 := $(src_test:.c=)
>>>>    TEST_GEN_PROGS_EXTENDED := true
>>>>
>>>>    OVERRIDE_TARGETS := 1
>>>> +top_srcdir := ../../../..
>>>>    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)
>>>> --
>>>> 2.30.2
>>>>

      reply	other threads:[~2022-08-25  9:31 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
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 [this message]

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=eeb34913-5930-3e82-3d8f-a00e20798e4a@digikod.net \
    --to=mic@digikod.net \
    --cc=Tim.Bird@sony.com \
    --cc=anders.roxell@linaro.org \
    --cc=guillaume.tucker@collabora.com \
    --cc=guillaume.tucker@gmail.com \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --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®