]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: bpf: fix bpf compilation with -fms-extensions
authorBenjamin Tissoires <bentiss@kernel.org>
Tue, 6 Jan 2026 15:30:54 +0000 (16:30 +0100)
committerBenjamin Tissoires <bentiss@kernel.org>
Wed, 7 Jan 2026 14:03:48 +0000 (15:03 +0100)
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 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>
drivers/hid/bpf/progs/Makefile

index ec1fc642fd63593649d9fbe4825db6b2cacc53db..66b8f38e591dd015c7af705c6cff1563ea4299f7 100644 (file)
@@ -56,8 +56,10 @@ clean:
 
 %.bpf.o: %.bpf.c vmlinux.h $(BPFOBJ) | $(OUTPUT)
        $(call msg,BPF,$@)
-       $(Q)$(CLANG) -g -O2 --target=bpf -Wall -Werror $(INCLUDES)            \
-                -c $(filter %.c,$^) -o $@ &&                                 \
+       $(Q)$(CLANG) -g -O2 --target=bpf -Wall -Werror $(INCLUDES)              \
+                    -Wno-microsoft-anon-tag                                    \
+                    -fms-extensions                                            \
+                    -c $(filter %.c,$^) -o $@ &&                               \
        $(LLVM_STRIP) -g $@
 
 vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL) | $(INCLUDE_DIR)