From: Alan Maguire <alan.maguire@oracle.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Eduard Zingerman <eddyz87@gmail.com>,
Quentin Monnet <qmo@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next 1/2] libbpf: add option to force-anonymize nested structs for BTF dump
Date: Wed, 17 Dec 2025 17:33:18 +0000 [thread overview]
Message-ID: <6ae6dfd8-3f73-4318-93c1-97541d267a28@oracle.com> (raw)
In-Reply-To: <CAEf4BzbWZtRdKCGwhjRV9MOufTC-coWFSU5sRtk4gdm9S_bg+w@mail.gmail.com>
On 17/12/2025 17:06, Andrii Nakryiko wrote:
> On Wed, Dec 17, 2025 at 8:13 AM Alexei Starovoitov
> <alexei.starovoitov@gmail.com> wrote:
>>
>> On Wed, Dec 17, 2025 at 8:06 AM Alan Maguire <alan.maguire@oracle.com> wrote:
>>>
>>> struct foo {
>>> struct foo *ptr;
>>> };
>>>
>>> struct bar {
>>>
>>> #ifdef __MS_EXTENSIONS__
>>> struct foo;
>>> #else
>>> struct {
>>> struct foo *ptr;
>>> };
>>> #endif
>>
>> Did you test it ? I suspect AI invented it.
>> I see nothing like this in gcc or llvm sources.
>
> Grepping a bit I suspect we need to check for _MSC_EXTENSIONS, worst
> case - _MSC_VER. But Alan, please double check in practice.
Thanks; I tried these too, no luck with either gcc or clang. Looks like the
requests to merge them haven't landed yet, latest I could find on this was [1]/[2].
I guess the other approach would be to have the user explicitly #define a
macro prior to vmlinux.h inclusion if they want to use the extensions, similar
to how we handle BPF_NO_PRESERVE_ACCESS_INDEX; maybe call it BPF_USE_MS_EXTENSIONS
or similar? It could default to true if _MSC_EXTENSIONS is set to future-proof it.
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110977
[2] https://reviews.llvm.org/D157334
next prev parent reply other threads:[~2025-12-17 17:34 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6ae6dfd8-3f73-4318-93c1-97541d267a28@oracle.com \
--to=alan.maguire@oracle.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=martin.lau@linux.dev \
--cc=qmo@kernel.org \
--cc=sdf@fomichev.me \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox