Skip to contentSkip to conversation

package/apitrace: fix build failure due to gcc bug 68485 and 85180

PATCH New Giulio Benetti 3 participants 6 messages Dec 27, 2019 – Jan 1, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/apitrace: fix build failure due to gcc bug 68485 and 85180

The apitrace package exhibits gcc bug 68485 when built for the Microblaze architecture with optimization enabled, which causes a build failure. This is mainly due to 3rd party brotli embedded in apitrace that already has been fixed in Buildroot as single package. After fixing this bug, gcc bug 81580 showed off.

So, as done for other packages in Buildroot, work around this gcc bug by setting optimization to -O0 if BR2_TOOLCHAIN_HAS_GCC_BUG_68485=y. And do the same if BR2_TOOLCHAIN_HAS_GCC_BUG_85180=y as already done for other packages.

Fixes:
http://autobuild.buildroot.net/results/a46/a46626cc50f07f41d831614306f556d346d31429/

---
 package/apitrace/apitrace.mk | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
package/apitrace/apitrace.mk +16 -0
index e6f8a2b1c5..922c933f25 100644
@@ -21,4 +21,20 @@ endif
 # Gui was never tested, so we prefer to explicitly disable it
 APITRACE_CONF_OPTS += -DENABLE_GUI=false
 
+APITRACE_CFLAGS = $(TARGET_CFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
+APITRACE_CFLAGS += -O0
+endif
+
+APITRACE_CONF_OPTS += -DCMAKE_C_FLAGS="$(APITRACE_CFLAGS)"
+
+APITRACE_CXXFLAGS = $(TARGET_CXXFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+APITRACE_CXXFLAGS += -O0
+endif
+
+APITRACE_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(APITRACE_CXXFLAGS)"
+
 $(eval $(cmake-package))
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 package/apitrace: fix build failure due to gcc bug 68485 and 85180

Quoted 5 lines · On Fri, 27 Dec 2019 19:00:20 +0100 Giulio Benetti…
package/apitrace/apitrace.mk +5 -0
+APITRACE_CFLAGS = $(TARGET_CFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
+APITRACE_CFLAGS += -O0
+endif

package/apitrace/apitrace.mk endif · line 38

Quoted 10 lines
package/apitrace/apitrace.mk +10 -0
+
+APITRACE_CONF_OPTS += -DCMAKE_C_FLAGS="$(APITRACE_CFLAGS)"
+
+APITRACE_CXXFLAGS = $(TARGET_CXXFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+APITRACE_CXXFLAGS += -O0
+endif
+
+APITRACE_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(APITRACE_CXXFLAGS)"

I'm a bit confused as to why the bug 68485 is worked-around through CFLAGS and bug 85180 is worked-around through CXXFLAGS. Could you explain this ?

Thanks,

Thomas

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

PATCH 1/1 package/apitrace: fix build failure due to gcc bug 68485 and 85180

Hi Thomas,

Quoted 14 lines · Thomas Petazzoni
Quoted 11 lines · On Fri, 27 Dec 2019 19:00:20 +0100 Giulio Benetti…
package/apitrace/apitrace.mk +11 -0
+APITRACE_CFLAGS = $(TARGET_CFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
+APITRACE_CFLAGS += -O0
+endif
+
+APITRACE_CONF_OPTS += -DCMAKE_C_FLAGS="$(APITRACE_CFLAGS)"
+
+APITRACE_CXXFLAGS = $(TARGET_CXXFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
Quoted 8 lines

package/apitrace/apitrace.mk endif · line 38

Quoted 4 lines
package/apitrace/apitrace.mk +4 -0
+APITRACE_CXXFLAGS += -O0
+endif
+
+APITRACE_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(APITRACE_CXXFLAGS)"

I'm a bit confused as to why the bug 68485 is worked-around through CFLAGS and bug 85180 is worked-around through CXXFLAGS. Could you explain this ?

Sure, gcc bug 68485 is due to (included 3rd party) brotli, and it manifests compiling C files, while gcc bug 85180 manifests on apitrace while compiling C++ files.

Best regards

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

Thanks,

Thomas

#3 lore raw

PATCH 1/1 package/apitrace: fix build failure due to gcc bug 68485 and 85180

Quoted 7 lines · On Tue, 31 Dec 2019 16:04:31 +0100 Giulio Benetti…
Quoted 3 lines

I'm a bit confused as to why the bug 68485 is worked-around through CFLAGS and bug 85180 is worked-around through CXXFLAGS. Could you explain this ?

Sure, gcc bug 68485 is due to (included 3rd party) brotli, and it manifests compiling C files, while gcc bug 85180 manifests on apitrace while compiling C++ files.

This probably warrants a proper comment in the .mk file then.

Thanks!

Thomas

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

PATCH v2 1/1 package/apitrace: fix build failure due to gcc bug 68485 and 85180

The apitrace package exhibits gcc bug 68485 when built for the Microblaze architecture with optimization enabled, which causes a build failure. This is mainly due to 3rd party brotli embedded in apitrace that already has been fixed in Buildroot as single package. After working around this bug overriding -O0 to CFLAGS(Brotli is a C program), gcc bug 81580 showed off while compiling C++ files.

So, as done for other packages in Buildroot, work around this gcc bug by setting optimization to -O0(in CFLAGS) if BR2_TOOLCHAIN_HAS_GCC_BUG_68485=y. And do the same(but in CXXFLAGS) if BR2_TOOLCHAIN_HAS_GCC_BUG_85180=y as already done for other packages.

Fixes:
http://autobuild.buildroot.net/results/a46/a46626cc50f07f41d831614306f556d346d31429/

---
V1->V2:
* Added comments into apitrace.mk
* Improved commit log

---
 package/apitrace/apitrace.mk | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
package/apitrace/apitrace.mk +18 -0
index e6f8a2b1c5..2b74ba26df 100644
@@ -21,4 +21,22 @@ endif
 # Gui was never tested, so we prefer to explicitly disable it
 APITRACE_CONF_OPTS += -DENABLE_GUI=false
 
+APITRACE_CFLAGS = $(TARGET_CFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
+# This works around embedded Brotli build failure
+APITRACE_CFLAGS += -O0
+endif
+
+APITRACE_CONF_OPTS += -DCMAKE_C_FLAGS="$(APITRACE_CFLAGS)"
+
+APITRACE_CXXFLAGS = $(TARGET_CXXFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+# This works around Apitrace itself build failure
+APITRACE_CXXFLAGS += -O0
+endif
+
+APITRACE_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(APITRACE_CXXFLAGS)"
+
 $(eval $(cmake-package))
Signature · 1 line
2.20.1
#5 lore raw

PATCH v2 1/1 package/apitrace: fix build failure due to gcc bug 68485 and 85180

Giulio, All,

On 2019-12-31 20:59 +0100, Giulio Benetti spake thusly:

Quoted 12 lines

The apitrace package exhibits gcc bug 68485 when built for the Microblaze architecture with optimization enabled, which causes a build failure. This is mainly due to 3rd party brotli embedded in apitrace that already has been fixed in Buildroot as single package. After working around this bug overriding -O0 to CFLAGS(Brotli is a C program), gcc bug 81580 showed off while compiling C++ files.

So, as done for other packages in Buildroot, work around this gcc bug by setting optimization to -O0(in CFLAGS) if BR2_TOOLCHAIN_HAS_GCC_BUG_68485=y. And do the same(but in CXXFLAGS) if BR2_TOOLCHAIN_HAS_GCC_BUG_85180=y as already done for other packages.

Quoted 4 lines

Fixes:
http://autobuild.buildroot.net/results/a46/a46626cc50f07f41d831614306f556d346d31429/

Applied to master, with a slight reorganising of the code Thanks!

Regards,
Yann E. MORIN.

Quoted 42 lines

---
V1->V2:
* Added comments into apitrace.mk
* Improved commit log

---
 package/apitrace/apitrace.mk | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
package/apitrace/apitrace.mk +18 -0
index e6f8a2b1c5..2b74ba26df 100644
@@ -21,4 +21,22 @@ endif
 # Gui was never tested, so we prefer to explicitly disable it
 APITRACE_CONF_OPTS += -DENABLE_GUI=false
 
+APITRACE_CFLAGS = $(TARGET_CFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
+# This works around embedded Brotli build failure
+APITRACE_CFLAGS += -O0
+endif
+
+APITRACE_CONF_OPTS += -DCMAKE_C_FLAGS="$(APITRACE_CFLAGS)"
+
+APITRACE_CXXFLAGS = $(TARGET_CXXFLAGS)
+
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+# This works around Apitrace itself build failure
+APITRACE_CXXFLAGS += -O0
+endif
+
+APITRACE_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(APITRACE_CXXFLAGS)"
+
 $(eval $(cmake-package))
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'