Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Jean-Philippe Brucker <jean-philippe@linaro.org>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Quentin Monnet <quentin@isovalent.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>, Martin Lau <kafai@fb.com>,
	Song Liu <songliubraving@fb.com>, Yonghong Song <yhs@fb.com>,
	john fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>, Shuah Khan <shuah@kernel.org>,
	bpf <bpf@vger.kernel.org>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH bpf] tools/runqslower: Fix cross-build
Date: Tue, 16 Nov 2021 08:39:53 +0000	[thread overview]
Message-ID: <YZNuWUEBG9Jbzerx@myrica> (raw)
In-Reply-To: <CAEf4BzbS-4sWORntzqh7qhEo=5cpzca0WA5ars70LxwzZwxgKA@mail.gmail.com>

On Mon, Nov 15, 2021 at 10:10:03PM -0800, Andrii Nakryiko wrote:
> On Fri, Nov 12, 2021 at 8:28 AM Jean-Philippe Brucker
> <jean-philippe@linaro.org> wrote:
> >
> > On Fri, Nov 12, 2021 at 04:17:21PM +0000, Quentin Monnet wrote:
> > > 2021-11-12 15:51 UTC+0000 ~ Jean-Philippe Brucker <jean-philippe@linaro.org>
> > > > Commit be79505caf3f ("tools/runqslower: Install libbpf headers when
> > > > building") uses the target libbpf to build the host bpftool, which
> > > > doesn't work when cross-building:
> > > >
> > > >   make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -C tools/bpf/runqslower O=/tmp/runqslower
> > > >   ...
> > > >     LINK    /tmp/runqslower/bpftool/bpftool
> > > >   /usr/bin/ld: /tmp/runqslower/libbpf/libbpf.a(libbpf-in.o): Relocations in generic ELF (EM: 183)
> > > >   /usr/bin/ld: /tmp/runqslower/libbpf/libbpf.a: error adding symbols: file in wrong format
> > > >   collect2: error: ld returned 1 exit status
> > > >
> > > > When cross-building, the target architecture differs from the host. The
> > > > bpftool used for building runqslower is executed on the host, and thus
> > > > must use a different libbpf than that used for runqslower itself.
> > > > Remove the LIBBPF_OUTPUT and LIBBPF_DESTDIR parameters, so the bpftool
> > > > build makes its own library if necessary.
> > > >
> > > > In the selftests, pass the host bpftool, already a prerequisite for the
> > > > runqslower recipe, as BPFTOOL_OUTPUT. The runqslower Makefile will use
> > > > the bpftool that's already built for selftests instead of making a new
> > > > one.
> > > >
> > > > Fixes: be79505caf3f ("tools/runqslower: Install libbpf headers when building")
> > > > Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> > > Reviewed-by: Quentin Monnet <quentin@isovalent.com>
> > >
> > > I realised too late I should have cc-ed you on those patches, apologies
> > > for not doing so. Thank you for the fix!
> >
> > No worries, I usually try to catch build issues in bpf-next but missed it
> > this time. I'm still slowly working towards getting automated testing on
> > Arm targets, which will catch regressions quicker.
> 
> Are you planning to contribute it to BPF CI? Or you meant you have
> your own separate system?

At the moment I'm looking at adding it to LKFT, which does regression
testing on various Arm boards (https://lkft.linaro.org/about/). The only
bit missing for that is support for cross-building tools with clang, which
I'll send shortly.

Thanks,
Jean

  reply	other threads:[~2021-11-16  8:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12 15:51 [PATCH bpf] tools/runqslower: Fix cross-build Jean-Philippe Brucker
2021-11-12 16:17 ` Quentin Monnet
2021-11-12 16:28   ` Jean-Philippe Brucker
2021-11-16  6:10     ` Andrii Nakryiko
2021-11-16  8:39       ` Jean-Philippe Brucker [this message]
2021-11-16 19:03         ` Andrii Nakryiko
2021-11-12 21:00 ` patchwork-bot+netdevbpf

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=YZNuWUEBG9Jbzerx@myrica \
    --to=jean-philippe@linaro.org \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=quentin@isovalent.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