linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/6] tools/bpf: Enable cross-building with clang
@ 2021-11-22 19:20 Jean-Philippe Brucker
  2021-11-22 19:20 ` [PATCH bpf-next 1/6] tools: Help " Jean-Philippe Brucker
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Jean-Philippe Brucker @ 2021-11-22 19:20 UTC (permalink / raw)
  To: ast, daniel, andrii, shuah, nathan, ndesaulniers
  Cc: kafai, songliubraving, yhs, john.fastabend, kpsingh, bpf,
	linux-kselftest, llvm, Jean-Philippe Brucker

Add support for cross-building BPF tools and selftests with clang, by
passing LLVM=1 or CC=clang to make, as well as CROSS_COMPILE. A single
clang toolchain can generate binaries for multiple architectures, so
instead of having prefixes such as aarch64-linux-gnu-gcc, clang uses the
-target parameter: `clang -target aarch64-linux-gnu'.

Patch 1 adds the parameter in Makefile.include so tools can easily
support this. Patch 2 prepares for the libbpf change from patch 3 (keep
building resolve_btfids's libbpf in the host arch, when cross-building
the kernel with clang). Patches 3-6 enable cross-building BPF tools with
clang.

Jean-Philippe Brucker (6):
  tools: Help cross-building with clang
  tools/resolve_btfids: Support cross-building the kernel with clang
  tools/libbpf: Enable cross-building with clang
  bpftool: Enable cross-building with clang
  tools/runqslower: Enable cross-building with clang
  selftests/bpf: Enable cross-building with clang

 tools/bpf/bpftool/Makefile           | 13 +++++++------
 tools/bpf/resolve_btfids/Makefile    |  1 +
 tools/bpf/runqslower/Makefile        |  4 ++--
 tools/lib/bpf/Makefile               |  3 ++-
 tools/scripts/Makefile.include       | 13 ++++++++++++-
 tools/testing/selftests/bpf/Makefile |  8 ++++----
 6 files changed, 28 insertions(+), 14 deletions(-)

-- 
2.33.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-11-29 23:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-22 19:20 [PATCH bpf-next 0/6] tools/bpf: Enable cross-building with clang Jean-Philippe Brucker
2021-11-22 19:20 ` [PATCH bpf-next 1/6] tools: Help " Jean-Philippe Brucker
2021-11-22 19:20 ` [PATCH bpf-next 2/6] tools/resolve_btfids: Support cross-building the kernel " Jean-Philippe Brucker
2021-11-22 19:20 ` [PATCH bpf-next 3/6] tools/libbpf: Enable cross-building " Jean-Philippe Brucker
2021-11-29 23:51   ` Andrii Nakryiko
2021-11-22 19:20 ` [PATCH bpf-next 4/6] bpftool: " Jean-Philippe Brucker
2021-11-29 23:53   ` Andrii Nakryiko
2021-11-22 19:20 ` [PATCH bpf-next 5/6] tools/runqslower: " Jean-Philippe Brucker
2021-11-22 19:20 ` [PATCH bpf-next 6/6] selftests/bpf: " Jean-Philippe Brucker
2021-11-26 20:36 ` [PATCH bpf-next 0/6] tools/bpf: " Quentin Monnet
2021-11-26 21:15   ` Daniel Borkmann
2021-11-29  9:42   ` Jean-Philippe Brucker

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).