Skip to contentSkip to conversation

Introduce and work-around bug 101952 on bullet

PATCH In review Giulio Benetti 2 participants 4 messages Aug 17, 2021 – Aug 19, 2021

lore
Share & tools
lore
#0 lore raw

cover Introduce and work-around bug 101952 on bullet

This patchset introduce gcc bug 101952 and reference to it in bullet to work it around by disabling optimization(-O0).

NOTE: this patchset must be applied *after* this patchset:
https://patchwork.ozlabs.org/project/buildroot/list/?series=258074

Giulio Benetti (2):
toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_101952 package/bullet: fix build failure due to gcc bug 101952

 package/bullet/bullet.mk | 2 +-
 toolchain/Config.in      | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#1 lore raw

PATCH 1/2 toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_101952

bullet package fails to build for the SH4 architecture with optimization enabled with gcc = 11.1.0:
http://autobuild.buildroot.net/results/32b/32bfaf0aae57ed18c18e82a72a958af9b3e1b241/

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

---
 toolchain/Config.in | 7 +++++++
 1 file changed, 7 insertions(+)
toolchain/Config.in +7 -0
index c3edf8f48d..d9a49e87e6 100644
@@ -191,6 +191,13 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_101916
 	bool
 	default y if BR2_sh4
 
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101952
+# ICE: on SH4: unaligned opcodes detected in executable segment.
+# This bug still exists in gcc = 11.1.0
+config BR2_TOOLCHAIN_HAS_GCC_BUG_101952
+	bool
+	default y if BR2_sh4
+
 config BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	bool
 
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#2 lore raw

PATCH 2/2 package/bullet: fix build failure due to gcc bug 101952

In reply to Giulio Benetti

The bullet package exhibits gcc bug 101952 when built for the SH4 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_101952=y like we already do for BR2_TOOLCHAIN_HAS_GCC_BUG_85180=y.

Fixes:
http://autobuild.buildroot.net/results/32b/32bfaf0aae57ed18c18e82a72a958af9b3e1b241/

---
 package/bullet/bullet.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/bullet/bullet.mk +1 -1
index 01931b58a8..cc72be7c60 100644
@@ -24,7 +24,7 @@ endif
 
 BULLET_CXXFLAGS = $(TARGET_CXXFLAGS)
 
-ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+ifneq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_101952),)
 BULLET_CXXFLAGS += -O0
 endif
 
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#3 lore raw
In reply to Giulio Benetti
Quoted 3 lines · On Tue, 17 Aug 2021 23:31:10 +0200 Giulio Benetti…

Giulio Benetti (2):
toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_101952 package/bullet: fix build failure due to gcc bug 101952

Both applied. Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot