linux: disable -Werror when building host tools
gcc-12 is starting to trickle down to some distros, like Archlinux. gcc-12 has new warnings, and detects more cases of issues, like new UAF cases, which is causing build issues in code that was previously building fine, as reported in #14826: 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); | ^~~~~~~~~~~~~~~~~~ In that case, the kernel has already fixed their code, which is part of 5.17: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=52a9dab6d892763b2a8334a568bd4e2c1a6fde66 However, we can't easily carry that patch, because we don't know whether the kernel the user uses already has the fix or not. Instead, we can just tell the kernel to disable use of -Werror when building host tools. As a consequence, we can drop it from the perf-specific setting. Fixes: #14826 Reported-by: Anders Pitman <buildroot@apitman.com> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
parent
9118c863b3
commit
baa55a4e26
@ -147,11 +147,14 @@ endif
|
||||
|
||||
# We don't want to run depmod after installing the kernel. It's done in a
|
||||
# target-finalize hook, to encompass modules installed by packages.
|
||||
# Disable building host tools with -Werror: newer gcc versions can be
|
||||
# extra picky about some code (https://bugs.busybox.net/show_bug.cgi?id=14826)
|
||||
LINUX_MAKE_FLAGS = \
|
||||
HOSTCC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS)" \
|
||||
ARCH=$(KERNEL_ARCH) \
|
||||
INSTALL_MOD_PATH=$(TARGET_DIR) \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
WERROR=0 \
|
||||
DEPMOD=$(HOST_DIR)/sbin/depmod
|
||||
|
||||
ifeq ($(BR2_REPRODUCIBLE),y)
|
||||
|
@ -20,7 +20,6 @@ PERF_MAKE_FLAGS = \
|
||||
ARCH=$(PERF_ARCH) \
|
||||
DESTDIR=$(TARGET_DIR) \
|
||||
prefix=/usr \
|
||||
WERROR=0 \
|
||||
NO_GTK2=1 \
|
||||
NO_LIBPERL=1 \
|
||||
NO_LIBPYTHON=1 \
|
||||
|
Loading…
Reference in New Issue
Block a user