Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'bpf-selftests-fixes-for-gcc-bpf-16'

Jose E. Marchesi says:

====================
bpf: selftests fixes for GCC-BPF 16

Hello.

Just a couple of small fixes to get the BPF selftests build with what
will become GCC 16 this spring. One of the regressions is due to a
change in the behavior of a warning in GCC 16. The other is due to
the fact that GCC 16 actually implements btf_decl_tag and
btf_type_tag.

Salud!
====================

Link: https://patch.msgid.link/20260106173650.18191-1-jose.marchesi@oracle.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

+21 -1
+10
tools/testing/selftests/bpf/progs/free_timer.c
··· 7 7 8 8 #define MAX_ENTRIES 8 9 9 10 + /* clang considers 'sum += 1' as usage but 'sum++' as non-usage. GCC 11 + * is more consistent and considers both 'sum += 1' and 'sum++' as 12 + * non-usage. This triggers warnings in the functions below. 13 + * 14 + * Starting with GCC 16 -Wunused-but-set-variable=2 can be used to 15 + * mimic clang's behavior. */ 16 + #if !defined(__clang__) && __GNUC__ > 15 17 + #pragma GCC diagnostic ignored "-Wunused-but-set-variable" 18 + #endif 19 + 10 20 struct map_value { 11 21 struct bpf_timer timer; 12 22 };
+10
tools/testing/selftests/bpf/progs/rcu_read_lock.c
··· 7 7 #include "bpf_tracing_net.h" 8 8 #include "bpf_misc.h" 9 9 10 + /* clang considers 'sum += 1' as usage but 'sum++' as non-usage. GCC 11 + * is more consistent and considers both 'sum += 1' and 'sum++' as 12 + * non-usage. This triggers warnings in the functions below. 13 + * 14 + * Starting with GCC 16 -Wunused-but-set-variable=2 can be used to 15 + * mimic clang's behavior. */ 16 + #if !defined(__clang__) && __GNUC__ > 15 17 + #pragma GCC diagnostic ignored "-Wunused-but-set-variable" 18 + #endif 19 + 10 20 char _license[] SEC("license") = "GPL"; 11 21 12 22 struct {
+1 -1
tools/testing/selftests/bpf/progs/test_btf_decl_tag.c
··· 33 33 } hashmap1 SEC(".maps"); 34 34 35 35 36 - static __noinline int foo(int x __tag1 __tag2) __tag1 __tag2 36 + static __noinline __tag1 __tag2 int foo(int x __tag1 __tag2) 37 37 { 38 38 struct key_t key; 39 39 value_t val = {};