Skip to contentSkip to conversation

toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93847

PATCH New Giulio Benetti 4 participants 9 messages Feb 20, 2020 – Feb 27, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93847

git package fails to build for the Nios2 architecture with optimization enabled with gcc < 9.x:
http://autobuild.buildroot.net/results/924/92484c49b655e4aa78ca52f124c6d8f605b9d06b/

It's been reported upstream:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93847

---
 toolchain/Config.in | 8 ++++++++
 1 file changed, 8 insertions(+)
toolchain/Config.in +8 -0
index 973c03254f..b8c2f79a36 100644
@@ -159,6 +159,14 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_90620
 	bool
 	default y if BR2_microblaze
 
+# 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.
+config BR2_TOOLCHAIN_HAS_GCC_BUG_93847
+	bool
+	default y if BR2_nios2
+	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_9
+
 config BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	bool
 
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/2 package/git: fix build failure due to gcc bug 93847

The git package exhibits gcc bug 93847 when built for the Nios2 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_93847=y.

Fixes:
http://autobuild.buildroot.net/results/e22/e225e62ea2d48660df4110790664f0c3306c1ea9/

---
 package/git/git.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/git/git.mk +1 -1
index a5c8669fc9..f32a2f8eb9 100644
@@ -67,7 +67,7 @@ endif
 
 GIT_CFLAGS = $(TARGET_CFLAGS)
 
-ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),y)
 GIT_CFLAGS += -O0
 endif
 
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/2 package/git: fix build failure due to gcc bug 93847

Quoted 6 lines · On Thu, 20 Feb 2020 16:40:04 +0100 Giulio Benetti…

The git package exhibits gcc bug 93847 when built for the Nios2 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_93847=y.

Quoted 7 lines

Fixes:
http://autobuild.buildroot.net/results/e22/e225e62ea2d48660df4110790664f0c3306c1ea9/

---
 package/git/git.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH 2/2 package/git: fix build failure due to gcc bug 93847

In reply to Giulio Benetti
Quoted 21 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Giulio" == Giulio Benetti <[email protected]> writes:

The git package exhibits gcc bug 93847 when built for the Nios2 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_93847=y.

Fixes:
http://autobuild.buildroot.net/results/e22/e225e62ea2d48660df4110790664f0c3306c1ea9/

---
 package/git/git.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/git/git.mk +0 -0
index a5c8669fc9..f32a2f8eb9 100644

package/git/git.mk endif · line 70

Quoted 5 lines
package/git/git.mk +1 -1
@@ -67,7 +67,7 @@ endif
 
 GIT_CFLAGS = $(TARGET_CFLAGS)
 
-ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),y)

This fails for a (hypothetical) toolchain affected by both issues, perhaps something like this would be better?

ifneq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),)

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 2/2 package/git: fix build failure due to gcc bug 93847

Hello Peter,

Quoted 7 lines · On Wed, 26 Feb 2020 23:22:08 +0100 Peter Korsgaard <[email protected]> wrote:

package/git/git.mk endif · line 70

Quoted 2 lines
package/git/git.mk +1 -1
-ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),y)  

This fails for a (hypothetical) toolchain affected by both issues, perhaps something like this would be better?

ifneq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),)

True in the general case. But BR2_TOOLCHAIN_HAS_GCC_BUG_85180 only applies to Microblaze, and BR2_TOOLCHAIN_HAS_GCC_BUG_93847 to NIOS2. So practically speaking, they are mutually exclusive options, so the case where both are enabled at the same time is impossible.

But I agree that in the general case what you showed would be preferable.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH 2/2 package/git: fix build failure due to gcc bug 93847

Hi All,

Quoted 13 lines · Thomas Petazzoni

Hello Peter,

Quoted 7 lines · On Wed, 26 Feb 2020 23:22:08 +0100 Peter Korsgaard <[email protected]> wrote:

package/git/git.mk endif · line 70

Quoted 2 lines
package/git/git.mk +1 -1
-ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),y)

This fails for a (hypothetical) toolchain affected by both issues, perhaps something like this would be better?

ifneq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),)

Quoted 7 lines

True in the general case. But BR2_TOOLCHAIN_HAS_GCC_BUG_85180 only applies to Microblaze, and BR2_TOOLCHAIN_HAS_GCC_BUG_93847 to NIOS2. So practically speaking, they are mutually exclusive options, so the case where both are enabled at the same time is impossible.

But I agree that in the general case what you showed would be preferable.

I've just sent a patch for this:
https://patchwork.ozlabs.org/patch/1245735/

even if not harmful, it's wrong.

Best regards

Signature · 2 lines
Giulio Benetti
Benetti Engineering sas
#6 lore raw

PATCH 2/2 package/git: fix build failure due to gcc bug 93847

In reply to Peter Korsgaard

Peter, All,

On 2020-02-26 23:22 +0100, Peter Korsgaard spake thusly:

Quoted 24 lines
Quoted 23 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Giulio" == Giulio Benetti <[email protected]> writes:

The git package exhibits gcc bug 93847 when built for the Nios2 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_93847=y.

Fixes:
http://autobuild.buildroot.net/results/e22/e225e62ea2d48660df4110790664f0c3306c1ea9/

---
 package/git/git.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/git/git.mk +0 -0
index a5c8669fc9..f32a2f8eb9 100644
@@ -67,7 +67,7 @@ endif
 
 GIT_CFLAGS = $(TARGET_CFLAGS)
Quoted 7 lines

package/git/git.mk endif · line 70

Quoted 2 lines
package/git/git.mk +1 -1
-ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),y)

This fails for a (hypothetical) toolchain affected by both issues, perhaps something like this would be better?

ifneq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),)

Or we can keep positive logic and use the available make utilities:

    ifeq ($(or $(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847)),y)

Regards,
Yann E. MORIN.

Quoted 6 lines
Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#7 lore raw

PATCH 2/2 package/git: fix build failure due to gcc bug 93847

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Hi,

Quoted 8 lines
Quoted 4 lines

This fails for a (hypothetical) toolchain affected by both issues, perhaps something like this would be better?

ifneq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),)

Or we can keep positive logic and use the available make utilities:

    ifeq ($(or $(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847)),y)

We could, but I already applied the change and we use similar logic in a number of places:

package/armbian-firmware/armbian-firmware.mk:ifneq ($(ARMBIAN_FIRMWARE_FILES)$(ARMBIAN_FIRMWARE_DIRS),) package/avahi/avahi.mk:ifneq ($(BR2_PACKAGE_AVAHI_DAEMON)$(BR2_PACKAGE_AVAHI_AUTOIPD),) package/freerdp/freerdp.mk:ifneq ($(BR2_PACKAGE_FREERDP_CLIENT_X11)$(BR2_PACKAGE_FREERDP_CLIENT_WL),)

Signature · 1 line
Bye, Peter Korsgaard
#8 lore raw

PATCH 1/2 toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93847

In reply to Giulio Benetti
Quoted 17 lines · On Thu, 20 Feb 2020 16:40:03 +0100 Giulio Benetti…

git package fails to build for the Nios2 architecture with optimization enabled with gcc < 9.x:
http://autobuild.buildroot.net/results/924/92484c49b655e4aa78ca52f124c6d8f605b9d06b/

It's been reported upstream:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93847

---
 toolchain/Config.in | 8 ++++++++
 1 file changed, 8 insertions(+)
toolchain/Config.in +0 -0
index 973c03254f..b8c2f79a36 100644

toolchain/Config.in config BR2_TOOLCHAIN_HAS_GCC_BUG_90620 · line 168

Quoted 10 lines
toolchain/Config.in +7 -0
@@ -159,6 +159,14 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_90620
 	bool
 	default y if BR2_microblaze
 
+# 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.
+config BR2_TOOLCHAIN_HAS_GCC_BUG_93847
+	bool
+	default y if BR2_nios2
+	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_9
	default y if BR2_nios2 && !BR2_TOOLCHAIN_GCC_AT_LEAST_9

felt a bit simpler/easier to read, so I changed it like this and applied to master. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com