From: Masahiro Yamada <masahiroy@kernel.org>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Song Liu <songliubraving@fb.com>,
kvm@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
Paul Mackerras <paulus@samba.org>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@vger.kernel.org>, Shuah Khan <shuah@kernel.org>,
Janosch Frank <frankja@linux.ibm.com>,
Daniel Borkmann <daniel@iogearbox.net>,
John Fastabend <john.fastabend@gmail.com>,
Andrii Nakryiko <andrii@kernel.org>,
clang-built-linux <clang-built-linux@googlegroups.com>,
Harish <harish@linux.ibm.com>, Yonghong Song <yhs@fb.com>,
Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
KP Singh <kpsingh@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Networking <netdev@vger.kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Paolo Bonzini <pbonzini@redhat.com>, bpf <bpf@vger.kernel.org>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
Martin KaFai Lau <kafai@fb.com>
Subject: Re: [PATCH 2/2] tools: do not include scripts/Kbuild.include
Date: Fri, 16 Apr 2021 21:53:18 +0900 [thread overview]
Message-ID: <CAK7LNASfiiLJd9dOpaJ47pJ4FzgV8JL3vU8okOYz0=eaE4OYgQ@mail.gmail.com> (raw)
In-Reply-To: <0eeed665-a105-917b-e7fb-8dafe2ae9d94@de.ibm.com>
On Fri, Apr 16, 2021 at 2:56 PM Christian Borntraeger
<borntraeger@de.ibm.com> wrote:
>
>
> On 15.04.21 10:06, Christian Borntraeger wrote:
> >
> > On 15.04.21 09:27, Masahiro Yamada wrote:
> >> Since commit d9f4ff50d2aa ("kbuild: spilt cc-option and friends to
> >> scripts/Makefile.compiler"), some kselftests fail to build.
> >>
> >> The tools/ directory opted out Kbuild, and went in a different
> >> direction. They copy any kind of files to the tools/ directory
> >> in order to do whatever they want to do in their world.
> >>
> >> tools/build/Build.include mimics scripts/Kbuild.include, but some
> >> tool Makefiles included the Kbuild one to import a feature that is
> >> missing in tools/build/Build.include:
> >>
> >> - Commit ec04aa3ae87b ("tools/thermal: tmon: use "-fstack-protector"
> >> only if supported") included scripts/Kbuild.include from
> >> tools/thermal/tmon/Makefile to import the cc-option macro.
> >>
> >> - Commit c2390f16fc5b ("selftests: kvm: fix for compilers that do
> >> not support -no-pie") included scripts/Kbuild.include from
> >> tools/testing/selftests/kvm/Makefile to import the try-run macro.
> >>
> >> - Commit 9cae4ace80ef ("selftests/bpf: do not ignore clang
> >> failures") included scripts/Kbuild.include from
> >> tools/testing/selftests/bpf/Makefile to import the .DELETE_ON_ERROR
> >> target.
> >>
> >> - Commit 0695f8bca93e ("selftests/powerpc: Handle Makefile for
> >> unrecognized option") included scripts/Kbuild.include from
> >> tools/testing/selftests/powerpc/pmu/ebb/Makefile to import the
> >> try-run macro.
> >>
> >> Copy what they want there, and stop including scripts/Kbuild.include
> >> from the tool Makefiles.
> >>
> >> Link: https://lore.kernel.org/lkml/86dadf33-70f7-a5ac-cb8c-64966d2f45a1@linux.ibm.com/
> >> Fixes: d9f4ff50d2aa ("kbuild: spilt cc-option and friends to scripts/Makefile.compiler")
> >> Reported-by: Janosch Frank <frankja@linux.ibm.com>
> >> Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
> >> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> >
> > When applying this on top of d9f4ff50d2aa ("kbuild: spilt cc-option and friends to scripts/Makefile.compiler")
> >
> > I still do get
> >
> > # ==== Test Assertion Failure ====
> > # lib/kvm_util.c:142: vm->fd >= 0
> > # pid=315635 tid=315635 - Invalid argument
> > # 1 0x0000000001002f4b: vm_open at kvm_util.c:142
> > # 2 (inlined by) vm_create at kvm_util.c:258
> > # 3 0x00000000010015ef: test_add_max_memory_regions at set_memory_region_test.c:351
> > # 4 (inlined by) main at set_memory_region_test.c:397
> > # 5 0x000003ff971abb89: ?? ??:0
> > # 6 0x00000000010017ad: .annobin_abi_note.c.hot at crt1.o:?
> > # KVM_CREATE_VM ioctl failed, rc: -1 errno: 22
> > not ok 7 selftests: kvm: set_memory_region_test # exit=254
> >
> > and the testcase compilation does not pickup the pgste option.
>
> What does work is the following:
> diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
> index a6d61f451f88..d9c6d9c2069e 100644
> --- a/tools/testing/selftests/kvm/Makefile
> +++ b/tools/testing/selftests/kvm/Makefile
> @@ -1,5 +1,6 @@
> # SPDX-License-Identifier: GPL-2.0-only
> include ../../../../scripts/Kbuild.include
> +include ../../../../scripts/Makefile.compiler
>
> all:
>
>
> as it does pickup the linker option handling.
Kbuild and the tools are divorced.
They cannot be married unless the tools/
build system is largely refactored.
That will be a tons of works (and
I am not sure if it is welcome).
The Kbuild refactoring should not be bothered by
the tools.
For now, I want them separated from each other.
--
Best Regards
Masahiro Yamada
prev parent reply other threads:[~2021-04-16 12:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210415072700.147125-1-masahiroy@kernel.org>
2021-04-15 7:27 ` [PATCH 2/2] tools: do not include scripts/Kbuild.include Masahiro Yamada
2021-04-15 7:40 ` Paolo Bonzini
2021-04-15 8:04 ` Masahiro Yamada
2021-04-15 8:25 ` Paolo Bonzini
2021-04-15 8:06 ` Christian Borntraeger
2021-04-16 5:56 ` Christian Borntraeger
2021-04-16 12:53 ` Masahiro Yamada [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='CAK7LNASfiiLJd9dOpaJ47pJ4FzgV8JL3vU8okOYz0=eaE4OYgQ@mail.gmail.com' \
--to=masahiroy@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=borntraeger@de.ibm.com \
--cc=bpf@vger.kernel.org \
--cc=clang-built-linux@googlegroups.com \
--cc=daniel@iogearbox.net \
--cc=frankja@linux.ibm.com \
--cc=harish@linux.ibm.com \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=netdev@vger.kernel.org \
--cc=paulus@samba.org \
--cc=pbonzini@redhat.com \
--cc=shuah@kernel.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
/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;
as well as URLs for NNTP newsgroup(s).