linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Shuah Khan <shuah@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	Thomas Meyer <thomas@m3y3r.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	Shuah Khan <shuahkh@osg.samsung.com>,
	Networking <netdev@vger.kernel.org>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	linux-kbuild <linux-kbuild@vger.kernel.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>
Subject: Re: selftests/bpf doesn't compile
Date: Fri, 4 Jan 2019 18:16:31 +0100	[thread overview]
Message-ID: <CAMuHMdXRN=mSKTjZNBSxQi-pkgSrKqeANxD-GB+hqC8pDjx7nQ@mail.gmail.com> (raw)
In-Reply-To: <295553a4-aadc-e5d1-229e-22d1966bc9f5@kernel.org>

Hi Shuah,

CC kbuild, gpio

On Thu, Sep 14, 2017 at 5:34 PM Shuah Khan <shuah@kernel.org> wrote:
> bpf test depends on clang and fails to compile when
>
> ------------------------------------------------------
> make -C tools/testing/selftests/bpf run_tests
>
>
> make: clang: Command not found
> Makefile:39: recipe for target '.linux-kselftest/tools/testing/selftests/bpf/test_pkt_access.o' failed
> make: *** [./linux-kselftest/tools/testing/selftests/bpf/test_pkt_access.o] Error 127
> make: Leaving directory '.linux-kselftest/tools/testing/selftests/bpf'

The above failure is indeed due to missing clang.

> With "make TARGETS=bpf kselftest" it fails earlier:
>
> make[3]: Entering directory './linux-kselftest/tools/lib/bpf'
> Makefile:40: tools/scripts/Makefile.arch: No such file or directory
> Makefile:84: tools/build/Makefile.feature: No such file or directory
> Makefile:143: tools/build/Makefile.include: No such file or directory

This is due to srctree being "." instead of the actual source tree,
when invoked as "make kselftest".
When using "make -C tools/testing/selftests", srctree is correct.

tools/testing/selftests/bpf/Makefile has:

    $(BPFOBJ): force
            $(MAKE) -C $(BPFDIR) OUTPUT=$(OUTPUT)/

to enter the tools/lib/bpf directory to force a build of libbpf.a

Note that tools/gpio has the same issue.

There seem to be _four_ different ways to build kselftests
(Documentation/dev-tools/kselftest.rst):

    make kselftest
    make O=/path/to/output kselftest
    make -C tools/testing/selftests
    make O=/path/to/output -C tools/testing/selftests

I'm not so fond of the latter two, as they basically run make from
somewhere inside the tree, which complicates things. I believe we don't
support this anywhere else.

Each of the four seem to have (different) issues. Especially when you
throw cross-compiling into the mix. And care about where installed
headers end up (yes, kselftest calls headers_install internally).

I'm working on fixes for some of them, but I don't know how to fix the
srctree issue.

Anyone with a suggestion?

Thanks!

> make[3]: *** No rule to make target 'tools/build/Makefile.include'.  Stop.
> make[3]: Leaving directory '.linux-kselftest/tools/lib/bpf'
> Makefile:34: recipe for target './linux-kselftest/tools/testing/selftests/bpf/libbpf.a' failed
> make[2]: *** [./linux-kselftest/tools/testing/selftests/bpf/libbpf.a] Error 2
> make[2]: Leaving directory './linux-kselftest/tools/testing/selftests/bpf'
> Makefile:69: recipe for target 'all' failed
> make[1]: *** [all] Error 2
> Makefile:1190: recipe for target 'kselftest' failed
> make: *** [kselftest] Error 2

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  parent reply	other threads:[~2019-01-04 17:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-08 11:19 [PATCH] selftests/bpf: Make bpf_util work on uniprocessor systems Thomas Meyer
2017-09-08 23:01 ` Alexei Starovoitov
2017-09-08 23:05   ` Daniel Borkmann
2017-09-14 15:01     ` Shuah Khan
2017-09-14 15:33       ` selftests/bpf doesn't compile Shuah Khan
2017-09-15 16:02         ` Alexei Starovoitov
2017-09-15 16:58           ` Edward Cree
2017-09-15 18:07             ` Alexei Starovoitov
2017-09-15 18:23               ` Daniel Borkmann
2017-09-15 18:48                 ` Daniel Borkmann
2017-09-15 22:41                   ` Shuah Khan
2017-09-18 13:31                     ` Daniel Borkmann
2017-09-15 17:00           ` Shuah Khan
2017-09-15 17:44             ` Shuah Khan
2017-09-15 18:14             ` Alexei Starovoitov
2017-09-15 22:32               ` Shuah Khan
2019-01-04 17:16         ` Geert Uytterhoeven [this message]
2019-01-04 19:07           ` shuah
2017-09-19 14:45       ` [PATCH] selftests/bpf: Make bpf_util work on uniprocessor systems Shuah Khan

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='CAMuHMdXRN=mSKTjZNBSxQi-pkgSrKqeANxD-GB+hqC8pDjx7nQ@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=alexei.starovoitov@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=shuahkh@osg.samsung.com \
    --cc=thomas@m3y3r.de \
    --cc=yamada.masahiro@socionext.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).