Skip to content

Commit 9af832c

Browse files
Zhao Mengmenghtejun
authored andcommitted
tools/sched_ext: Add -fms-extensions to bpf build flags
Similar to commit 835a507 ("selftests/bpf: Add -fms-extensions to bpf build flags") and commit 639f58a ("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> Reviewed-by: Andrea Righi <arighi@nvidia.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 3f27958 commit 9af832c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/sched_ext/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ BPF_CFLAGS = -g -D__TARGET_ARCH_$(SRCARCH) \
122122
-I../../include \
123123
$(call get_sys_includes,$(CLANG)) \
124124
-Wall -Wno-compare-distinct-pointer-types \
125+
-Wno-microsoft-anon-tag \
126+
-fms-extensions \
125127
-O2 -mcpu=v3
126128

127129
# sort removes libbpf duplicates when not cross-building

0 commit comments

Comments
 (0)