Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 940904

Summary: sys-kernel/gentoo-kernel-bin-6.11.2: build fails with -O3
Product: Gentoo Linux Reporter: Emanuele Torre <torreemanuele6>
Component: Current packagesAssignee: Distribution Kernel Project <dist-kernel>
Status: RESOLVED FIXED    
Severity: normal CC: torreemanuele6
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=939106
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: environment
build.log

Description Emanuele Torre 2024-10-05 13:39:26 UTC
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;
          |                     ^~~
Comment 1 Emanuele Torre 2024-10-05 13:40:01 UTC
Created attachment 904935 [details]
build.log
Comment 3 Emanuele Torre 2024-10-11 23:21:18 UTC
sys-kernel/gentoo-kernel-bin-6.11.3 builds successfully with -O3 in CFLAGS.
Comment 4 Larry the Git Cow gentoo-dev 2025-04-07 20:48:40 UTC
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(+)