Skip to contentSkip to conversation

package/protobuf: work around gcc bug 85180

PATCH New Giulio Benetti 3 participants 4 messages Sep 18, 2019 – Sep 30, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/protobuf: work around gcc bug 85180

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 protobuf 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/73dc9610a13d6e14eec58d529617210d93d5dec4/

---
 package/protobuf/protobuf.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/protobuf/protobuf.mk +8 -0
index e698bac228..699735ce37 100644
@@ -17,6 +17,14 @@ PROTOBUF_LICENSE_FILES = LICENSE
 PROTOBUF_DEPENDENCIES = host-protobuf
 PROTOBUF_CONF_OPTS = --with-protoc=$(HOST_DIR)/bin/protoc
 
+PROTOBUF_CXXFLAGS = $(TARGET_CXXFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+PROTOBUF_CXXFLAGS += -O0
+endif
+
+PROTOBUF_CONF_ENV = CXXFLAGS="$(OPUS_CFXXLAGS)"
+
 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
 PROTOBUF_CONF_ENV += LIBS=-latomic
 endif
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 package/protobuf: work around gcc bug 85180

Quoted 20 lines · 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 protobuf 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/73dc9610a13d6e14eec58d529617210d93d5dec4/

---
 package/protobuf/protobuf.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/protobuf/protobuf.mk +0 -0
index e698bac228..699735ce37 100644

package/protobuf/protobuf.mk PROTOBUF_LICENSE_FILES = LICENSE · line 26

Quoted 10 lines
package/protobuf/protobuf.mk +7 -0
@@ -17,6 +17,14 @@ PROTOBUF_LICENSE_FILES = LICENSE
 PROTOBUF_DEPENDENCIES = host-protobuf
 PROTOBUF_CONF_OPTS = --with-protoc=$(HOST_DIR)/bin/protoc
 
+PROTOBUF_CXXFLAGS = $(TARGET_CXXFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+PROTOBUF_CXXFLAGS += -O0
+endif
+
+PROTOBUF_CONF_ENV = CXXFLAGS="$(OPUS_CFXXLAGS)"

OPUS_CFXXLAGS is obviously wrong. I guess it accidentally still fixed the
issue, because it causes the CXXFLAGS to be empty instead of TARGET_CXXFLAGS, so it gets built without optimisation options.

I fixed that and applied to master, thanks.

Regards,
Arnout

Quoted 5 lines
package/protobuf/protobuf.mk +1 -0
+
 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
 PROTOBUF_CONF_ENV += LIBS=-latomic
 endif
#2 lore raw

PATCH 1/1 package/protobuf: work around gcc bug 85180

Hi Arnout,

Quoted 26 lines · Arnout Vandecappelle
Quoted 23 lines · 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 protobuf 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/73dc9610a13d6e14eec58d529617210d93d5dec4/

---
  package/protobuf/protobuf.mk | 8 ++++++++
  1 file changed, 8 insertions(+)
package/protobuf/protobuf.mk +0 -0
index e698bac228..699735ce37 100644
@@ -17,6 +17,14 @@ PROTOBUF_LICENSE_FILES = LICENSE
  PROTOBUF_DEPENDENCIES = host-protobuf
  PROTOBUF_CONF_OPTS = --with-protoc=$(HOST_DIR)/bin/protoc
 
Quoted 11 lines

package/protobuf/protobuf.mk PROTOBUF_LICENSE_FILES = LICENSE · line 26

Quoted 7 lines
package/protobuf/protobuf.mk +7 -0
+PROTOBUF_CXXFLAGS = $(TARGET_CXXFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+PROTOBUF_CXXFLAGS += -O0
+endif
+
+PROTOBUF_CONF_ENV = CXXFLAGS="$(OPUS_CFXXLAGS)"

OPUS_CFXXLAGS is obviously wrong. I guess it accidentally still fixed the
issue, because it causes the CXXFLAGS to be empty instead of TARGET_CXXFLAGS, so it gets built without optimisation options.

Oops, yes, sorry.

Quoted 1 line

I fixed that and applied to master, thanks.

Thank you

Signature · 2 lines
Giulio Benetti
Benetti Engineering sas
Quoted 8 lines

Regards,
Arnout

Quoted 5 lines
package/protobuf/protobuf.mk +1 -0
+
  ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
  PROTOBUF_CONF_ENV += LIBS=-latomic
  endif
#3 lore raw

PATCH 1/1 package/protobuf: work around gcc bug 85180

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

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

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 protobuf 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 5 lines

Fixes:

http://autobuild.buildroot.net/results/73dc9610a13d6e14eec58d529617210d93d5dec4/

Committed to 2019.02.x, 2019.05.x and 2019.08.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard