Re: [PATCH bpf-next] selftests/bpf: add -std=gnu17 to GCC BPF build rule

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday, January 6th, 2025 at 1:16 PM, Eduard Zingerman <eddyz87@xxxxxxxxx> wrote:

> 
> [...]
> 
> 
> From previous discussion it looks like it's better to just enable some -std option for both gcc and clang.
> Kernel is compiled with -std=gnu11.

Do you mean that eventually clang is going to make C23 the default too?
Yeah, considering this it's a good idea to specify the standard explicitly.

I am not sure what's the best choice though. If the tests compile currently
with gnu17, maybe we can leave it at that, and not fall back to gnu11?

> I tried adding -std=gnu11 to both host and bpf side flags:
> test_progs, test_verifier, test_maps, veristat compile ok.
> 
> > define GCC_BPF_BUILD_RULE
> > $(call msg,GCC-BPF,$4,$2)
> > - $(Q)$(BPF_GCC) $3 -DBPF_NO_PRESERVE_ACCESS_INDEX -Wno-attributes -O2 -c $1 -o $2
> > + $(Q)$(BPF_GCC) $3 -O2 $(GCC_BPF_CFLAGS) -c $1 -o $2
> > endef
> > 
> > SKEL_BLACKLIST := btf__% test_pinning_invalid.c test_sk_assign.c





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux