BPF List
 help / color / mirror / Atom feed
From: Quentin Monnet <qmo@kernel.org>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>, Eduard <eddyz87@gmail.com>,
	Ihor Solodrai <ihor.solodrai@linux.dev>,
	bpf <bpf@vger.kernel.org>
Subject: Re: fms-extensions and bpf
Date: Thu, 4 Dec 2025 15:52:30 +0000	[thread overview]
Message-ID: <8880b703-6557-4ad5-aa38-7dddbb572bff@kernel.org> (raw)
In-Reply-To: <CAADnVQK9ZkPC7+R5VXKHVdtj8tumpMXm7BTp0u9CoiFLz_aPTg@mail.gmail.com>

2025-12-03 20:29 UTC-0800 ~ Alexei Starovoitov <alexei.starovoitov@gmail.com>
> Hi All,
> 
> The kernel is now built with -fms-extensions and it is

[...]

> Quentin,
> pls think of a way to silence warns during bpftool build,
> which is now noisy due to:
> 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;
>        |                 ^~~~~~~~~~~~~~
> 

I see them too. We can trivially turn off these warnings when building
the BPF programs:

    diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
    index 586d1b2595d1..ad4e10cb59d5 100644
    --- a/tools/bpf/bpftool/Makefile
    +++ b/tools/bpf/bpftool/Makefile
    @@ -224,6 +224,7 @@ endif
     
     $(OUTPUT)%.bpf.o: skeleton/%.bpf.c $(OUTPUT)vmlinux.h $(LIBBPF_BOOTSTRAP)
            $(QUIET_CLANG)$(CLANG) \
    +               -Wno-missing-declarations \
                    -I$(or $(OUTPUT),.) \
                    -I$(srctree)/tools/include/uapi/ \
                    -I$(LIBBPF_BOOTSTRAP_INCLUDE) \

Probably better, we can tell clang to use the MS extensions so that it
doesn't consider these declarations as missing:

    diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
    index 586d1b2595d1..a8d5b32f1c6b 100644
    --- a/tools/bpf/bpftool/Makefile
    +++ b/tools/bpf/bpftool/Makefile
    @@ -224,6 +224,8 @@ endif
     
     $(OUTPUT)%.bpf.o: skeleton/%.bpf.c $(OUTPUT)vmlinux.h $(LIBBPF_BOOTSTRAP)
            $(QUIET_CLANG)$(CLANG) \
    +               -fms-extensions \
    +               -Wno-microsoft-anon-tag \
                    -I$(or $(OUTPUT),.) \
                    -I$(srctree)/tools/include/uapi/ \
                    -I$(LIBBPF_BOOTSTRAP_INCLUDE) \

I'm happy to repost the latter as a patch, if it seems good to you.

Quentin

  reply	other threads:[~2025-12-04 15:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-04  4:29 fms-extensions and bpf Alexei Starovoitov
2025-12-04 15:52 ` Quentin Monnet [this message]
2025-12-15 23:46 ` Song Liu
2025-12-16  1:24   ` Alexei Starovoitov
2025-12-16  7:50     ` Song Liu
2025-12-16 13:08       ` Alan Maguire
2025-12-16 16:52         ` Song Liu
2025-12-16 17:23           ` Alan Maguire

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=8880b703-6557-4ad5-aa38-7dddbb572bff@kernel.org \
    --to=qmo@kernel.org \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=eddyz87@gmail.com \
    --cc=ihor.solodrai@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