* [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_109809
@ 2024-02-05 17:23 Giulio Benetti
2024-02-05 17:23 ` [Buildroot] [PATCH 2/2] package/htop: fix build failure due to gcc bug 109809 Giulio Benetti
0 siblings, 1 reply; 3+ messages in thread
From: Giulio Benetti @ 2024-02-05 17:23 UTC (permalink / raw)
To: buildroot
Cc: Romain Naour, Giulio Benetti, Thomas De Schampheleire,
Thomas Petazzoni
htop package fails to build for the RISCV64 architecture with optimization
enabled with gcc = 13.2.0 and it's still present in gcc = 14.x as reported
upstream:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109809
So let's introduce BR2_TOOLCHAIN_HAS_GCC_BUG_109809 to handle packages
affected by it like htop.
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
toolchain/Config.in | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/toolchain/Config.in b/toolchain/Config.in
index 34e0ae2c5f..64084dffe3 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -250,6 +250,14 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_107728
depends on BR2_TOOLCHAIN_USES_GLIBC
depends on BR2_OPTIMIZE_0
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109809
+# ICE: in dwarf2out_frame_debug_cfa_offset
+# Shows up starting from Gcc 13.2.0 and still has to be fixed
+config BR2_TOOLCHAIN_HAS_GCC_BUG_109809
+ bool
+ default y if BR2_RISCV_64
+ depends on BR2_TOOLCHAIN_GCC_AT_LEAST_13
+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110934
# ICE: on M68K: in change_address_1, at emit-rtl.cc:2287
# This bug exists in gcc = 12.3.0 and gcc = 13.2.0
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH 2/2] package/htop: fix build failure due to gcc bug 109809
2024-02-05 17:23 [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_109809 Giulio Benetti
@ 2024-02-05 17:23 ` Giulio Benetti
2024-08-06 20:28 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 3+ messages in thread
From: Giulio Benetti @ 2024-02-05 17:23 UTC (permalink / raw)
To: buildroot
Cc: Romain Naour, Giulio Benetti, Thomas De Schampheleire,
Thomas Petazzoni
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 --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
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH 2/2] package/htop: fix build failure due to gcc bug 109809
2024-02-05 17:23 ` [Buildroot] [PATCH 2/2] package/htop: fix build failure due to gcc bug 109809 Giulio Benetti
@ 2024-08-06 20:28 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-08-06 20:28 UTC (permalink / raw)
To: Giulio Benetti; +Cc: Romain Naour, Thomas De Schampheleire, buildroot
Hello Giulio,
On Mon, 5 Feb 2024 18:23:27 +0100
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
> 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
Unfortunately, this is not very useful, because this patch series is no
longer there. I just did a build like this:
BR2_riscv=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_HTOP=y
# BR2_TARGET_ROOTFS_TAR is not set
it uses gcc 13.x, on RISC-V 64-bit and it builds fine.
So for issues that have not been reported in the autobuilders, what is
good is to provide a defconfig that allows to reproduce the problem, so
that we can reproduce it again in the future.
Could you look into this, and submit a v2 if relevant?
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-08-06 20:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-05 17:23 [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_109809 Giulio Benetti
2024-02-05 17:23 ` [Buildroot] [PATCH 2/2] package/htop: fix build failure due to gcc bug 109809 Giulio Benetti
2024-08-06 20:28 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox