mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] bpftool: build bpf bits with -std=gnu11
@ 2025-05-02  8:57 Holger Hoffstätte
  2025-05-02  9:26 ` Quentin Monnet
  0 siblings, 1 reply; 10+ messages in thread
From: Holger Hoffstätte @ 2025-05-02  8:57 UTC (permalink / raw)
  To: Quentin Monnet, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
	Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
	Hao Luo, Jiri Olsa, bpf, linux-kernel
  Cc: Holger Hoffstätte

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@applied-asynchrony.com>
---
 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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-05-06 23:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-02  8:57 [PATCH] bpftool: build bpf bits with -std=gnu11 Holger Hoffstätte
2025-05-02  9:26 ` Quentin Monnet
2025-05-02  9:53   ` Holger Hoffstätte
2025-05-03  2:36     ` Alexei Starovoitov
2025-05-04 10:24       ` Holger Hoffstätte
2025-05-06 21:04         ` Andrii Nakryiko
2025-05-06 21:41           ` Ihor Solodrai
2025-05-06 22:23             ` Andrii Nakryiko
2025-05-06 22:34               ` Ihor Solodrai
2025-05-06 23:34                 ` Andrii Nakryiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome