Skip to contentSkip to conversation

Microblaze clean up 2

PATCH Superseded Giulio Benetti 2 participants 10 messages Jun 18, 2019 – Jun 26, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Microblaze clean up 2

This patchset follows and must be applied *after* "Microblaze clean up" patchset:
http://lists.busybox.net/pipermail/buildroot/2019-June/252509.html

This patchset fixes 2 bugs and work around 2 build TIMEOUTs for Microblaze architecture.

Giulio Benetti (4):
package/qt5/qt5base: disable predefined -Og optimization
toolchain: bug 90620 has not been fixed in gcc 8.x package/qt5/qt5base: work around gcc bug 90620 package/libtorrent-rasterbar: work around gcc bug 85180

 .../libtorrent-rasterbar.mk                    |  4 ++++
 package/qt5/qt5base/qt5base.mk                 | 18 ++++++++++++++++--
 toolchain/Config.in                            |  3 +--
 3 files changed, 21 insertions(+), 4 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/4 package/qt5/qt5base: disable predefined -Og optimization

Starting from Qt5 5.9.0 -optimize-debug is enabled by default causing -Og flag to be appended to CFLAGS and consequently override TARGET_CFLAGS. We don't want this so let's pass -no-optimize-debug to QT5BASE_CONFIGURE_OPTS if QT5_VERSION_LATEST=y.

---
 package/qt5/qt5base/qt5base.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/qt5/qt5base/qt5base.mk +6 -0
index e4ae120631..c732e766f3 100644
@@ -27,6 +27,12 @@ QT5BASE_CONFIGURE_OPTS += \
 	-no-pch \
 	-shared
 
+ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
+# starting from version 5.9.0 -optimize-debug is enabled by default and
+# it overrides -O* with -Og that is not what we want
+QT5BASE_CONFIGURE_OPTS += -no-optimize-debug
+endif
+
 ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
 QT5BASE_DEPENDENCIES += pcre
 else
Signature · 1 line
2.17.1
#2 lore raw

PATCH 1/4 package/qt5/qt5base: disable predefined -Og optimization

Quoted 6 lines · On Tue, 18 Jun 2019 10:45:32 +0200 Giulio Benetti…

Starting from Qt5 5.9.0 -optimize-debug is enabled by default causing -Og flag to be appended to CFLAGS and consequently override TARGET_CFLAGS. We don't want this so let's pass -no-optimize-debug to QT5BASE_CONFIGURE_OPTS if QT5_VERSION_LATEST=y.

In fact, optimize-debug is only enabled for debug builds, so I adjusted the commit log and comment and applied. It would be good to check if optimize-size is automatically enabled (or not) for release builds, and see if we should -no-optimize-size as well.

Thanks,

Thomas

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

PATCH 1/4 package/qt5/qt5base: disable predefined -Og optimization

Hello Thomas,

Il 22/06/2019 20:54, Thomas Petazzoni ha scritto:

Quoted 8 lines
Quoted 5 lines · On Tue, 18 Jun 2019 10:45:32 +0200 Giulio Benetti…

Starting from Qt5 5.9.0 -optimize-debug is enabled by default causing -Og flag to be appended to CFLAGS and consequently override TARGET_CFLAGS. We don't want this so let's pass -no-optimize-debug to QT5BASE_CONFIGURE_OPTS if QT5_VERSION_LATEST=y.

Quoted 6 lines
Quoted 1 line

In fact, optimize-debug is only enabled for debug builds, so I adjusted the commit log and comment and applied. It would be good to check if optimize-size is automatically enabled (or not) for release builds, and see if we should -no-optimize-size as well.

Fortunately you've pointed me this, in fact qt5 in release mode doesn't build according to TARGET_OPTIMIZATION.
I've just sent a patch for that:
https://patchwork.ozlabs.org/patch/1122817/

Best 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
#4 lore raw

PATCH 2/4 toolchain: bug 90620 has not been fixed in gcc 8.x

In reply to Giulio Benetti

Gcc bug 90620 appears on gcc 8.x so remove version check dependency and keep only the BR2_microblaze one.

---
 toolchain/Config.in | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
toolchain/Config.in +1 -2
index 3f562e8d3c..db3ce3cf24 100644
@@ -154,11 +154,10 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_85862
 
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90620
 # ICE: in do_output_reload, at reload1.c:7978 on microblaze.
-# It's been fixed on Gcc 8.x but reappeared on Gcc 9.x
+# It's still not fixed in gcc 9.x
 config BR2_TOOLCHAIN_HAS_GCC_BUG_90620
 	bool
 	default y if BR2_microblaze
-	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_8 || BR2_TOOLCHAIN_GCC_AT_LEAST_9
 
 config BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	bool
Signature · 1 line
2.17.1
#5 lore raw

PATCH 2/4 toolchain: bug 90620 has not been fixed in gcc 8.x

Quoted 7 lines · On Tue, 18 Jun 2019 10:45:33 +0200 Giulio Benetti…

Gcc bug 90620 appears on gcc 8.x so remove version check dependency and keep only the BR2_microblaze one.

---
 toolchain/Config.in | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Applied to master, thanks.

Thomas

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

PATCH 3/4 package/qt5/qt5base: work around gcc bug 90620

In reply to Giulio Benetti

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

Fixes:
http://autobuild.buildroot.net/results/4e5/4e563f5fc38ec681a730a576c5f056bc092db74e/
http://autobuild.buildroot.net/results/348/3482bd950c7ab5608666807a7ab7ea857c767333/
http://autobuild.buildroot.net/results/835/8351e3fbd6a39d05da6a6e7a978329d718dfc109/

---
 package/qt5/qt5base/qt5base.mk | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
package/qt5/qt5base/qt5base.mk +10 -2
index c732e766f3..e682ae3c7d 100644
@@ -33,6 +33,14 @@ ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
 QT5BASE_CONFIGURE_OPTS += -no-optimize-debug
 endif
 
+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_PACKAGE_QT5_VERSION_5_6),y)
 QT5BASE_DEPENDENCIES += pcre
 else
@@ -350,8 +358,8 @@ define QT5BASE_CONFIGURE_CMDS
 		-nomake tests \
 		-device buildroot \
 		-device-option CROSS_COMPILE="$(TARGET_CROSS)" \
-		-device-option BR_COMPILER_CFLAGS="$(TARGET_CFLAGS)" \
-		-device-option BR_COMPILER_CXXFLAGS="$(TARGET_CXXFLAGS)" \
+		-device-option BR_COMPILER_CFLAGS="$(QT5BASE_CFLAGS)" \
+		-device-option BR_COMPILER_CXXFLAGS="$(QT5BASE_CXXFLAGS)" \
 		$(QT5BASE_CONFIGURE_OPTS) \
 	)
 endef
Signature · 1 line
2.17.1
#7 lore raw

PATCH 3/4 package/qt5/qt5base: work around gcc bug 90620

Quoted 1 line · On Tue, 18 Jun 2019 10:45:34 +0200 Giulio Benetti…

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

The build does not hang, but fails. I fixed the commit log, and applied. Thanks!

Thomas

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

PATCH 4/4 package/libtorrent-rasterbar: work around gcc bug 85180

In reply to Giulio Benetti

With Microblaze Gcc version < 8.x the build hangs due to gcc bug 85180: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85180. The bug shows up when building libtorrent-rasterbar with optimization but not when building with -O0. To work around this, if BR2_TOOLCHAIN_HAS_GCC_BUG_85180=y we force using -O0.

Fixes:
http://autobuild.buildroot.net/results/410/410e75676abc6bbabe9029ecda969e3d909f3e18/

---
 package/libtorrent-rasterbar/libtorrent-rasterbar.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/libtorrent-rasterbar/libtorrent-rasterbar.mk +4 -0
index 012e972f1d..1d132382e1 100644
@@ -21,6 +21,10 @@ ifeq ($(BR2_m68k_cf),y)
 LIBTORRENT_RASTERBAR_CXXFLAGS += -fno-defer-pop
 endif
 
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+LIBTORRENT_RASTERBAR_CXXFLAGS += -O0
+endif
+
 LIBTORRENT_RASTERBAR_CONF_OPTS += CXXFLAGS="$(LIBTORRENT_RASTERBAR_CXXFLAGS)"
 
 ifeq ($(BR2_ENABLE_LOCALE)$(BR2_PACKAGE_LIBICONV),y)
Signature · 1 line
2.17.1
#9 lore raw

PATCH 4/4 package/libtorrent-rasterbar: work around gcc bug 85180

Quoted 6 lines · On Tue, 18 Jun 2019 10:45:35 +0200 Giulio Benetti…

With Microblaze Gcc version < 8.x the build hangs due to gcc bug 85180: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85180. The bug shows up when building libtorrent-rasterbar with optimization but not when building with -O0. To work around this, if BR2_TOOLCHAIN_HAS_GCC_BUG_85180=y we force using -O0.

Quoted 7 lines

Fixes:
http://autobuild.buildroot.net/results/410/410e75676abc6bbabe9029ecda969e3d909f3e18/

---
 package/libtorrent-rasterbar/libtorrent-rasterbar.mk | 4 ++++
 1 file changed, 4 insertions(+)

Applied to master, thanks.

Thomas

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