All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/3] Microblaze gcc bug 97208
@ 2021-08-13 21:37 Giulio Benetti
  2021-08-13 21:37 ` [Buildroot] [PATCH 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_97208 Giulio Benetti
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Giulio Benetti @ 2021-08-13 21:37 UTC (permalink / raw)
  To: buildroot
  Cc: Giulio Benetti, Romain Naour, Thomas De Schampheleire, Thomas Petazzoni

This patchset introduce gcc bug 97208 to workaround build failure of lmbench
on Microblaze. But let's also use it for toolchain-wrapper to make it more
consitent.

Giulio Benetti (3):
  toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_97208
  toolchain/toolchain-wrapper: use Gcc bug 97208 instead of repeating it
  package/lmbench: fix build failure due to gcc bug 97208

 package/lmbench/lmbench.mk     | 4 ++++
 toolchain/Config.in            | 7 +++++++
 toolchain/toolchain-wrapper.mk | 5 ++---
 3 files changed, 13 insertions(+), 3 deletions(-)

-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_97208
  2021-08-13 21:37 [Buildroot] [PATCH 0/3] Microblaze gcc bug 97208 Giulio Benetti
@ 2021-08-13 21:37 ` Giulio Benetti
  2021-08-13 23:15   ` Giulio Benetti
  2021-08-13 21:37 ` [Buildroot] [PATCH 2/3] toolchain/toolchain-wrapper: use Gcc bug 97208 instead of repeating it Giulio Benetti
  2021-08-13 21:37 ` [Buildroot] [PATCH 3/3] package/lmbench: fix build failure due to gcc bug 97208 Giulio Benetti
  2 siblings, 1 reply; 9+ messages in thread
From: Giulio Benetti @ 2021-08-13 21:37 UTC (permalink / raw)
  To: buildroot
  Cc: Giulio Benetti, Romain Naour, Thomas De Schampheleire, Thomas Petazzoni

lmbench package fails to build for the Microblaze architecture with
optimization enabled with gcc = 11.1.0:
http://autobuild.buildroot.net/results/ae1/ae1e4d61ed367c6cb64442c60d98882cc7985346/

It's been reported upstream by Romain Naour:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97208

Cc: Roman Naour <romain.naour@gmail.com>
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 toolchain/Config.in | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/toolchain/Config.in b/toolchain/Config.in
index 3888eeafe2..1dae0cb2cc 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -163,6 +163,13 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_93847
 	bool
 	default y if BR2_nios2 && !BR2_TOOLCHAIN_GCC_AT_LEAST_9
 
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97208
+# ICE: in extract_insn, at recog.c:2294 on microblaze.
+# This bug still exists in gcc = 11.1.0
+config BR2_TOOLCHAIN_HAS_GCC_BUG_97208
+	bool
+	default y if BR2_microblaze
+
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99410
 # Error: branch offset out of range on Nios II. This bug
 # no longer exists in gcc >= 9.x.
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 2/3] toolchain/toolchain-wrapper: use Gcc bug 97208 instead of repeating it
  2021-08-13 21:37 [Buildroot] [PATCH 0/3] Microblaze gcc bug 97208 Giulio Benetti
  2021-08-13 21:37 ` [Buildroot] [PATCH 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_97208 Giulio Benetti
@ 2021-08-13 21:37 ` Giulio Benetti
  2021-08-14 22:11   ` Giulio Benetti
  2021-08-13 21:37 ` [Buildroot] [PATCH 3/3] package/lmbench: fix build failure due to gcc bug 97208 Giulio Benetti
  2 siblings, 1 reply; 9+ messages in thread
From: Giulio Benetti @ 2021-08-13 21:37 UTC (permalink / raw)
  To: buildroot
  Cc: Giulio Benetti, Romain Naour, Thomas De Schampheleire, Thomas Petazzoni

Now that we have added Gcc bug 97208 we can use it instead of repeating it.
So let's substitute bug condition with bug presence. Also note that gcc bug
97208 is still present in gcc 11.1.0 so better to make comment more generic
and keep a detailed description in toolchain/Config.in

Cc: Roman Naour <romain.naour@gmail.com>
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 toolchain/toolchain-wrapper.mk | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk
index 8b551e3a18..c56ec7c054 100644
--- a/toolchain/toolchain-wrapper.mk
+++ b/toolchain/toolchain-wrapper.mk
@@ -33,11 +33,10 @@ TOOLCHAIN_WRAPPER_OPTS += -DBR_NEED_SOURCE_DATE_EPOCH
 endif
 endif
 
-# Disable -ftree-loop-distribute-patterns on microblaze to
-# workaround a compiler bug with gcc 10 and -O2, -Os or -O3.
+# Disable -ftree-loop-distribute-patterns on compiler affected by gcc bug 97208.
 # https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=5879ab5fafedc8f6f9bfe95a4cf8501b0df90edd
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97208
-ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_10)$(BR2_microblaze),yy)
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_97208),y)
 TOOLCHAIN_WRAPPER_OPTS += -fno-tree-loop-distribute-patterns
 endif
 
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 3/3] package/lmbench: fix build failure due to gcc bug 97208
  2021-08-13 21:37 [Buildroot] [PATCH 0/3] Microblaze gcc bug 97208 Giulio Benetti
  2021-08-13 21:37 ` [Buildroot] [PATCH 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_97208 Giulio Benetti
  2021-08-13 21:37 ` [Buildroot] [PATCH 2/3] toolchain/toolchain-wrapper: use Gcc bug 97208 instead of repeating it Giulio Benetti
@ 2021-08-13 21:37 ` Giulio Benetti
  2021-08-14 13:51   ` Thomas Petazzoni
  2 siblings, 1 reply; 9+ messages in thread
From: Giulio Benetti @ 2021-08-13 21:37 UTC (permalink / raw)
  To: buildroot
  Cc: Giulio Benetti, Romain Naour, Thomas De Schampheleire, Thomas Petazzoni

The lmbench package exhibits gcc bug 97208 when built for the Microblaze
architecture with optimization enabled, which causes a build failure.

As done for other packages in Buildroot work around this gcc bug by
setting optimization to -O0 if BR2_TOOLCHAIN_HAS_GCC_BUG_97208=y..

Fixes:
http://autobuild.buildroot.net/results/ae1/ae1e4d61ed367c6cb64442c60d98882cc7985346/

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

diff --git a/package/lmbench/lmbench.mk b/package/lmbench/lmbench.mk
index 2f3b19b5f8..8e16c7112f 100644
--- a/package/lmbench/lmbench.mk
+++ b/package/lmbench/lmbench.mk
@@ -18,6 +18,10 @@ LMBENCH_CFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags libtirpc`
 LMBENCH_LDLIBS = `$(PKG_CONFIG_HOST_BINARY) --libs libtirpc`
 endif
 
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_97208),y)
+LMBENCH_CFLAGS += -O0
+endif
+
 LMBENCH_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
 
 define LMBENCH_CONFIGURE_CMDS
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_97208
  2021-08-13 21:37 ` [Buildroot] [PATCH 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_97208 Giulio Benetti
@ 2021-08-13 23:15   ` Giulio Benetti
  2021-08-14 22:11     ` Giulio Benetti
  0 siblings, 1 reply; 9+ messages in thread
From: Giulio Benetti @ 2021-08-13 23:15 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, Thomas De Schampheleire, Thomas Petazzoni

Hi,

> Il giorno 13 ago 2021, alle ore 23:38, Giulio Benetti <giulio.benetti@benettiengineering.com> ha scritto:
> 
> lmbench package fails to build for the Microblaze architecture with
> optimization enabled with gcc = 11.1.0:

^^^ ‘gcc <= 11’, not only =

> http://autobuild.buildroot.net/results/ae1/ae1e4d61ed367c6cb64442c60d98882cc7985346/
> 
> It's been reported upstream by Romain Naour:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97208
> 
> Cc: Roman Naour <romain.naour@gmail.com>
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
> toolchain/Config.in | 7 +++++++
> 1 file changed, 7 insertions(+)
> 
> diff --git a/toolchain/Config.in b/toolchain/Config.in
> index 3888eeafe2..1dae0cb2cc 100644
> --- a/toolchain/Config.in
> +++ b/toolchain/Config.in
> @@ -163,6 +163,13 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_93847
>    bool
>    default y if BR2_nios2 && !BR2_TOOLCHAIN_GCC_AT_LEAST_9
> 
> +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97208
> +# ICE: in extract_insn, at recog.c:2294 on microblaze.
> +# This bug still exists in gcc = 11.1.0
> +config BR2_TOOLCHAIN_HAS_GCC_BUG_97208
> +    bool
> +    default y if BR2_microblaze
> +
> # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99410
> # Error: branch offset out of range on Nios II. This bug
> # no longer exists in gcc >= 9.x.
> -- 
> 2.25.1
> 

_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 3/3] package/lmbench: fix build failure due to gcc bug 97208
  2021-08-13 21:37 ` [Buildroot] [PATCH 3/3] package/lmbench: fix build failure due to gcc bug 97208 Giulio Benetti
@ 2021-08-14 13:51   ` Thomas Petazzoni
  2021-08-14 21:17     ` Giulio Benetti
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2021-08-14 13:51 UTC (permalink / raw)
  To: Giulio Benetti; +Cc: Romain Naour, Thomas De Schampheleire, buildroot

Hello Giulio,

On Fri, 13 Aug 2021 23:37:45 +0200
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> The lmbench package exhibits gcc bug 97208 when built for the Microblaze
> architecture with optimization enabled, which causes a build failure.
> 
> As done for other packages in Buildroot work around this gcc bug by
> setting optimization to -O0 if BR2_TOOLCHAIN_HAS_GCC_BUG_97208=y..
> 
> Fixes:
> http://autobuild.buildroot.net/results/ae1/ae1e4d61ed367c6cb64442c60d98882cc7985346/
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>

Are we sure the gcc bug is the same? According to the word-around in
toolchain wrapper, disabling the  -ftree-loop-distribute-patterns is
enough... but not for lmbench ?

What specifically tells us that the lmbench issue is the same as the
one we worked-around with -fnotree-loop-distribute-patterns in other
packages ?

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 3/3] package/lmbench: fix build failure due to gcc bug 97208
  2021-08-14 13:51   ` Thomas Petazzoni
@ 2021-08-14 21:17     ` Giulio Benetti
  0 siblings, 0 replies; 9+ messages in thread
From: Giulio Benetti @ 2021-08-14 21:17 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Romain Naour, Thomas De Schampheleire, buildroot

Hello Thomas,

On 8/14/21 3:51 PM, Thomas Petazzoni wrote:
> Hello Giulio,
> 
> On Fri, 13 Aug 2021 23:37:45 +0200
> Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
> 
>> The lmbench package exhibits gcc bug 97208 when built for the Microblaze
>> architecture with optimization enabled, which causes a build failure.
>>
>> As done for other packages in Buildroot work around this gcc bug by
>> setting optimization to -O0 if BR2_TOOLCHAIN_HAS_GCC_BUG_97208=y..
>>
>> Fixes:
>> http://autobuild.buildroot.net/results/ae1/ae1e4d61ed367c6cb64442c60d98882cc7985346/
>>
>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> 
> Are we sure the gcc bug is the same? According to the word-around in
> toolchain wrapper, disabling the  -ftree-loop-distribute-patterns is
> enough... but not for lmbench ?
> 
> What specifically tells us that the lmbench issue is the same as the
> one we worked-around with -fnotree-loop-distribute-patterns in other
> packages ?

You're right, I've been biased by the fact that they fail on the same 
gcc versions and that's all. I don't know why I've ended up to this 
conclusion honestly.

So, I've filed a new gcc bug into gcc bugzilla[1] and treat it with -O0 
since I've given a try with -fnotree-loop-distribute-patterns with no 
luck. Then I'll send a patch to work around gcc bug 101915 on lmbench.

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101915
-- 
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_97208
  2021-08-13 23:15   ` Giulio Benetti
@ 2021-08-14 22:11     ` Giulio Benetti
  0 siblings, 0 replies; 9+ messages in thread
From: Giulio Benetti @ 2021-08-14 22:11 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, Thomas Petazzoni, Thomas De Schampheleire

Please drop this patch, I've already set it as Rejected in Patchwork.
Sorry for the noise

-- 
Giulio Benetti
Benetti Engineering sas

On 8/14/21 1:15 AM, Giulio Benetti wrote:
> Hi,
> 
>> Il giorno 13 ago 2021, alle ore 23:38, Giulio Benetti <giulio.benetti@benettiengineering.com> ha scritto:
>>
>> lmbench package fails to build for the Microblaze architecture with
>> optimization enabled with gcc = 11.1.0:
> 
> ^^^ ‘gcc <= 11’, not only =
> 
>> http://autobuild.buildroot.net/results/ae1/ae1e4d61ed367c6cb64442c60d98882cc7985346/
>>
>> It's been reported upstream by Romain Naour:
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97208
>>
>> Cc: Roman Naour <romain.naour@gmail.com>
>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> ---
>> toolchain/Config.in | 7 +++++++
>> 1 file changed, 7 insertions(+)
>>
>> diff --git a/toolchain/Config.in b/toolchain/Config.in
>> index 3888eeafe2..1dae0cb2cc 100644
>> --- a/toolchain/Config.in
>> +++ b/toolchain/Config.in
>> @@ -163,6 +163,13 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_93847
>>     bool
>>     default y if BR2_nios2 && !BR2_TOOLCHAIN_GCC_AT_LEAST_9
>>
>> +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97208
>> +# ICE: in extract_insn, at recog.c:2294 on microblaze.
>> +# This bug still exists in gcc = 11.1.0
>> +config BR2_TOOLCHAIN_HAS_GCC_BUG_97208
>> +    bool
>> +    default y if BR2_microblaze
>> +
>> # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99410
>> # Error: branch offset out of range on Nios II. This bug
>> # no longer exists in gcc >= 9.x.
>> -- 
>> 2.25.1
>>
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 

_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 2/3] toolchain/toolchain-wrapper: use Gcc bug 97208 instead of repeating it
  2021-08-13 21:37 ` [Buildroot] [PATCH 2/3] toolchain/toolchain-wrapper: use Gcc bug 97208 instead of repeating it Giulio Benetti
@ 2021-08-14 22:11   ` Giulio Benetti
  0 siblings, 0 replies; 9+ messages in thread
From: Giulio Benetti @ 2021-08-14 22:11 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, Thomas Petazzoni, Thomas De Schampheleire

Please drop this patch, I've already set it as Rejected in Patchwork.
Sorry for the noise

-- 
Giulio Benetti
Benetti Engineering sas

On 8/13/21 11:37 PM, Giulio Benetti wrote:
> Now that we have added Gcc bug 97208 we can use it instead of repeating it.
> So let's substitute bug condition with bug presence. Also note that gcc bug
> 97208 is still present in gcc 11.1.0 so better to make comment more generic
> and keep a detailed description in toolchain/Config.in
> 
> Cc: Roman Naour <romain.naour@gmail.com>
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>   toolchain/toolchain-wrapper.mk | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk
> index 8b551e3a18..c56ec7c054 100644
> --- a/toolchain/toolchain-wrapper.mk
> +++ b/toolchain/toolchain-wrapper.mk
> @@ -33,11 +33,10 @@ TOOLCHAIN_WRAPPER_OPTS += -DBR_NEED_SOURCE_DATE_EPOCH
>   endif
>   endif
>   
> -# Disable -ftree-loop-distribute-patterns on microblaze to
> -# workaround a compiler bug with gcc 10 and -O2, -Os or -O3.
> +# Disable -ftree-loop-distribute-patterns on compiler affected by gcc bug 97208.
>   # https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=5879ab5fafedc8f6f9bfe95a4cf8501b0df90edd
>   # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97208
> -ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_10)$(BR2_microblaze),yy)
> +ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_97208),y)
>   TOOLCHAIN_WRAPPER_OPTS += -fno-tree-loop-distribute-patterns
>   endif
>   
> 

_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

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

end of thread, other threads:[~2021-08-14 22:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-13 21:37 [Buildroot] [PATCH 0/3] Microblaze gcc bug 97208 Giulio Benetti
2021-08-13 21:37 ` [Buildroot] [PATCH 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_97208 Giulio Benetti
2021-08-13 23:15   ` Giulio Benetti
2021-08-14 22:11     ` Giulio Benetti
2021-08-13 21:37 ` [Buildroot] [PATCH 2/3] toolchain/toolchain-wrapper: use Gcc bug 97208 instead of repeating it Giulio Benetti
2021-08-14 22:11   ` Giulio Benetti
2021-08-13 21:37 ` [Buildroot] [PATCH 3/3] package/lmbench: fix build failure due to gcc bug 97208 Giulio Benetti
2021-08-14 13:51   ` Thomas Petazzoni
2021-08-14 21:17     ` Giulio Benetti

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.