Skip to content

selftests/bpf: Improve building with extra

Viktor Malik bpf 3 versions – Applied

Status from this message: I've applied the last two patches, they seem to be independent from

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 7 repliesApplied 3/3
  2. v23 patches 6 repliesApplied 3/3
  3. v13 patches 9 repliesSuperseded

Changes in v3 from the cover letter

- resolve conflicts between patch #1 and 4192bb294f80 ("selftests/bpf:
Provide a generic [un]load_module helper")
- add Quentin's and Jiri's acks for patches #2 and #3

Patches in v3 All 3 applied

#Subject and filesSizeRepliesApplied
1/3selftests/bpf: Allow building with extra flagstools/testing/selftests/bpf/Makefile+23 -114 repliesApplied
2/3bpftool: Prevent setting duplicate _GNU_SOURCE in Makefiletools/bpf/bpftool/Makefile+5 -11 replyApplied
3/3selftests/bpf: Disable warnings on unused flags for Clang buildstools/testing/selftests/bpf/Makefile+2 -00 repliesApplied

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchQuentin MonnetJiri OlsaToke Høiland-Jørgensen
1/3R-b
2/3A-b A-b R-b
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH bpf-next v3 0/3] selftests/bpf: Improve building with extra

When trying to build BPF selftests with additional compiler and linker flags, we're running into multiple problems. This series addresses all of them:

- CFLAGS are not passed to sub-makes of bpftool and libbpf. This is a problem when compiling with PIE as libbpf.a ends up being non-PIE and cannot be linked with other binaries (patch #1).

- bpftool Makefile runs llvm-config --cflags and appends the result to CFLAGS. The result typically contains -D_GNU_SOURCE which may be already set in CFLAGS. That causes a compilation error (patch #2).

- Some GCC flags are not supported by Clang but there are binaries which are always built with Clang but reuse user-defined CFLAGS. When CFLAGS contain such flags, compilation fails (patch #3).

Changelog:
----------
v2 -> v3:
- resolve conflicts between patch #1 and 4192bb294f80 ("selftests/bpf:
Provide a generic [un]load_module helper")
- add Quentin's and Jiri's acks for patches #2 and #3

v1 -> v2:
- cover forgotten case in patch#1 (noted by Eduard)
- remove -D_GNU_SOURCE unconditionally in patch#2 (suggested by Andrii)
- rewrite patch#3 to just add -Wno-unused-command-line-argument (suggested by Andrii)

Viktor Malik (3):
selftests/bpf: Allow building with extra flags
bpftool: Prevent setting duplicate _GNU_SOURCE in Makefile selftests/bpf: Disable warnings on unused flags for Clang builds

 tools/bpf/bpftool/Makefile           |  6 ++++-
 tools/testing/selftests/bpf/Makefile | 36 +++++++++++++++++++---------
 2 files changed, 30 insertions(+), 12 deletions(-)
Signature · 1 line
2.47.0