linux/tools/lib/bpf
Leo Yan f3846b3800 libbpf: Initialize CFLAGS before including Makefile.include
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>
Link: https://lore.kernel.org/r/20260602-tools_build_fix_zero_init_bpf_only-v2-4-c76e5250ea1c@arm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-06-14 17:32:53 -07:00
..
.gitignore tools build: Correct bpf fixdep dependencies 2024-08-05 12:19:48 -03:00
bpf_core_read.h bpf: Fix uninitialized values in BPF_{CORE,PROBE}_READ 2025-05-05 14:20:28 -07:00
bpf_endian.h
bpf_gen_internal.h libbpf: Embed and verify the metadata hash in the loader 2025-09-22 19:17:55 -07:00
bpf_helpers.h libbpf: Remove extern declaration of bpf_stream_vprintk() 2026-02-18 14:58:47 -08:00
bpf_prog_linfo.c
bpf_tracing.h libbpf: Fix powerpc's stack register definition in bpf_tracing.h 2025-10-23 11:25:16 -07:00
bpf.c libbpf: Add path_fd to struct bpf_link_create_opts 2026-06-14 17:24:25 -07:00
bpf.h libbpf: Add path_fd to struct bpf_link_create_opts 2026-06-14 17:24:25 -07:00
btf_dump.c libbpf: Adjust btf_vlen() to return a __u32 2026-04-20 17:52:48 -07:00
btf_iter.c libbpf,bpf: Share BTF relocate-related code with kernel 2024-06-21 14:45:07 -07:00
btf_relocate.c libbpf: Fix incorrect traversal end type ID when marking BTF_IS_EMBEDDED 2025-01-16 15:34:18 -08:00
btf.c libbpf: Fix deduplication of typedef with base definitions 2026-04-22 14:18:41 -07:00
btf.h libbpf: Adjust btf_vlen() to return a __u32 2026-04-20 17:52:48 -07:00
Build libbpf: move libbpf_errstr() into libbpf_utils.c 2025-10-01 15:27:25 -07:00
elf.c libbpf: move libbpf_errstr() into libbpf_utils.c 2025-10-01 15:27:25 -07:00
features.c libbpf: Add support for extended BPF syscall 2026-05-12 12:44:39 -07:00
gen_loader.c libbpf: Guard add_data() against size overflow 2026-06-02 09:46:52 -07:00
hashmap.c libbpf: Hashmap interface update to allow both long and void* keys/values 2022-11-09 20:45:14 -08:00
hashmap.h libbpf: Fix possible compiler warnings in hashmap 2024-10-11 12:36:59 -07:00
libbpf_common.h libbpf: Fix potential uninitialized tail padding with LIBBPF_OPTS_RESET 2023-11-09 19:07:51 -08:00
libbpf_internal.h libbpf: Add btf_type_is_traceable_func function 2026-06-07 10:03:02 -07:00
libbpf_legacy.h libbpf: Fix some typos in comments 2024-09-09 16:05:40 -07:00
libbpf_probes.c libbpf: Support resizable hashtable 2026-06-05 08:00:08 -07:00
libbpf_utils.c libbpf: Fix undefined behavior in {get,put}_unaligned_be32() 2025-10-06 09:16:29 -07:00
libbpf_version.h libbpf: Start v1.8 development cycle 2026-03-16 14:15:15 -07:00
libbpf.c libbpf: Add support to create tracing multi link 2026-06-07 10:03:02 -07:00
libbpf.h libbpf: Add support to create tracing multi link 2026-06-07 10:03:02 -07:00
libbpf.map libbpf: Add support to create tracing multi link 2026-06-07 10:03:02 -07:00
libbpf.pc.template
linker.c libbpf: Fix invalid write loop logic in bpf_linker__add_buf() 2026-02-13 14:14:27 -08:00
Makefile libbpf: Initialize CFLAGS before including Makefile.include 2026-06-14 17:32:53 -07:00
netlink.c bpftool: Fix truncated netlink dumps 2026-02-17 16:54:03 -08:00
nlattr.c libbpf: Use proper errno value in nlattr 2025-05-12 15:22:54 -07:00
nlattr.h libbpf: add API to get XDP/XSK supported features 2023-02-02 20:48:24 -08:00
relo_core.c libbpf: Adjust btf_vlen() to return a __u32 2026-04-20 17:52:48 -07:00
relo_core.h bpf, libbpf: Add type match support 2022-07-05 21:14:25 -07:00
ringbuf.c libbpf: move libbpf_errstr() into libbpf_utils.c 2025-10-01 15:27:25 -07:00
skel_internal.h libbpf: Use strscpy() in kernel code for skel_map_create() 2026-05-13 10:52:32 -07:00
strset.c libbpf: Fix UAF in strset__add_str() 2026-05-28 14:25:55 -07:00
strset.h
usdt.bpf.h libbpf: Fix USDT SIB argument handling causing unrecognized register error 2025-08-27 15:44:25 -07:00
usdt.c libbpf: Harden parse_vma_segs() path parsing 2026-05-28 14:15:48 -07:00
zip.c libbpf: Remove unneeded semicolon 2024-10-03 17:47:35 -07:00
zip.h libbpf: Implement basic zip archive parsing support 2023-03-01 16:05:34 -08:00