Commit 9af832c0 authored by Zhao Mengmeng's avatar Zhao Mengmeng Committed by Tejun Heo
Browse files

tools/sched_ext: Add -fms-extensions to bpf build flags



Similar to commit 835a5075 ("selftests/bpf: Add -fms-extensions to
bpf build flags") and commit 639f58a0 ("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: default avatarZhao Mengmeng <zhaomengmeng@kylinos.cn>
Reviewed-by: default avatarAndrea Righi <arighi@nvidia.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 3f27958b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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