Commit b7666c89 authored by Benjamin Tissoires's avatar Benjamin Tissoires
Browse files

HID: bpf: fix bpf compilation with -fms-extensions



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 slab {
   ..
   struct freelist_counters;
};

Use -fms-extensions and -Wno-microsoft-anon-tag flags
to build bpf programs that #include "vmlinux.h"

Signed-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
parent f3900696
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ clean:
%.bpf.o: %.bpf.c vmlinux.h $(BPFOBJ) | $(OUTPUT)
	$(call msg,BPF,$@)
	$(Q)$(CLANG) -g -O2 --target=bpf -Wall -Werror $(INCLUDES)		\
		     -Wno-microsoft-anon-tag					\
		     -fms-extensions						\
		     -c $(filter %.c,$^) -o $@ &&				\
	$(LLVM_STRIP) -g $@