diff mbox series

toolchain: remove gcc bug 90620

Message ID 20240413074923.1082313-1-giulio.benetti@benettiengineering.com
State Rejected
Headers show
Series toolchain: remove gcc bug 90620 | expand

Commit Message

Giulio Benetti April 13, 2024, 7:49 a.m. UTC
While building packages affected by gcc bug 90620 with Microblaze
and gcc versions 11, 12, 13 built with Buildroot and external Bootlin
toolchains without -O0 work-around it turns out that the bug has been
fixed. So let's remove gcc bug 90620.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/haproxy/haproxy.mk                   | 8 +-------
 package/qt5/qt5base/qt5base.mk               | 5 -----
 package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk | 4 ----
 toolchain/Config.in                          | 9 ---------
 4 files changed, 1 insertion(+), 25 deletions(-)

Comments

Arnout Vandecappelle April 28, 2024, 5:18 p.m. UTC | #1
On 13/04/2024 09:49, Giulio Benetti wrote:
> While building packages affected by gcc bug 90620 with Microblaze
> and gcc versions 11, 12, 13 built with Buildroot and external Bootlin
> toolchains without -O0 work-around it turns out that the bug has been
> fixed. So let's remove gcc bug 90620.

  But a custom external toolchain that uses GCC <10 would still be affected, no? 
So you can't actually remove it? You can just remove the
|| BR2_TOOLCHAIN_GCC_AT_LEAST_11 part.

  Regards,
  Arnout

> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>   package/haproxy/haproxy.mk                   | 8 +-------
>   package/qt5/qt5base/qt5base.mk               | 5 -----
>   package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk | 4 ----
>   toolchain/Config.in                          | 9 ---------
>   4 files changed, 1 insertion(+), 25 deletions(-)
> 
> diff --git a/package/haproxy/haproxy.mk b/package/haproxy/haproxy.mk
> index 61a9ebebe4..697dbdf4bf 100644
> --- a/package/haproxy/haproxy.mk
> +++ b/package/haproxy/haproxy.mk
> @@ -74,15 +74,9 @@ endif
>   
>   HAPROXY_MAKE_OPTS += ADDLIB="$(HAPROXY_LIBS)"
>   
> -HAPROXY_CFLAGS = $(TARGET_CFLAGS)
> -
> -ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_90620),y)
> -HAPROXY_CFLAGS += -O0
> -endif
> -
>   define HAPROXY_BUILD_CMDS
>   	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
> -		$(HAPROXY_MAKE_OPTS) DEFINE="$(HAPROXY_CFLAGS)" -C $(@D)
> +		$(HAPROXY_MAKE_OPTS) DEFINE="$(TARGET_CFLAGS)" -C $(@D)
>   endef
>   
>   define HAPROXY_INSTALL_TARGET_CMDS
> diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
> index e173639cca..d6445be9b2 100644
> --- a/package/qt5/qt5base/qt5base.mk
> +++ b/package/qt5/qt5base/qt5base.mk
> @@ -50,11 +50,6 @@ QT5BASE_CONFIGURE_OPTS += -no-optimize-debug
>   QT5BASE_CFLAGS = $(TARGET_CFLAGS)
>   QT5BASE_CXXFLAGS = $(TARGET_CXXFLAGS)
>   
> -ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_90620),y)
> -QT5BASE_CFLAGS += -O0
> -QT5BASE_CXXFLAGS += -O0
> -endif
> -
>   ifeq ($(BR2_X86_CPU_HAS_SSE2),)
>   QT5BASE_CONFIGURE_OPTS += -no-sse2
>   else ifeq ($(BR2_X86_CPU_HAS_SSE3),)
> diff --git a/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk b/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
> index 2126d3c915..f99baa1be7 100644
> --- a/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
> +++ b/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
> @@ -20,8 +20,4 @@ ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
>   QT5XMLPATTERNS_LICENSE += , BSD-3-Clause (examples)
>   endif
>   
> -ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_90620),y)
> -QT5XMLPATTERNS_CONF_OPTS += "QMAKE_CXXFLAGS+=-O0"
> -endif
> -
>   $(eval $(qmake-package))
> diff --git a/toolchain/Config.in b/toolchain/Config.in
> index 944e573f82..de5ef7a08f 100644
> --- a/toolchain/Config.in
> +++ b/toolchain/Config.in
> @@ -170,15 +170,6 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_85862
>   	default y if BR2_microblaze
>   	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_7
>   
> -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90620
> -# ICE: in do_output_reload, at reload1.c:7978 on microblaze.
> -# This bug no longer exists in gcc 10.x but reappeared in gcc 11.x
> -config BR2_TOOLCHAIN_HAS_GCC_BUG_90620
> -	bool
> -	default y if BR2_microblaze
> -	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_10 \
> -		|| BR2_TOOLCHAIN_GCC_AT_LEAST_11
> -
>   # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93847
>   # ICE: compiler error: Segmentation fault on Nios II. This bug
>   # no longer exists in gcc 9.x.
Giulio Benetti April 28, 2024, 6:35 p.m. UTC | #2
Hi Arnout,

On 28/04/24 19:18, Arnout Vandecappelle via buildroot wrote:
> 
> 
> On 13/04/2024 09:49, Giulio Benetti wrote:
>> While building packages affected by gcc bug 90620 with Microblaze
>> and gcc versions 11, 12, 13 built with Buildroot and external Bootlin
>> toolchains without -O0 work-around it turns out that the bug has been
>> fixed. So let's remove gcc bug 90620.
> 
>   But a custom external toolchain that uses GCC <10 would still be 
> affected, no? 

But this bug is Microblaze specific and the only 2 Microblaze external
toolchains are the Bootlin's ones, where the oldest GCC version is
12.3.0, so as we've already done in the past with this commit:
https://gitlab.com/buildroot.org/buildroot/-/commit/55fcba2a7c41d29f3f93bb37eec1264af4b45fb0

considering Buildroot free of bug 90620. If anyone will send a patch
for new microblaze external-toolchains it's very unlikely they will
contain gcc < 10.

Best regards
Thomas Petazzoni May 9, 2024, 3:48 p.m. UTC | #3
On Sun, 28 Apr 2024 20:35:30 +0200
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> But this bug is Microblaze specific and the only 2 Microblaze external
> toolchains are the Bootlin's ones, where the oldest GCC version is
> 12.3.0, so as we've already done in the past with this commit:
> https://gitlab.com/buildroot.org/buildroot/-/commit/55fcba2a7c41d29f3f93bb37eec1264af4b45fb0
> 
> considering Buildroot free of bug 90620. If anyone will send a patch
> for new microblaze external-toolchains it's very unlikely they will
> contain gcc < 10.

Arnout's point is not about new toolchains (which will indeed be based
on a recent gcc), but rather on older custom external toolchains that
people might still be using.

I don't have a hard feeling on this one. Yes, supporting old external
toolchains is nice. On the other hand, at some point, we need to get
rid of those workarounds, but I'm not sure when is the good time.

Thomas
Arnout Vandecappelle May 9, 2024, 8:19 p.m. UTC | #4
On 09/05/2024 17:48, Thomas Petazzoni wrote:
> On Sun, 28 Apr 2024 20:35:30 +0200
> Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
> 
>> But this bug is Microblaze specific and the only 2 Microblaze external
>> toolchains are the Bootlin's ones, where the oldest GCC version is
>> 12.3.0, so as we've already done in the past with this commit:
>> https://gitlab.com/buildroot.org/buildroot/-/commit/55fcba2a7c41d29f3f93bb37eec1264af4b45fb0
>>
>> considering Buildroot free of bug 90620. If anyone will send a patch
>> for new microblaze external-toolchains it's very unlikely they will
>> contain gcc < 10.

  Note that the first few releases of GCC 10 still had the bug, it was only 
fixed in GCC 10.2 or 10.3.


> Arnout's point is not about new toolchains (which will indeed be based
> on a recent gcc), but rather on older custom external toolchains that
> people might still be using.

  GCC 11 (which is definitely fixed) is only 3 years old. So for me it feels a 
bit early to remove this workaround.

  On the other hand, microblaze is such a niche platform that it shouldn't 
matter too much...

  Regards,
  Arnout

> 
> I don't have a hard feeling on this one. Yes, supporting old external
> toolchains is nice. On the other hand, at some point, we need to get
> rid of those workarounds, but I'm not sure when is the good time.
> 
> Thomas
diff mbox series

Patch

diff --git a/package/haproxy/haproxy.mk b/package/haproxy/haproxy.mk
index 61a9ebebe4..697dbdf4bf 100644
--- a/package/haproxy/haproxy.mk
+++ b/package/haproxy/haproxy.mk
@@ -74,15 +74,9 @@  endif
 
 HAPROXY_MAKE_OPTS += ADDLIB="$(HAPROXY_LIBS)"
 
-HAPROXY_CFLAGS = $(TARGET_CFLAGS)
-
-ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_90620),y)
-HAPROXY_CFLAGS += -O0
-endif
-
 define HAPROXY_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
-		$(HAPROXY_MAKE_OPTS) DEFINE="$(HAPROXY_CFLAGS)" -C $(@D)
+		$(HAPROXY_MAKE_OPTS) DEFINE="$(TARGET_CFLAGS)" -C $(@D)
 endef
 
 define HAPROXY_INSTALL_TARGET_CMDS
diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index e173639cca..d6445be9b2 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -50,11 +50,6 @@  QT5BASE_CONFIGURE_OPTS += -no-optimize-debug
 QT5BASE_CFLAGS = $(TARGET_CFLAGS)
 QT5BASE_CXXFLAGS = $(TARGET_CXXFLAGS)
 
-ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_90620),y)
-QT5BASE_CFLAGS += -O0
-QT5BASE_CXXFLAGS += -O0
-endif
-
 ifeq ($(BR2_X86_CPU_HAS_SSE2),)
 QT5BASE_CONFIGURE_OPTS += -no-sse2
 else ifeq ($(BR2_X86_CPU_HAS_SSE3),)
diff --git a/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk b/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
index 2126d3c915..f99baa1be7 100644
--- a/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
+++ b/package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk
@@ -20,8 +20,4 @@  ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
 QT5XMLPATTERNS_LICENSE += , BSD-3-Clause (examples)
 endif
 
-ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_90620),y)
-QT5XMLPATTERNS_CONF_OPTS += "QMAKE_CXXFLAGS+=-O0"
-endif
-
 $(eval $(qmake-package))
diff --git a/toolchain/Config.in b/toolchain/Config.in
index 944e573f82..de5ef7a08f 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -170,15 +170,6 @@  config BR2_TOOLCHAIN_HAS_GCC_BUG_85862
 	default y if BR2_microblaze
 	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_7
 
-# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90620
-# ICE: in do_output_reload, at reload1.c:7978 on microblaze.
-# This bug no longer exists in gcc 10.x but reappeared in gcc 11.x
-config BR2_TOOLCHAIN_HAS_GCC_BUG_90620
-	bool
-	default y if BR2_microblaze
-	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_10 \
-		|| BR2_TOOLCHAIN_GCC_AT_LEAST_11
-
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93847
 # ICE: compiler error: Segmentation fault on Nios II. This bug
 # no longer exists in gcc 9.x.