Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Jean-Philippe Brucker <jean-philippe@linaro.org>
To: Quentin Monnet <quentin@isovalent.com>
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	kafai@fb.com, songliubraving@fb.com, yhs@fb.com,
	john.fastabend@gmail.com, kpsingh@kernel.org, shuah@kernel.org,
	bpf@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH bpf] tools/runqslower: Fix cross-build
Date: Fri, 12 Nov 2021 16:28:28 +0000	[thread overview]
Message-ID: <YY6WLDizLBxnhgnP@myrica> (raw)
In-Reply-To: <d3a19501-01ee-a160-2275-c83fb0fb04b7@isovalent.com>

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.

Thanks,
Jean

  reply	other threads:[~2021-11-12 16:28 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 [this message]
2021-11-16  6:10     ` Andrii Nakryiko
2021-11-16  8:39       ` Jean-Philippe Brucker
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=YY6WLDizLBxnhgnP@myrica \
    --to=jean-philippe@linaro.org \
    --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