Skip to contentSkip to conversation

toolchain: GCC bug 68485

PATCH New Giulio Benetti 3 participants 15 messages May 27, 2019 – Oct 4, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 toolchain: GCC bug 68485

GCC <= 9.x hangs while building brotli for the Microblaze Arch:
http://autobuild.buildroot.net/results/d86/d86251974a0a348a64d9a1d1fd7d02dd4aff0792/

Reported:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485

Still not fixed. Every Microblaze Gcc version <= 9.x is affected.

---
 toolchain/Config.in | 6 ++++++
 1 file changed, 6 insertions(+)
toolchain/Config.in +6 -0
index 829ecd442a..d01a96f8a8 100644
@@ -131,6 +131,12 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_64735
 	default y if !BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS && \
 		!BR2_TOOLCHAIN_GCC_AT_LEAST_7
 
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485. This bug still
+# exists in gcc 9.x
+config BR2_TOOLCHAIN_HAS_GCC_BUG_68485
+	bool
+	default y if BR2_microblaze
+
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85180. This bug no
 # longer exists in gcc 8.x.
 config BR2_TOOLCHAIN_HAS_GCC_BUG_85180
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 package/brotli: work aroung gcc bug 68485

With Microblaze Gcc version <= 9.x the build hangs due to gcc bug 68485:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485. The bug show up when building brotli with optimization but not when building with -O0. To work aroung this, if BR2_TOOLCHAIN_HAS_GCC_BUG_68458=y, we force using -O0.

Fixes:

http://autobuild.buildroot.net/results/d86/d86251974a0a348a64d9a1d1fd7d02dd4aff0792/

---
 package/brotli/brotli.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/brotli/brotli.mk +4 -0
index 2c1ad48753..248bfb9daf 100644
@@ -14,4 +14,8 @@ BROTLI_CONF_OPTS = \
 	-DBROTLI_DISABLE_TESTS=ON \
 	-DBROTLI_BUNDLED_MODE=OFF
 
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
+BROTLI_CONF_OPTS += -DCMAKE_C_FLAGS="-O0"
+endif
+
 $(eval $(cmake-package))
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/2 package/brotli: work aroung gcc bug 68485

Quoted 1 line · Giulio Benetti

With Microblaze Gcc version <= 9.x the build hangs due to gcc bug 68485:

                                               ^^^^^

fails, not hangs

Quoted 19 lines

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485. The bug show up when building brotli with optimization but not when building with -O0. To work aroung this, if BR2_TOOLCHAIN_HAS_GCC_BUG_68458=y, we force using -O0.

Fixes:

http://autobuild.buildroot.net/results/d86/d86251974a0a348a64d9a1d1fd7d02dd4aff0792/

---
 package/brotli/brotli.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/brotli/brotli.mk +0 -0
index 2c1ad48753..248bfb9daf 100644

package/brotli/brotli.mk BROTLI_CONF_OPTS = \ · line 17

Quoted 4 lines
package/brotli/brotli.mk +1 -0
@@ -14,4 +14,8 @@ BROTLI_CONF_OPTS = \
 	-DBROTLI_DISABLE_TESTS=ON \
 	-DBROTLI_BUNDLED_MODE=OFF
 
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)

Could you also update package/gpsd/gpsd.mk in the same way? It's the package
which triggered the original bug report, and it still disables it for microblaze entirely.

Regards,
Arnout

Quoted 5 lines
package/brotli/brotli.mk +3 -0
+BROTLI_CONF_OPTS += -DCMAKE_C_FLAGS="-O0"
+endif
+
 $(eval $(cmake-package))
#3 lore raw

PATCH 2/2 package/brotli: work aroung gcc bug 68485

Il 27/05/2019 23:18, Arnout Vandecappelle ha scritto:

Quoted 6 lines · Giulio Benetti
Quoted 1 line

With Microblaze Gcc version <= 9.x the build hangs due to gcc bug 68485:

                                                ^^^^^

fails, not hangs

Oops. Right.

Quoted 22 lines
Quoted 22 lines

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485. The bug show up when building brotli with optimization but not when building with -O0. To work aroung this, if BR2_TOOLCHAIN_HAS_GCC_BUG_68458=y, we force using -O0.

Fixes:

   http://autobuild.buildroot.net/results/d86/d86251974a0a348a64d9a1d1fd7d02dd4aff0792/
---
  package/brotli/brotli.mk | 4 ++++
  1 file changed, 4 insertions(+)
package/brotli/brotli.mk +0 -0
index 2c1ad48753..248bfb9daf 100644
@@ -14,4 +14,8 @@ BROTLI_CONF_OPTS = \
  	-DBROTLI_DISABLE_TESTS=ON \
  	-DBROTLI_BUNDLED_MODE=OFF
 
Quoted 6 lines

package/brotli/brotli.mk BROTLI_CONF_OPTS = \ · line 17

Quoted 1 line
package/brotli/brotli.mk +1 -0
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)

Could you also update package/gpsd/gpsd.mk in the same way? It's the package
which triggered the original bug report, and it still disables it for microblaze entirely.

Sure, it was already ready to tell the truth, but I have too many patches in WIP.
There are also, flann and libspatialindex.
I'm going to send all together then.

Thank you

Kind regards

Signature · 10 lines
Giulio Benetti
CTO

MICRONOVA SRL
Sede: Via A. Niedda 3 - 35010 Vigonza (PD)
Tel. 049/8931563 - Fax 049/8931346
Cod.Fiscale - P.IVA 02663420285
Capitale Sociale ? 26.000 i.v.
Iscritta al Reg. Imprese di Padova N. 02663420285
Numero R.E.A. 258642
Quoted 6 lines
Quoted 6 lines
package/brotli/brotli.mk +3 -0
+BROTLI_CONF_OPTS += -DCMAKE_C_FLAGS="-O0"
+endif
+
  $(eval $(cmake-package))
#4 lore raw

v2 cover Fix and clean GCC BUG 68485 per-package

Introduce Gcc Bug 68485
Fix Bug 68485 for brotli
Clean up packages for:
- gpsd
- flann
- libspatialindex

Giulio Benetti (4):
package/brotli: work aroung gcc bug 68485 package/gpsd: use common BR2_TOOLCHAIN_HAS_GCC_BUG_68485 package/flann: re-enable package on Microblaze package/libspatialindex: use common BR2_TOOLCHAIN_HAS_BUG_68485

 package/brotli/brotli.mk                   | 4 ++++
 package/flann/Config.in                    | 4 ----
 package/flann/flann.mk                     | 4 ++++
 package/gpsd/gpsd.mk                       | 5 +----
 package/libspatialindex/libspatialindex.mk | 4 +---
 5 files changed, 10 insertions(+), 11 deletions(-)
Signature · 1 line
2.17.1
#5 lore raw

PATCH v2 1/4 package/brotli: work aroung gcc bug 68485

With Microblaze Gcc version <= 9.x the build fails due to gcc bug 68485:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485. The bug show up when building brotli with optimization but not when building with -O0. To work aroung this, if BR2_TOOLCHAIN_HAS_GCC_BUG_68458=y, we force using -O0.

Fixes:

http://autobuild.buildroot.net/results/d86/d86251974a0a348a64d9a1d1fd7d02dd4aff0792/

---
 package/brotli/brotli.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/brotli/brotli.mk +4 -0
index 2c1ad48753..248bfb9daf 100644
@@ -14,4 +14,8 @@ BROTLI_CONF_OPTS = \
 	-DBROTLI_DISABLE_TESTS=ON \
 	-DBROTLI_BUNDLED_MODE=OFF
 
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
+BROTLI_CONF_OPTS += -DCMAKE_C_FLAGS="-O0"
+endif
+
 $(eval $(cmake-package))
Signature · 1 line
2.17.1
#6 lore raw

PATCH v2 1/4 package/brotli: work aroung gcc bug 68485

Quoted 11 lines · Giulio Benetti

With Microblaze Gcc version <= 9.x the build fails due to gcc bug 68485:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485. The bug show up when building brotli with optimization but not when building with -O0. To work aroung this, if BR2_TOOLCHAIN_HAS_GCC_BUG_68458=y, we force using -O0.

Fixes:

http://autobuild.buildroot.net/results/d86/d86251974a0a348a64d9a1d1fd7d02dd4aff0792/

Applied to master, thanks.

The rest of the series should go to next, actually. In fact, I should also have
applied flare-engine to next :-(

Regards,
Arnout

Quoted 18 lines
---
 package/brotli/brotli.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/brotli/brotli.mk +4 -0
index 2c1ad48753..248bfb9daf 100644
@@ -14,4 +14,8 @@ BROTLI_CONF_OPTS = \
 	-DBROTLI_DISABLE_TESTS=ON \
 	-DBROTLI_BUNDLED_MODE=OFF
 
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
+BROTLI_CONF_OPTS += -DCMAKE_C_FLAGS="-O0"
+endif
+
 $(eval $(cmake-package))
#7 lore raw

PATCH v2 1/4 package/brotli: work aroung gcc bug 68485

Il 28/05/2019 00:11, Arnout Vandecappelle ha scritto:

Quoted 11 lines · Giulio Benetti
Quoted 8 lines

With Microblaze Gcc version <= 9.x the build fails due to gcc bug 68485:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485. The bug show up when building brotli with optimization but not when building with -O0. To work aroung this, if BR2_TOOLCHAIN_HAS_GCC_BUG_68458=y, we force using -O0.

Fixes:

Quoted 8 lines
Quoted 3 lines
   http://autobuild.buildroot.net/results/d86/d86251974a0a348a64d9a1d1fd7d02dd4aff0792/

Applied to master, thanks.

The rest of the series should go to next, actually. In fact, I should also have
applied flare-engine to next :-(

Sure, no problem, I have lot of other Microblaze patches. Tomorrow I will give priority to bug fix patches and only after to "clean-up" patches.

Kind regards

Signature · 10 lines
Giulio Benetti
CTO

MICRONOVA SRL
Sede: Via A. Niedda 3 - 35010 Vigonza (PD)
Tel. 049/8931563 - Fax 049/8931346
Cod.Fiscale - P.IVA 02663420285
Capitale Sociale ? 26.000 i.v.
Iscritta al Reg. Imprese di Padova N. 02663420285
Numero R.E.A. 258642
Quoted 19 lines
Quoted 19 lines
---
  package/brotli/brotli.mk | 4 ++++
  1 file changed, 4 insertions(+)
package/brotli/brotli.mk +4 -0
index 2c1ad48753..248bfb9daf 100644
@@ -14,4 +14,8 @@ BROTLI_CONF_OPTS = \
  	-DBROTLI_DISABLE_TESTS=ON \
  	-DBROTLI_BUNDLED_MODE=OFF
 
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
+BROTLI_CONF_OPTS += -DCMAKE_C_FLAGS="-O0"
+endif
+
  $(eval $(cmake-package))
#8 lore raw

PATCH v2 1/4 package/brotli: work aroung gcc bug 68485

Arnout,

Il 28/05/2019 00:17, Giulio Benetti ha scritto:

Quoted 20 lines

Il 28/05/2019 00:11, Arnout Vandecappelle ha scritto:

Quoted 19 lines · Giulio Benetti
Quoted 11 lines

With Microblaze Gcc version <= 9.x the build fails due to gcc bug 68485:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485. The bug show up when building brotli with optimization but not when building with -O0. To work aroung this, if BR2_TOOLCHAIN_HAS_GCC_BUG_68458=y, we force using -O0.

Fixes:

    http://autobuild.buildroot.net/results/d86/d86251974a0a348a64d9a1d1fd7d02dd4aff0792/

Applied to master, thanks.

The rest of the series should go to next, actually. In fact, I should also have
applied flare-engine to next :-(

Need also this patch, otherwise build is broken:
https://patchwork.ozlabs.org/patch/1105947/

I've forgot to resend it!

Signature · 10 lines
Giulio Benetti
CTO

MICRONOVA SRL
Sede: Via A. Niedda 3 - 35010 Vigonza (PD)
Tel. 049/8931563 - Fax 049/8931346
Cod.Fiscale - P.IVA 02663420285
Capitale Sociale ? 26.000 i.v.
Iscritta al Reg. Imprese di Padova N. 02663420285
Numero R.E.A. 258642
#9 lore raw

PATCH v2 2/4 package/gpsd: use common BR2_TOOLCHAIN_HAS_GCC_BUG_68485

In reply to Giulio Benetti

Workaround for Gcc ICE works ok, but it's issued if BR2_microblaze=y with a local comment. Let's use BR2_TOOLCHAIN_HAS_GCC_BUG_68485 instead to avoid repeating ICE bug comment for every package affected from it.

---
 package/gpsd/gpsd.mk | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
package/gpsd/gpsd.mk +1 -4
index d2c7612526..2062f9e846 100644
@@ -42,10 +42,7 @@ else
 GPSD_SCONS_OPTS += libgpsmm=no
 endif
 
-# prevents from triggering GCC ICE
-# A bug was reported to the gcc bug tracker:
-# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485
-ifeq ($(BR2_microblaze),y)
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
 GPSD_CFLAGS += -O0
 endif
 
Signature · 1 line
2.17.1
#10 lore raw

PATCH v2 3/4 package/flann: re-enable package on Microblaze

In reply to Giulio Benetti

With Microblaze Gcc version <= 9.x build fails tue to bug 68485:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485. To avoid this, the flann package has a !BR2_microblaze dependency. However, gcc bug 68485 only triggers when optimization is enabled, so we can work around the issue by passing -O0, which is what we do in other Buildroot packages to work around this bug.

So, this commit passes -O0 when BR2_TOOLCHAIN_HAS_GCC_BUG_68485, and re-enables flann on Microblaze.

---
 package/flann/Config.in | 4 ----
 package/flann/flann.mk  | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)
package/flann/Config.in +0 -4
index a2cd50c867..3725fc784f 100644
@@ -2,9 +2,6 @@ config BR2_PACKAGE_FLANN
 	bool "flann"
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on !BR2_STATIC_LIBS
-	# all gcc versions fail to build flann on Microblaze due to
-	# gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69401
-	depends on !BR2_microblaze
 	help
 	  FLANN is a library for performing fast approximate nearest
 	  neighbor searches in high dimensional spaces. It contains a
@@ -25,5 +22,4 @@ config BR2_PACKAGE_FLANN_EXAMPLES
 endif
 
 comment "flann needs a toolchain w/ C++, dynamic library"
-	depends on !BR2_microblaze
 	depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS
package/flann/flann.mk +4 -0
index d091ec18a0..b57a6d5f9b 100644
@@ -18,4 +18,8 @@ FLANN_CONF_OPTS = \
 	-DPYTHON_EXECUTABLE=OFF \
 	-DCMAKE_DISABLE_FIND_PACKAGE_HDF5=TRUE
 
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
+FLANN_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -O0"
+endif
+
 $(eval $(cmake-package))
Signature · 1 line
2.17.1
#11 lore raw

PATCH v2 4/4 package/libspatialindex: use common BR2_TOOLCHAIN_HAS_BUG_68485

In reply to Giulio Benetti

For consistency with the rest of packages let's use common BR2_TOOLCHAIN_HAS_BUG_68485 instead of !BR2_microblaze condition with comment on top of it.

---
 package/libspatialindex/libspatialindex.mk | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
package/libspatialindex/libspatialindex.mk +1 -3
index 3a558dfc7e..8dd85e2700 100644
@@ -17,9 +17,7 @@ LIBSPATIALINDEX_AUTORECONF = YES
 LIBSPATIALINDEX_CXXFLAGS = $(TARGET_CXXFLAGS)
 LIBSPATIALINDEX_CONF_ENV = CXXFLAGS="$(LIBSPATIALINDEX_CXXFLAGS)"
 
-# Workaround gcc ICE
-# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485)
-ifeq ($(BR2_microblaze),y)
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
 LIBSPATIALINDEX_CXXFLAGS += -O0
 endif
 
Signature · 1 line
2.17.1
#12 lore raw

PATCH 1/2 toolchain: GCC bug 68485

In reply to Giulio Benetti
Quoted 9 lines · Giulio Benetti

GCC <= 9.x hangs while building brotli for the Microblaze Arch:
http://autobuild.buildroot.net/results/d86/d86251974a0a348a64d9a1d1fd7d02dd4aff0792/

Reported:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485

Still not fixed. Every Microblaze Gcc version <= 9.x is affected.

Applied to master (with a little rewording of the commit message), thanks.

I should have noticed that this was missing :-(

Regards,
Arnout

Quoted 22 lines
---
 toolchain/Config.in | 6 ++++++
 1 file changed, 6 insertions(+)
toolchain/Config.in +6 -0
index 829ecd442a..d01a96f8a8 100644
@@ -131,6 +131,12 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_64735
 	default y if !BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS && \
 		!BR2_TOOLCHAIN_GCC_AT_LEAST_7
 
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485. This bug still
+# exists in gcc 9.x
+config BR2_TOOLCHAIN_HAS_GCC_BUG_68485
+	bool
+	default y if BR2_microblaze
+
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85180. This bug no
 # longer exists in gcc 8.x.
 config BR2_TOOLCHAIN_HAS_GCC_BUG_85180
#13 lore raw

PATCH 1/2 toolchain: GCC bug 68485

Il 28/05/2019 09:54, Arnout Vandecappelle ha scritto:

Quoted 9 lines · Giulio Benetti
Quoted 6 lines

GCC <= 9.x hangs while building brotli for the Microblaze Arch:
http://autobuild.buildroot.net/results/d86/d86251974a0a348a64d9a1d1fd7d02dd4aff0792/

Reported:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485

Quoted 7 lines
Quoted 3 lines

Still not fixed. Every Microblaze Gcc version <= 9.x is affected.

Applied to master (with a little rewording of the commit message), thanks.

I should have noticed that this was missing :-(

No problem, I've catched it!
There are a lot of patche for Microblaze now so sometimes it's confusing ;)

Signature · 10 lines
Giulio Benetti
CTO

MICRONOVA SRL
Sede: Via A. Niedda 3 - 35010 Vigonza (PD)
Tel. 049/8931563 - Fax 049/8931346
Cod.Fiscale - P.IVA 02663420285
Capitale Sociale ? 26.000 i.v.
Iscritta al Reg. Imprese di Padova N. 02663420285
Numero R.E.A. 258642
Quoted 23 lines
Quoted 23 lines
---
  toolchain/Config.in | 6 ++++++
  1 file changed, 6 insertions(+)
toolchain/Config.in +6 -0
index 829ecd442a..d01a96f8a8 100644
@@ -131,6 +131,12 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_64735
  	default y if !BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS && \
  		!BR2_TOOLCHAIN_GCC_AT_LEAST_7
 
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485. This bug still
+# exists in gcc 9.x
+config BR2_TOOLCHAIN_HAS_GCC_BUG_68485
+	bool
+	default y if BR2_microblaze
+
  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85180. This bug no
  # longer exists in gcc 8.x.
  config BR2_TOOLCHAIN_HAS_GCC_BUG_85180
#14 lore raw

PATCH 1/2 toolchain: GCC bug 68485

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

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

GCC <= 9.x hangs while building brotli for the Microblaze Arch:
http://autobuild.buildroot.net/results/d86/d86251974a0a348a64d9a1d1fd7d02dd4aff0792/

Reported:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485

Still not fixed. Every Microblaze Gcc version <= 9.x is affected.

Committed to 2019.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard