@@ -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
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(+)