diff mbox series

[2/2] package/htop: fix build failure due to gcc bug 109809

Message ID 20240205172327.2537523-2-giulio.benetti@benettiengineering.com
State New
Headers show
Series [1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_109809 | expand

Commit Message

Giulio Benetti Feb. 5, 2024, 5:23 p.m. UTC
The htop package exhibits gcc bug 109809 when built for the RISCV64
architecture with optimization enabled, which causes a build failure.

As done for other packages in Buildroot work around this gcc bug by
setting optimization to -O0 if BR2_TOOLCHAIN_HAS_GCC_BUG_109809=y.

Fixes:
still not happened. It shows up while building under docker-run this
pending patch-set:
https://patchwork.ozlabs.org/project/buildroot/list/?series=384841

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/htop/htop.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/package/htop/htop.mk b/package/htop/htop.mk
index 6dbaae3796..853620dfe8 100644
--- a/package/htop/htop.mk
+++ b/package/htop/htop.mk
@@ -13,10 +13,18 @@  HTOP_CONF_ENV = HTOP_NCURSES_CONFIG_SCRIPT=$(STAGING_DIR)/usr/bin/$(NCURSES_CONF
 HTOP_LICENSE = GPL-2.0+
 HTOP_LICENSE_FILES = COPYING
 
+HTOP_CFLAGS = $(TARGET_CFLAGS)
+
 # ac_cv_prog_cc_c99 is required for BR2_USE_WCHAR=n because the C99 test
 # provided by autoconf relies on wchar_t.
 HTOP_CONF_ENV += ac_cv_prog_cc_c99=-std=gnu99
 
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_109809),y)
+HTOP_CFLAGS += -O0
+endif
+
+HTOP_CONF_ENV += CFLAGS="$(HTOP_CFLAGS)"
+
 ifeq ($(BR2_PACKAGE_HWLOC),y)
 HTOP_CONF_OPTS += --enable-hwloc
 HTOP_DEPENDENCIES += hwloc