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

Giulio Benetti giulio.benetti at benettiengineering.com
Tue Dec 31 19:59:22 UTC 2019

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.


Signed-off-by: Giulio Benetti <giulio.benetti at benettiengineering.com>
* Added comments into apitrace.mk
* Improved commit log
 package/apitrace/apitrace.mk | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/package/apitrace/apitrace.mk b/package/apitrace/apitrace.mk
index e6f8a2b1c5..2b74ba26df 100644
--- a/package/apitrace/apitrace.mk
+++ b/package/apitrace/apitrace.mk
@@ -21,4 +21,22 @@ endif
 # Gui was never tested, so we prefer to explicitly disable it
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
+# This works around embedded Brotli build failure
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+# This works around Apitrace itself build failure
 $(eval $(cmake-package))

More information about the buildroot mailing list