Runnning make qemu_x86_64_defconfig; make clean all has stopped working for me. I get the following compilation error: In file included from sigchain.c:3: In function 'xrealloc', inlined from 'sigchain_push.isra' at sigchain.c:26:2: subcmd-util.h:56:23: error: pointer may be used after 'realloc' [-Werror=use-after-free] 56 | ret = realloc(ptr, size); | ^~~~~~~~~~~~~~~~~~ subcmd-util.h:52:21: note: call to 'realloc' here 52 | void *ret = realloc(ptr, size); | ^~~~~~~~~~~~~~~~~~ subcmd-util.h:58:31: error: pointer may be used after 'realloc' [-Werror=use-after-free] 58 | ret = realloc(ptr, 1); | ^~~~~~~~~~~~~~~ subcmd-util.h:52:21: note: call to 'realloc' here 52 | void *ret = realloc(ptr, size); | ^~~~~~~~~~~~~~~~~~ CC scripts/mod/empty.o HOSTCC scripts/mod/mk_elfconfig CC scripts/mod/devicetable-offsets.s In function 'xrealloc', inlined from 'sigchain_push' at sigchain.c:26:2, inlined from 'sigchain_push_common' at sigchain.c:53:2: subcmd-util.h:56:23: error: pointer may be used after 'realloc' [-Werror=use-after-free] 56 | ret = realloc(ptr, size); | ^~~~~~~~~~~~~~~~~~ subcmd-util.h:52:21: note: call to 'realloc' here 52 | void *ret = realloc(ptr, size); | ^~~~~~~~~~~~~~~~~~ subcmd-util.h:58:31: error: pointer may be used after 'realloc' [-Werror=use-after-free] 58 | ret = realloc(ptr, 1); | ^~~~~~~~~~~~~~~ subcmd-util.h:52:21: note: call to 'realloc' here 52 | void *ret = realloc(ptr, size); | ^~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors
Hello, I am afraid I was not able to reproduce the failure. From a clean checkout of git master (d590003), I did: make qemu_x86_64_defconfig make And the build succeeded. What version of Buildroot are you using? What system are you building on? Regards, Yann E. MORIN.
I'd say that's good news. I just tried master and it doesn't work either. A system update just broke something on my end. I'm using Arch on kernel 5.17.9. Is there a recommended distro to use for building buildroot?
I'd say that's good news. I just tried master and it doesn't work either. A system update just broke something on my end. I'm using Arch on kernel 5.17.9. Is there a recommended distro to use for building buildroot? EDIT: **A system update probably broke something on my end
Hello, This issue is caused by a gcc-12 extra check about use-after-free, which has been fixed in the kernel with: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=52a9dab6d892763b2a8334a568bd4e2c1a6fde66 You hit this issue because Archlinux is now using gcc-12.1.0 as the default compiler, and because the kernel uses -Werror to build that host tool. So, either update your kernel to one that has the fix, or backport it yourself, or downgrade your compiler to a (slightly) older one. Regards, Yann E. MORIN.
Created attachment 9316 [details] linux: don't build host tools with -Werror Hello, Can you please try this patch, and report the result? If that works for you, I'll submit a proper patch later. Regards, Yann E. MORIN.
Thanks for figuring this out! I can confirm that the patch works on master, commit eb5e2d2d43c5c0f71ae8243081625261de2cd134. Bit of a tangential question: is there an easy way to see what kernel version commit 52a9dab6d892763b2a8334a568bd4e2c1a6fde66 would have made it into? Thanks again!
All, Thanks for the report. We believe this has now been fixed with commit baa55a4e26e6 (linux: disable -Werror when building host tools) that has just been applied to master. Regards, Yann E. MORIN.