BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] Handle -fms-extension in kernel structs
@ 2025-12-16 17:18 Alan Maguire
  2025-12-16 17:18 ` [PATCH bpf-next 1/2] libbpf: add option to force-anonymize nested structs for BTF dump Alan Maguire
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Alan Maguire @ 2025-12-16 17:18 UTC (permalink / raw)
  To: qmo
  Cc: ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song,
	john.fastabend, kpsingh, sdf, haoluo, jolsa, bpf, Alan Maguire

The kernel is using named structs embedded in other structs
with no member name (similar to anonymous struct usage).
Such an arrangement causes problems for compilers unless -fms-extension
is specified.  With vmlinux.h generation we do not want to impose
that on the vmlinux.h consumer, so generate a compatible representation
using anonymous types.

Patch 1 adds libbpf support for this in BTF dump code; patch 2
adds bpftool support to use the new option.

Note that this was essentially

Suggested-by: Song Liu <song@kernel.org>

so feel free to add that to the series.

See [1] for more.

[1] https://lore.kernel.org/bpf/CAADnVQK9ZkPC7+R5VXKHVdtj8tumpMXm7BTp0u9CoiFLz_aPTg@mail.gmail.com/

Alan Maguire (2):
  libbpf: add option to force-anonymize nested structs for BTF dump
  bpftool: force-anonymize structs to avoid need for -fms-extension

 tools/bpf/bpftool/btf.c  |  4 +++-
 tools/lib/bpf/btf.h      | 25 ++++++++++++++++++++++++-
 tools/lib/bpf/btf_dump.c | 25 ++++++++++++++++++++++---
 3 files changed, 49 insertions(+), 5 deletions(-)

-- 
2.39.3


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2025-12-18  0:50 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-16 17:18 [PATCH bpf-next 0/2] Handle -fms-extension in kernel structs Alan Maguire
2025-12-16 17:18 ` [PATCH bpf-next 1/2] libbpf: add option to force-anonymize nested structs for BTF dump Alan Maguire
2025-12-16 19:00   ` Eduard Zingerman
2025-12-16 19:08     ` Andrii Nakryiko
2025-12-16 19:46     ` Eduard Zingerman
2025-12-17 16:06       ` Alan Maguire
2025-12-17 16:12         ` Alexei Starovoitov
2025-12-17 17:06           ` Andrii Nakryiko
2025-12-17 17:33             ` Alan Maguire
2025-12-17 17:52               ` Alexei Starovoitov
2025-12-17 18:41                 ` Alan Maguire
2025-12-17 19:34                   ` Eduard Zingerman
2025-12-17 19:35                     ` Eduard Zingerman
2025-12-17 20:50                       ` Alan Maguire
2025-12-17 21:02                         ` Andrii Nakryiko
2025-12-17 21:27                           ` Alexei Starovoitov
2025-12-17 22:34                             ` Eduard Zingerman
2025-12-17 22:47                               ` Eduard Zingerman
2025-12-17 23:34                                 ` Alexei Starovoitov
2025-12-18  0:19                                   ` Eduard Zingerman
2025-12-18  0:39                                     ` Alexei Starovoitov
2025-12-18  0:50                                       ` Eduard Zingerman
2025-12-17 23:52                             ` Andrii Nakryiko
2025-12-18  0:49                               ` Eduard Zingerman
2025-12-17 17:10         ` Andrii Nakryiko
2025-12-16 17:18 ` [PATCH bpf-next 2/2] bpftool: force-anonymize structs to avoid need for -fms-extension Alan Maguire
2025-12-16 19:20 ` [PATCH bpf-next 0/2] Handle -fms-extension in kernel structs Song Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox