]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/bpf: add -std=gnu11 to BPF_CFLAGS and CFLAGS
authorIhor Solodrai <ihor.solodrai@pm.me>
Tue, 7 Jan 2025 23:58:18 +0000 (23:58 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 8 Jan 2025 17:33:09 +0000 (09:33 -0800)
commitbab18c7db44d3aa6c84450095451580922359c7a
treeb092463864844ee1c3df482ae625a8ddc40bb4c5
parent46c61cbeb82f8a4e6354a692d2be1a35cb0bde29
selftests/bpf: add -std=gnu11 to BPF_CFLAGS and CFLAGS

Latest versions of GCC BPF use C23 standard by default. This causes
compilation errors in vmlinux.h due to bool types declarations.

Add -std=gnu11 to BPF_CFLAGS and CFLAGS. This aligns with the version
of the standard used when building the kernel currently [1].

For more details see the discussions at [2] and [3].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Makefile#n465
[2] https://lore.kernel.org/bpf/EYcXjcKDCJY7Yb0GGtAAb7nLKPEvrgWdvWpuNzXm2qi6rYMZDixKv5KwfVVMBq17V55xyC-A1wIjrqG3aw-Imqudo9q9X7D7nLU2gWgbN0w=@pm.me/
[3] https://lore.kernel.org/bpf/20250106202715.1232864-1-ihor.solodrai@pm.me/

CC: Jose E. Marchesi <jose.marchesi@oracle.com>
Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
Link: https://lore.kernel.org/r/20250107235813.2964472-1-ihor.solodrai@pm.me
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/Makefile