linux/tools/bpf/bpftool
Quentin Monnet 639f58a0f4 bpftool: Fix build warnings due to MS extensions
The kernel is now built with -fms-extensions. Anonymous structs or
unions permitted by these extensions have been used in several places,
and can end up in the generated vmlinux.h file, for example:

    struct ns_tree {
        [...]
    };

    [...]

    struct ns_common {
            [...]
            union {
                    struct ns_tree;
                    struct callback_head ns_rcu;
            };
    };

Trying to include this header for compiling a tool may result in build
warnings, if the compiler does not expect these extensions. This is the
case, for example, with bpftool:

    In file included from skeleton/pid_iter.bpf.c:3:
    .../tools/testing/selftests/bpf/tools/build/bpftool/vmlinux.h:64057:3:
    warning: declaration does not declare anything
    [-Wmissing-declarations]
     64057 |                 struct ns_tree;
           |                 ^~~~~~~~~~~~~~

Fix these build warnings in bpftool by turning on Microsoft extensions
when compiling the two BPF programs that rely on vmlinux.h.

Reported-by: Alexei Starovoitov <ast@kernel.org>
Closes: https://lore.kernel.org/bpf/CAADnVQK9ZkPC7+R5VXKHVdtj8tumpMXm7BTp0u9CoiFLz_aPTg@mail.gmail.com/
Signed-off-by: Quentin Monnet <qmo@kernel.org>
Link: https://lore.kernel.org/r/20251208130748.68371-1-qmo@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2025-12-09 23:21:33 -08:00
..
Documentation Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf after 6.18-rc5+ 2025-11-14 17:43:41 -08:00
bash-completion bpftool: Add bash completion for program signing options 2025-09-23 12:28:33 -07:00
skeleton
.gitignore
Makefile bpftool: Fix build warnings due to MS extensions 2025-12-09 23:21:33 -08:00
btf.c bpftool: Use appropriate permissions for map access 2025-06-20 11:13:03 -07:00
btf_dumper.c bpftool: Fix missing closing parethesis for BTF_KIND_UNKN 2025-10-28 09:00:55 -07:00
cfg.c bpftool: Fix control flow graph segfault during edge creation 2025-01-10 14:16:13 -08:00
cfg.h
cgroup.c bpftool: Add support for signing BPF programs 2025-09-22 19:17:55 -07:00
common.c bpftool: Refactor kernel config reading into common helper 2025-09-02 17:20:54 +02:00
feature.c bpftool: Refactor kernel config reading into common helper 2025-09-02 17:20:54 +02:00
gen.c bpftool: Add support for signing BPF programs 2025-09-22 19:17:55 -07:00
iter.c bpftool: Use appropriate permissions for map access 2025-06-20 11:13:03 -07:00
jit_disasm.c bpftool: Using the right format specifiers 2025-03-17 13:50:56 -07:00
json_writer.c
json_writer.h
link.c bpftool: Add CET-aware symbol matching for x86_64 architectures 2025-09-02 17:20:54 +02:00
main.c bpftool: Add support for signing BPF programs 2025-09-22 19:17:55 -07:00
main.h bpftool: Add support for signing BPF programs 2025-09-22 19:17:55 -07:00
map.c bpftool: Recognize insn_array map type 2025-11-05 17:31:25 -08:00
map_perf_ring.c bpftool: Use appropriate permissions for map access 2025-06-20 11:13:03 -07:00
net.c bpftool: Fix memory leak in dump_xx_nlmsg on realloc failure 2025-06-20 11:32:36 -07:00
netlink_dumper.c bpftool: Using the right format specifiers 2025-03-17 13:50:56 -07:00
netlink_dumper.h
perf.c
pids.c
prog.c bpftool: Add support for signing BPF programs 2025-09-22 19:17:55 -07:00
sign.c bpftool: Allow bpftool to build with openssl < 3 2025-11-24 10:00:16 -08:00
struct_ops.c
token.c bpftool: Fix UAF in get_delegate_value 2025-09-19 15:37:30 -07:00
tracelog.c bpftool: Search for tracefs at /sys/kernel/tracing first 2025-09-15 10:10:28 -07:00
xlated_dumper.c bpftool: Using the right format specifiers 2025-03-17 13:50:56 -07:00
xlated_dumper.h