Skip to content

Commit b7666c8

Browse files
author
Benjamin Tissoires
committed
HID: bpf: fix bpf compilation with -fms-extensions
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 slab { .. struct freelist_counters; }; Use -fms-extensions and -Wno-microsoft-anon-tag flags to build bpf programs that #include "vmlinux.h" Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
1 parent f390069 commit b7666c8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/hid/bpf/progs/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ clean:
5656

5757
%.bpf.o: %.bpf.c vmlinux.h $(BPFOBJ) | $(OUTPUT)
5858
$(call msg,BPF,$@)
59-
$(Q)$(CLANG) -g -O2 --target=bpf -Wall -Werror $(INCLUDES) \
60-
-c $(filter %.c,$^) -o $@ && \
59+
$(Q)$(CLANG) -g -O2 --target=bpf -Wall -Werror $(INCLUDES) \
60+
-Wno-microsoft-anon-tag \
61+
-fms-extensions \
62+
-c $(filter %.c,$^) -o $@ && \
6163
$(LLVM_STRIP) -g $@
6264

6365
vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL) | $(INCLUDE_DIR)

0 commit comments

Comments
 (0)