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 Mon, 2025-01-06 at 20:27 +0000, Ihor Solodrai wrote:
> Latest versions of GCC BPF use C23 standard by default. This causes
> compilation errors in vmlinux.h due to bool types declarations.
> 
> Pass -std=gnu17 when building selftests BPF objects with GCC.
> 
> For more details see the discussion at [1].
> 
> [1] https://lore.kernel.org/bpf/EYcXjcKDCJY7Yb0GGtAAb7nLKPEvrgWdvWpuNzXm2qi6rYMZDixKv5KwfVVMBq17V55xyC-A1wIjrqG3aw-Imqudo9q9X7D7nLU2gWgbN0w=@pm.me/
> 
> CC: Jose E. Marchesi <jose.marchesi@xxxxxxxxxx>
> Signed-off-by: Ihor Solodrai <ihor.solodrai@xxxxx>
> ---
>  tools/testing/selftests/bpf/Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index d5be2f94deef..d81bb4773cb7 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -479,9 +479,10 @@ define CLANG_CPUV4_BPF_BUILD_RULE
>  	$(Q)$(CLANG) $3 -O2 $(BPF_TARGET_ENDIAN) -c $1 -mcpu=v4 -o $2
>  endef
>  # Build BPF object using GCC
> +GCC_BPF_CFLAGS += -std=gnu17 -DBPF_NO_PRESERVE_ACCESS_INDEX -Wno-attributes


[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