tools build: bpf: Append EXTRA_CFLAGS and HOST_EXTRACFLAGS#7927
tools build: bpf: Append EXTRA_CFLAGS and HOST_EXTRACFLAGS#7927kernel-patches-daemon-bpf-rc[bot] wants to merge 8 commits into
Conversation
|
Upstream branch: b93c55b |
75aefde to
eea6fde
Compare
|
Upstream branch: 04de7bc |
c0de1d5 to
92f04ac
Compare
eea6fde to
31a425c
Compare
|
Upstream branch: c169a2a |
92f04ac to
e813bda
Compare
|
Upstream branch: c169a2a |
e813bda to
af0cefa
Compare
31a425c to
8a30677
Compare
|
Upstream branch: 8a7f2bf |
af0cefa to
9347fd3
Compare
8a30677 to
a034d23
Compare
|
Upstream branch: 5b88319 |
9347fd3 to
3b56b6d
Compare
a034d23 to
893ba67
Compare
|
Upstream branch: bf29346 |
3b56b6d to
97687db
Compare
893ba67 to
28c20a5
Compare
|
Upstream branch: 390dc36 |
97687db to
13df6f3
Compare
28c20a5 to
6f67d86
Compare
|
Upstream branch: f64c723 |
13df6f3 to
f182bbe
Compare
6f67d86 to
a9325d6
Compare
|
Upstream branch: 4a7910e |
f182bbe to
0ac82a9
Compare
a86065a to
275c673
Compare
5fcaaa9 to
bae1e1e
Compare
|
Upstream branch: dd0f968 |
275c673 to
8c69b6d
Compare
bae1e1e to
26e71a9
Compare
|
Upstream branch: f1a660b |
8c69b6d to
12e2913
Compare
26e71a9 to
01743a4
Compare
|
Upstream branch: 68f4e48 |
12e2913 to
d893298
Compare
01743a4 to
58d8cc8
Compare
|
Upstream branch: c15261b |
d893298 to
2c8158d
Compare
58d8cc8 to
4d4751c
Compare
|
Upstream branch: 140fa23 |
2c8158d to
6bb8864
Compare
4d4751c to
dcffd40
Compare
|
Upstream branch: 2e8ad1f |
6bb8864 to
f7b5f23
Compare
dcffd40 to
8b7f742
Compare
bpftool builds a bootstrap libbpf with HOSTCC, but the libbpf submake can still inherit target build flags through CFLAGS. This can break cross builds when host objects are compiled with target-only options. Since HOST_CFLAGS contains warning options that are not suitable for building libbpf, use LIBBPF_BOOTSTRAP_CFLAGS with the warning options removed to build the bootstrap libbpf. Clear EXTRA_CFLAGS so target extra flags are not mixed into the host bootstrap libbpf build. Signed-off-by: Leo Yan <leo.yan@arm.com> Acked-by: Quentin Monnet <qmo@kernel.org>
Prepare for future changes where EXTRA_CFLAGS may include flags not applicable to the host compiler. Move the HOST_CFLAGS assignment before appending EXTRA_CFLAGS to CFLAGS so that HOST_CFLAGS does not inherit flags from EXTRA_CFLAGS. Acked-by: Quentin Monnet <qmo@kernel.org> Signed-off-by: Leo Yan <leo.yan@arm.com>
Append HOST_EXTRACFLAGS to HOST_CFLAGS so that additional flags can be applied to the host compiler. Acked-by: Quentin Monnet <qmo@kernel.org> Signed-off-by: Leo Yan <leo.yan@arm.com>
|
Upstream branch: 30dee2c |
tools/scripts/Makefile.include may expand EXTRA_CFLAGS in a future change. This could alter the initialization of CFLAGS, as the default options "-g -O2" would never be set once EXTRA_CFLAGS is expanded. Prepare for this by moving the CFLAGS initialization before including tools/scripts/Makefile.include, so it is not affected by the extended EXTRA_CFLAGS. Append EXTRA_CFLAGS to CFLAGS only after including Makefile.include and place it last so that the extra flags propagate properly and can override the default options. tools/scripts/Makefile.include already appends $(CLANG_CROSS_FLAGS) to CFLAGS, the Makefile appends $(CLANG_CROSS_FLAGS) again, remove the redundant append. Signed-off-by: Leo Yan <leo.yan@arm.com> Acked-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to the compiler. Signed-off-by: Leo Yan <leo.yan@arm.com>
ASAN reports stack-buffer-overflow due to the uninitialized op_name. Initialize it to fix the issue. Fixes: 054b6c7 ("selftests/bpf: Add verifier log tests for BPF_BTF_LOAD command") Signed-off-by: Leo Yan <leo.yan@arm.com>
The urandom_read helper and its shared library are built with $(CLANG) directly rather than through the normal selftest $(CC) rules. The CFLAGS variable can contain specific flags only for $(CC) but might be imcompatible for $(CLANG) and those flags are not necessarily valid for the clang-only urandom_read build. Split the BPF selftest local flags into COMMON_CFLAGS and append them to CFLAGS for the normal build path. Use COMMON_CFLAGS directly for urandom_read and liburandom_read.so, while still filtering out -static as before. Signed-off-by: Leo Yan <leo.yan@arm.com>
The BPF selftests prefer static LLVM linking, which works for native builds but can break cross builds. Its --link-static output may include host-only libraries that are unavailable for the cross compilation, causing link failures. Avoid static LLVM linking for cross builds and use shared LLVM libraries instead. Native builds keep the existing behavior. Signed-off-by: Leo Yan <leo.yan@arm.com>
f7b5f23 to
a31d222
Compare
Pull request for series with
subject: tools build: bpf: Append EXTRA_CFLAGS and HOST_EXTRACFLAGS
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1104693