Skip to contentSkip to conversation

toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_104028

PATCH In review Giulio Benetti 3 participants 4 messages Jan 14, 2022 – Aug 18, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_104028

sg3_utils package fails to build for the M68K architecture with optimization enabled with gcc = 10.3.0 and it's still present in gcc = 11.1.0:
http://autobuild.buildroot.net/results/c49300d12a209b18f41d389f092324592b881277/

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

---
 toolchain/Config.in | 7 +++++++
 1 file changed, 7 insertions(+)
toolchain/Config.in +7 -0
index adc93ab725..ccdf62503d 100644
@@ -220,6 +220,13 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_101952
 	bool
 	default y if BR2_sh4
 
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104028
+# ICE: on M68K: Error: value -16034 out of range
+# This bug still exists in gcc = 11.1.0
+config BR2_TOOLCHAIN_HAS_GCC_BUG_104028
+	bool
+	default y if BR2_m68k
+
 config BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	bool
 
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 2/2 package/sg3_utils: fix build failure due to gcc bug 104028

The sg3_utils package exhibits gcc bug 104028 when built for the M68K 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_104028=y like we already do for BR2_TOOLCHAIN_HAS_GCC_BUG_85180=y.

Fixes:
http://autobuild.buildroot.net/results/c49300d12a209b18f41d389f092324592b881277/

---
 package/sg3_utils/sg3_utils.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/sg3_utils/sg3_utils.mk +8 -0
index e357fc1dde..b291bd69d9 100644
@@ -24,6 +24,14 @@ ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
 SG3_UTILS_CONF_ENV += LIBS="-latomic"
 endif
 
+SG3_UTILS_CFLAGS = $(TARGET_CFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_104028),y)
+SG3_UTILS_CFLAGS += -O0
+endif
+
+SG3_UTILS_CONF_ENV += CFLAGS="$(SG3_UTILS_CFLAGS)"
+
 ifeq ($(BR2_PACKAGE_SG3_UTILS_PROGS),)
 define SG3_UTILS_REMOVE_PROGS
 	for prog in \
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Giulio Benetti
Quoted 11 lines · On Fri, 14 Jan 2022 11:55:10 +0100 Giulio Benetti…

sg3_utils package fails to build for the M68K architecture with optimization enabled with gcc = 10.3.0 and it's still present in gcc = 11.1.0:
http://autobuild.buildroot.net/results/c49300d12a209b18f41d389f092324592b881277/

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

---
 toolchain/Config.in | 7 +++++++
 1 file changed, 7 insertions(+)

Both applied, thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw
Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:

Quoted 7 lines · On Fri, 14 Jan 2022 11:55:10 +0100 Giulio Benetti…

sg3_utils package fails to build for the M68K architecture with optimization enabled with gcc = 10.3.0 and it's still present in gcc = 11.1.0:
http://autobuild.buildroot.net/results/c49300d12a209b18f41d389f092324592b881277/

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

Quoted 6 lines
Quoted 4 lines

---
toolchain/Config.in | 7 +++++++

1 file changed, 7 insertions(+)

Both applied, thanks!

Committed both to 2022.05.x and 2022.02.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot