Since the merge with v6.19-rc my CI is broken because of the newly enabled -fms-extensions.
Add the missing flags when generating the CFLAGS for bpf.o to solve this and continue running the tests while applying the patches.
Cheers, Benjamin
Signed-off-by: Benjamin Tissoires bentiss@kernel.org --- Benjamin Tissoires (2): HID: bpf: fix bpf compilation with -fms-extensions selftests/hid: fix bpf compilations due to -fms-extensions
drivers/hid/bpf/progs/Makefile | 6 ++++-- tools/testing/selftests/hid/Makefile | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) --- base-commit: fde4ce068d1bccacf1e2d6a28697a3847f28e0a6 change-id: 20260106-wip-fix-bpf-compilation-4707e0faacb1
Best regards,
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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/bpf/progs/Makefile b/drivers/hid/bpf/progs/Makefile index ec1fc642fd63..66b8f38e591d 100644 --- a/drivers/hid/bpf/progs/Makefile +++ b/drivers/hid/bpf/progs/Makefile @@ -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)
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 --- tools/testing/selftests/hid/Makefile | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/hid/Makefile b/tools/testing/selftests/hid/Makefile index 2839d2612ce3..50ec9e0406ab 100644 --- a/tools/testing/selftests/hid/Makefile +++ b/tools/testing/selftests/hid/Makefile @@ -184,6 +184,8 @@ MENDIAN=$(if $(IS_LITTLE_ENDIAN),-mlittle-endian,-mbig-endian)
CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG)) BPF_CFLAGS = -g -Werror -D__TARGET_ARCH_$(SRCARCH) $(MENDIAN) \ + -Wno-microsoft-anon-tag \ + -fms-extensions \ -I$(INCLUDE_DIR)
CLANG_CFLAGS = $(CLANG_SYS_INCLUDES) \
On Tue, 06 Jan 2026 16:30:53 +0100, Benjamin Tissoires wrote:
Since the merge with v6.19-rc my CI is broken because of the newly enabled -fms-extensions.
Add the missing flags when generating the CFLAGS for bpf.o to solve this and continue running the tests while applying the patches.
Cheers, Benjamin
[...]
Applied to hid/hid.git (for-6.19/upstream-fixes), thanks!
[1/2] HID: bpf: fix bpf compilation with -fms-extensions https://git.kernel.org/hid/hid/c/b7666c891cc7 [2/2] selftests/hid: fix bpf compilations due to -fms-extensions https://git.kernel.org/hid/hid/c/e03fb369b083
Cheers,
linux-kselftest-mirror@lists.linaro.org