tools build: bpf: Append EXTRA_CFLAGS and HOST_EXTRACFLAGS#12293
tools build: bpf: Append EXTRA_CFLAGS and HOST_EXTRACFLAGS#12293kernel-patches-daemon-bpf[bot] wants to merge 8 commits into
Conversation
|
Upstream branch: b93c55b |
AI reviewed your patch. Please fix the bug or email reply why it's not a bug. In-Reply-To-Subject: |
|
Forwarding comment 4603866551 via email |
4131ade to
7a7c63d
Compare
|
Upstream branch: 04de7bc |
ceae939 to
b9c64a1
Compare
7a7c63d to
245da81
Compare
|
Upstream branch: c169a2a |
b9c64a1 to
a701d7f
Compare
|
Upstream branch: c169a2a |
a701d7f to
ca43469
Compare
245da81 to
a9d2cf1
Compare
|
Upstream branch: 8a7f2bf |
ca43469 to
a75ba78
Compare
a9d2cf1 to
73f574b
Compare
|
Upstream branch: bf29346 |
a75ba78 to
d4bfdf9
Compare
73f574b to
2a69488
Compare
|
Upstream branch: 390dc36 |
d4bfdf9 to
1f1f9b9
Compare
2a69488 to
a53fe47
Compare
|
Upstream branch: f64c723 |
107ce91 to
47d35fa
Compare
e25ce50 to
a572b20
Compare
|
Upstream branch: 68f4e48 |
47d35fa to
62d6399
Compare
a572b20 to
3a26044
Compare
|
Upstream branch: c15261b |
62d6399 to
1f78040
Compare
3a26044 to
818f7b1
Compare
|
Upstream branch: 140fa23 |
1f78040 to
5000522
Compare
818f7b1 to
d9ed865
Compare
|
Upstream branch: 2e8ad1f |
5000522 to
a8c2a38
Compare
d9ed865 to
1b36123
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>
a8c2a38 to
3b46c01
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