Created attachment 904934 [details] environment Like https://bugs.gentoo.org/939106 libbpf.c: In function ‘bpf_map__init_kern_struct_ops’: libbpf.c:1134:18: error: ‘mod_btf’ may be used uninitialized [-Werror=maybe-uninitialized] 1134 | kern_btf = mod_btf ? mod_btf->btf : obj->btf_vmlinux; | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libbpf.c:1119:28: note: ‘mod_btf’ was declared here 1119 | struct module_btf *mod_btf; | ^~~~~~~ In function ‘find_struct_ops_kern_types’, inlined from ‘bpf_map__init_kern_struct_ops’ at libbpf.c:1127:8: libbpf.c:1004:21: error: ‘btf’ may be used uninitialized [-Werror=maybe-uninitialized] 1004 | kern_type = btf__type_by_id(btf, kern_type_id); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libbpf.c: In function ‘bpf_map__init_kern_struct_ops’: libbpf.c:989:21: note: ‘btf’ was declared here 989 | struct btf *btf; | ^~~
Created attachment 904935 [details] build.log
https://gitweb.gentoo.org/proj/linux-patches.git/commit/?h=6.11&id=de599559deffc5a4a19abb41233177322aff11bd
sys-kernel/gentoo-kernel-bin-6.11.3 builds successfully with -O3 in CFLAGS.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=18ad0c1a648cfb97fde0f08f848f0ed75fc4c083 commit 18ad0c1a648cfb97fde0f08f848f0ed75fc4c083 Author: Sam James <sam@gentoo.org> AuthorDate: 2025-04-07 20:44:57 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-04-07 20:48:29 +0000 kernel-build.eclass: disable -Werror (for host tools at least) WERROR=0 disables -Werror for host tools at least, so let's use that. I'll also send a config change. Bug: https://bugs.gentoo.org/939106 Bug: https://bugs.gentoo.org/940904 Bug: https://bugs.gentoo.org/942303 Signed-off-by: Sam James <sam@gentoo.org> eclass/kernel-build.eclass | 1 + 1 file changed, 1 insertion(+)