[PATCH] bpftool: build bpf bits with -std=gnu11
From: Holger Hoffstätte
Date: Fri May 02 2025 - 04:57:46 EST
A gcc-15-based bpf toolchain defaults to C23 and fails to compile various
kernel headers due to their use of a custom 'bool' type.
Explicitly using -std=gnu11 works with both clang and bpf-toolchain.
Signed-off-by: Holger Hoffstätte <holger@xxxxxxxxxxxxxxxxxxxxxx>
---
tools/bpf/bpftool/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index 9e9a5f006..ca6c1e04b 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -227,7 +227,7 @@ $(OUTPUT)%.bpf.o: skeleton/%.bpf.c $(OUTPUT)vmlinux.h $(LIBBPF_BOOTSTRAP)
-I$(or $(OUTPUT),.) \
-I$(srctree)/tools/include/uapi/ \
-I$(LIBBPF_BOOTSTRAP_INCLUDE) \
- -g -O2 -Wall -fno-stack-protector \
+ -g -O2 -Wall -fno-stack-protector -std=gnu11 \
--target=bpf -c $< -o $@
$(Q)$(LLVM_STRIP) -g $@
--
2.49.0