Re: [PATCH] bpftool: build bpf bits with -std=gnu11
From: Quentin Monnet
Date: Fri May 02 2025 - 05:26:29 EST
On 02/05/2025 09:57, Holger Hoffstätte wrote:
> 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>
Thanks! I tested that it still works with clang.
Acked-by: Quentin Monnet <qmo@xxxxxxxxxx>
I didn't manage to compile with gcc, though. I tried with gcc 15.1.1 but
option '--target=bpf' is apparently unrecognised by the gcc version on
my setup.
Out of curiosity, how did you build using gcc for the skeleton? Was it
enough to run "CLANG=gcc make"? Does it pass the clang-bpf-co-re build
probe successfully?
Thanks,
Quentin