From: Zhao Mengmeng <zhaomzhao@126.com>
To: tj@kernel.org, void@manifault.com, arighi@nvidia.com,
changwoo@igalia.com, shuah@kernel.org, nathan@kernel.org,
nick.desaulniers+lkml@gmail.com, morbo@google.com,
justinstitt@google.com
Cc: sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, bpf@vger.kernel.org,
llvm@lists.linux.dev, zhaomengmeng@kylinos.cn
Subject: [PATCH 1/3] tools/sched_ext: Add -fms-extensions to bpf build flags
Date: Tue, 3 Mar 2026 15:23:15 +0800 [thread overview]
Message-ID: <20260303072317.76035-2-zhaomzhao@126.com> (raw)
In-Reply-To: <20260303072317.76035-1-zhaomzhao@126.com>
From: Zhao Mengmeng <zhaomengmeng@kylinos.cn>
Similar to commit 835a50753579 ("selftests/bpf: Add -fms-extensions to
bpf build flags") and commit 639f58a0f480 ("bpftool: Fix build warnings
due to MS extensions")
The kernel is now built with -fms-extensions, therefore
generated vmlinux.h contains types like:
struct aes_key {
struct aes_enckey;
union aes_invkey_arch inv_k;
};
struct ns_common {
...
union {
struct ns_tree;
struct callback_head ns_rcu;
};
};
Which raise warning like below when building scx scheduler:
tools/sched_ext/build/include/vmlinux.h:50533:3: warning:
declaration does not declare anything [-Wmissing-declarations]
50533 | struct ns_tree;
| ^
Fix it by using -fms-extensions and -Wno-microsoft-anon-tag flags
to build bpf programs that #include "vmlinux.h"
Signed-off-by: Zhao Mengmeng <zhaomengmeng@kylinos.cn>
---
tools/sched_ext/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/sched_ext/Makefile b/tools/sched_ext/Makefile
index 47ad7444677e..21554f089692 100644
--- a/tools/sched_ext/Makefile
+++ b/tools/sched_ext/Makefile
@@ -122,6 +122,8 @@ BPF_CFLAGS = -g -D__TARGET_ARCH_$(SRCARCH) \
-I../../include \
$(call get_sys_includes,$(CLANG)) \
-Wall -Wno-compare-distinct-pointer-types \
+ -Wno-microsoft-anon-tag \
+ -fms-extensions \
-O2 -mcpu=v3
# sort removes libbpf duplicates when not cross-building
--
2.43.0
next prev parent reply other threads:[~2026-03-03 7:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-03 7:23 [PATCH 0/3] tools/sched_ext: fix compilation issues Zhao Mengmeng
2026-03-03 7:23 ` Zhao Mengmeng [this message]
2026-03-03 7:23 ` [PATCH 2/3] selftests/sched_ext: Add -fms-extensions to bpf build flags Zhao Mengmeng
2026-03-03 7:23 ` [PATCH 3/3] selftests/sched_ext: Fix peek_dsq.bpf.c compile error for clang 17 Zhao Mengmeng
2026-03-03 7:50 ` [PATCH 0/3] tools/sched_ext: fix compilation issues Andrea Righi
2026-03-03 8:06 ` Tejun Heo
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=20260303072317.76035-2-zhaomzhao@126.com \
--to=zhaomzhao@126.com \
--cc=arighi@nvidia.com \
--cc=bpf@vger.kernel.org \
--cc=changwoo@igalia.com \
--cc=justinstitt@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=sched-ext@lists.linux.dev \
--cc=shuah@kernel.org \
--cc=tj@kernel.org \
--cc=void@manifault.com \
--cc=zhaomengmeng@kylinos.cn \
/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
all inboxes | Powered by JetHome®