All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/apitrace: fix build failure due to gcc bug 68485 and 85180
@ 2019-12-27 18:00 Giulio Benetti
  2019-12-31 14:33 ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Giulio Benetti @ 2019-12-27 18:00 UTC (permalink / raw)
  To: buildroot

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/

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/apitrace/apitrace.mk | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/package/apitrace/apitrace.mk b/package/apitrace/apitrace.mk
index e6f8a2b1c5..922c933f25 100644
--- a/package/apitrace/apitrace.mk
+++ b/package/apitrace/apitrace.mk
@@ -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))
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] package/apitrace: fix build failure due to gcc bug 68485 and 85180
  2019-12-27 18:00 [Buildroot] [PATCH] package/apitrace: fix build failure due to gcc bug 68485 and 85180 Giulio Benetti
@ 2019-12-31 14:33 ` Thomas Petazzoni
  2019-12-31 15:04   ` Giulio Benetti
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2019-12-31 14:33 UTC (permalink / raw)
  To: buildroot

On Fri, 27 Dec 2019 19:00:20 +0100
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> +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)"

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
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] package/apitrace: fix build failure due to gcc bug 68485 and 85180
  2019-12-31 14:33 ` Thomas Petazzoni
@ 2019-12-31 15:04   ` Giulio Benetti
  2019-12-31 17:08     ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Giulio Benetti @ 2019-12-31 15:04 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On 12/31/19 3:33 PM, Thomas Petazzoni wrote:
> On Fri, 27 Dec 2019 19:00:20 +0100
> Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
> 
>> +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)"
> 
> 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
-- 
Giulio Benetti
Benetti Engineering sas
> 
> Thanks,
> 
> Thomas
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] package/apitrace: fix build failure due to gcc bug 68485 and 85180
  2019-12-31 15:04   ` Giulio Benetti
@ 2019-12-31 17:08     ` Thomas Petazzoni
  2019-12-31 19:59       ` [Buildroot] [PATCH v2] " Giulio Benetti
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2019-12-31 17:08 UTC (permalink / raw)
  To: buildroot

On Tue, 31 Dec 2019 16:04:31 +0100
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> > 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
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2] package/apitrace: fix build failure due to gcc bug 68485 and 85180
  2019-12-31 17:08     ` Thomas Petazzoni
@ 2019-12-31 19:59       ` Giulio Benetti
  2020-01-01  9:14         ` Yann E. MORIN
  0 siblings, 1 reply; 6+ messages in thread
From: Giulio Benetti @ 2019-12-31 19:59 UTC (permalink / raw)
  To: buildroot

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/

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
V1->V2:
* 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
 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))
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2] package/apitrace: fix build failure due to gcc bug 68485 and 85180
  2019-12-31 19:59       ` [Buildroot] [PATCH v2] " Giulio Benetti
@ 2020-01-01  9:14         ` Yann E. MORIN
  0 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2020-01-01  9:14 UTC (permalink / raw)
  To: buildroot

Giulio, All,

On 2019-12-31 20:59 +0100, Giulio Benetti spake thusly:
> 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/
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>

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

Regards,
Yann E. MORIN.

> ---
> V1->V2:
> * 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
>  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))
> -- 
> 2.20.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-01-01  9:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-27 18:00 [Buildroot] [PATCH] package/apitrace: fix build failure due to gcc bug 68485 and 85180 Giulio Benetti
2019-12-31 14:33 ` Thomas Petazzoni
2019-12-31 15:04   ` Giulio Benetti
2019-12-31 17:08     ` Thomas Petazzoni
2019-12-31 19:59       ` [Buildroot] [PATCH v2] " Giulio Benetti
2020-01-01  9:14         ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.