kernel: packages: fix building package/devel/perf with -O3
authorPavel Shirov <nstorm.ahoy166@silomails.com>
Sat, 7 Dec 2024 12:29:28 +0000 (15:29 +0300)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 8 Dec 2024 18:02:48 +0000 (19:02 +0100)
commit0826b224b5210fc6f0681c9324dca974d507a8f7
treee0b05ac8d188865ba3deff4f1408f5518ef02367
parentcf1909a024a7db28a43dd799dea09358d0ecee87
kernel: packages: fix building package/devel/perf with -O3

Add patch to fix failure to build package/devel/perf when
CONFIG_TARGET_OPTIMIZATION has -O3 enabled with this error:

```
In function 'elf_close',
    inlined from 'elf_close' at elf.c:41:6,
    inlined from 'elf_find_func_offset_from_file' at elf.c:267:2:
elf.c:45:9: error: 'elf_fd.elf' may be used uninitialized [-Werror=maybe-uninitialized]
   45 |         elf_end(elf_fd->elf);
      |         ^~~~~~~~~~~~~~~~~~~~
elf.c: In function 'elf_find_func_offset_from_file':
elf.c:260:23: note: 'elf_fd.elf' was declared here
  260 |         struct elf_fd elf_fd;
      |                       ^~~~~~
In function 'elf_close',
    inlined from 'elf_close' at elf.c:41:6,
    inlined from 'elf_find_func_offset_from_file' at elf.c:267:2:
elf.c:46:9: error: 'elf_fd.fd' may be used uninitialized [-Werror=maybe-uninitialized]
   46 |         close(elf_fd->fd);
      |         ^~~~~~~~~~~~~~~~~
elf.c: In function 'elf_find_func_offset_from_file':
elf.c:260:23: note: 'elf_fd.fd' was declared here
  260 |         struct elf_fd elf_fd;
      |                       ^~~~~~
```

Link: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=fab45b962749
Signed-off-by: Pavel Shirov <nstorm.ahoy166@silomails.com>
Link: https://github.com/openwrt/openwrt/pull/17141
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/generic/backport-6.6/192-v6.12-fix-libbpf-Wmaybe-uninitialized.patch [new file with mode: 0644]