All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/3] Riscv32 gcc bug 93532 workaround
@ 2020-02-03 16:59 Giulio Benetti
  2020-02-03 16:59 ` [Buildroot] [PATCH 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93532 Giulio Benetti
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Giulio Benetti @ 2020-02-03 16:59 UTC (permalink / raw)
  To: buildroot

Following Microblaze experience on gcc ICE and hangs let's treat the same
way Riscv32 gcc bugs. So let's introduce gcc bug already reported and
work around failing packages using -O0 optimization flash since no other
workarounds worked(disable -g, trying -O1).

Giulio Benetti (3):
  toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93532
  package/bullet: fix build failure due to gcc bug 93532
  package/lmbench: fix build failure due to gcc bug 93532

 package/bullet/bullet.mk   | 2 +-
 package/lmbench/lmbench.mk | 4 ++++
 toolchain/Config.in        | 8 ++++++++
 3 files changed, 13 insertions(+), 1 deletion(-)

-- 
2.20.1

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

* [Buildroot] [PATCH 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93532
  2020-02-03 16:59 [Buildroot] [PATCH 0/3] Riscv32 gcc bug 93532 workaround Giulio Benetti
@ 2020-02-03 16:59 ` Giulio Benetti
  2020-02-03 16:59 ` [Buildroot] [PATCH 2/3] package/bullet: fix build failure due to gcc bug 93532 Giulio Benetti
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Giulio Benetti @ 2020-02-03 16:59 UTC (permalink / raw)
  To: buildroot

GCC hangs while building bullet for the Riscv32 Arch:
http://autobuild.buildroot.net/results/9a4/9a405ec6fabfa306c14a671a5e09359ac623c25b/

Reported on gcc bugzilla:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93532

This bug manifests up to version 8.x

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 toolchain/Config.in | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/toolchain/Config.in b/toolchain/Config.in
index 858121d2c5..1be898731a 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -159,6 +159,14 @@ config BR2_TOOLCHAIN_HAS_GCC_BUG_90620
 	bool
 	default y if BR2_microblaze
 
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93532
+# An infinite loop exists on riscv32 gcc. This doesn't manifest on gcc 9.x
+# http://autobuild.buildroot.net/results/9a4/9a405ec6fabfa306c14a671a5e09359ac623c25b/
+config BR2_TOOLCHAIN_HAS_GCC_BUG_93532
+	bool
+	default y if BR2_RISCV_32
+	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_9
+
 config BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	bool
 
-- 
2.20.1

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

* [Buildroot] [PATCH 2/3] package/bullet: fix build failure due to gcc bug 93532
  2020-02-03 16:59 [Buildroot] [PATCH 0/3] Riscv32 gcc bug 93532 workaround Giulio Benetti
  2020-02-03 16:59 ` [Buildroot] [PATCH 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93532 Giulio Benetti
@ 2020-02-03 16:59 ` Giulio Benetti
  2020-02-03 16:59 ` [Buildroot] [PATCH 3/3] package/lmbench: " Giulio Benetti
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Giulio Benetti @ 2020-02-03 16:59 UTC (permalink / raw)
  To: buildroot

The bullet package exhibits gcc bug 93532 when built for the Riscv32
architecture with optimization enabled, which causes a build to hang.

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

Fixes:
http://autobuild.buildroot.net/results/9a4/9a405ec6fabfa306c14a671a5e09359ac623c25b/

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/bullet/bullet.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/bullet/bullet.mk b/package/bullet/bullet.mk
index b25fc5d219..e13dbba0c6 100644
--- a/package/bullet/bullet.mk
+++ b/package/bullet/bullet.mk
@@ -25,7 +25,7 @@ endif
 
 BULLET_CXXFLAGS = $(TARGET_CXXFLAGS)
 
-ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93532),y)
 BULLET_CXXFLAGS += -O0
 endif
 
-- 
2.20.1

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

* [Buildroot] [PATCH 3/3] package/lmbench: fix build failure due to gcc bug 93532
  2020-02-03 16:59 [Buildroot] [PATCH 0/3] Riscv32 gcc bug 93532 workaround Giulio Benetti
  2020-02-03 16:59 ` [Buildroot] [PATCH 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93532 Giulio Benetti
  2020-02-03 16:59 ` [Buildroot] [PATCH 2/3] package/bullet: fix build failure due to gcc bug 93532 Giulio Benetti
@ 2020-02-03 16:59 ` Giulio Benetti
  2020-02-08 16:13 ` [Buildroot] [PATCH 0/3] Riscv32 gcc bug 93532 workaround Giulio Benetti
  2021-05-26 18:43 ` Arnout Vandecappelle
  4 siblings, 0 replies; 8+ messages in thread
From: Giulio Benetti @ 2020-02-03 16:59 UTC (permalink / raw)
  To: buildroot

The lmbench package exhibits gcc bug 93532 when built for the Riscv32
architecture with optimization enabled, which causes a build to hang.

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

Fixes:
http://autobuild.buildroot.net/results/d47/d47e46889d7bcc5864c738cb948afc168327b612/

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..09299a0c17 100644
--- a/package/lmbench/lmbench.mk
+++ b/package/lmbench/lmbench.mk
@@ -28,6 +28,10 @@ define LMBENCH_CONFIGURE_CMDS
 	touch $@
 endef
 
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_93532),y)
+LMBENCH_CFLAGS += -O0
+endif
+
 # Note: there is a second stage 'make' invocation from the 'scripts/build'
 # script. So the variables override below don't take direct effect in
 # src/Makefile.
-- 
2.20.1

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

* [Buildroot] [PATCH 0/3] Riscv32 gcc bug 93532 workaround
  2020-02-03 16:59 [Buildroot] [PATCH 0/3] Riscv32 gcc bug 93532 workaround Giulio Benetti
                   ` (2 preceding siblings ...)
  2020-02-03 16:59 ` [Buildroot] [PATCH 3/3] package/lmbench: " Giulio Benetti
@ 2020-02-08 16:13 ` Giulio Benetti
  2020-02-08 16:21   ` Giulio Benetti
  2021-05-26 18:43 ` Arnout Vandecappelle
  4 siblings, 1 reply; 8+ messages in thread
From: Giulio Benetti @ 2020-02-08 16:13 UTC (permalink / raw)
  To: buildroot

Hi All,

this bug is shown only if riscv32 gcc is built with 
-fstack-protector-strong [1], so I don't know if it's better to disable 
SPP when building gcc for riscv32 version 8.x, or to keep -O0 workaround 
that is the same as Microblaze.

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93532

Best regards
-- 
Giulio Benetti
Benetti Engineering sas

On 2/3/20 5:59 PM, Giulio Benetti wrote:
> Following Microblaze experience on gcc ICE and hangs let's treat the same
> way Riscv32 gcc bugs. So let's introduce gcc bug already reported and
> work around failing packages using -O0 optimization flash since no other
> workarounds worked(disable -g, trying -O1).
> 
> Giulio Benetti (3):
>    toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93532
>    package/bullet: fix build failure due to gcc bug 93532
>    package/lmbench: fix build failure due to gcc bug 93532
> 
>   package/bullet/bullet.mk   | 2 +-
>   package/lmbench/lmbench.mk | 4 ++++
>   toolchain/Config.in        | 8 ++++++++
>   3 files changed, 13 insertions(+), 1 deletion(-)
> 

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

* [Buildroot] [PATCH 0/3] Riscv32 gcc bug 93532 workaround
  2020-02-08 16:13 ` [Buildroot] [PATCH 0/3] Riscv32 gcc bug 93532 workaround Giulio Benetti
@ 2020-02-08 16:21   ` Giulio Benetti
  0 siblings, 0 replies; 8+ messages in thread
From: Giulio Benetti @ 2020-02-08 16:21 UTC (permalink / raw)
  To: buildroot

Ah, forgot to mention that they provided a patch that solves the 
problem, so maybe I should provide it as a patch for gcc/8.3.0, right?

On 2/8/20 5:13 PM, Giulio Benetti wrote:
> Hi All,
> 
> this bug is shown only if riscv32 gcc is built with
> -fstack-protector-strong [1], so I don't know if it's better to disable
> SPP when building gcc for riscv32 version 8.x, or to keep -O0 workaround
> that is the same as Microblaze.
> 
> [1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93532
> 
> Best regards
> 

-- 
Giulio Benetti
Benetti Engineering sas

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

* [Buildroot] [PATCH 0/3] Riscv32 gcc bug 93532 workaround
  2020-02-03 16:59 [Buildroot] [PATCH 0/3] Riscv32 gcc bug 93532 workaround Giulio Benetti
                   ` (3 preceding siblings ...)
  2020-02-08 16:13 ` [Buildroot] [PATCH 0/3] Riscv32 gcc bug 93532 workaround Giulio Benetti
@ 2021-05-26 18:43 ` Arnout Vandecappelle
  2021-05-26 20:06   ` Giulio Benetti
  4 siblings, 1 reply; 8+ messages in thread
From: Arnout Vandecappelle @ 2021-05-26 18:43 UTC (permalink / raw)
  To: buildroot

 Hi Giulio,

On 03/02/2020 17:59, Giulio Benetti wrote:
> Following Microblaze experience on gcc ICE and hangs let's treat the same
> way Riscv32 gcc bugs. So let's introduce gcc bug already reported and
> work around failing packages using -O0 optimization flash since no other
> workarounds worked(disable -g, trying -O1).
> 
> Giulio Benetti (3):
>   toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93532
>   package/bullet: fix build failure due to gcc bug 93532
>   package/lmbench: fix build failure due to gcc bug 93532

 This series has languished on patchwork for a long time. Since then, we've
updated our autobuilders to GCC 9 for RISCV32 so we no longer see the issue.

 Since RISCV is still relatively new, we can kind of assume people will use a
recent toolchain as well.

 Therefore, I propose to drop this series rather than introducing complexity
that benefits nobody.

 I've marked the series as Rejected in patchwork. Feel free to reopen if there's
a reason to.

 Regards,
 Arnout

> 
>  package/bullet/bullet.mk   | 2 +-
>  package/lmbench/lmbench.mk | 4 ++++
>  toolchain/Config.in        | 8 ++++++++
>  3 files changed, 13 insertions(+), 1 deletion(-)
> 

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

* [Buildroot] [PATCH 0/3] Riscv32 gcc bug 93532 workaround
  2021-05-26 18:43 ` Arnout Vandecappelle
@ 2021-05-26 20:06   ` Giulio Benetti
  0 siblings, 0 replies; 8+ messages in thread
From: Giulio Benetti @ 2021-05-26 20:06 UTC (permalink / raw)
  To: buildroot

Hi Arnout,

On 5/26/21 8:43 PM, Arnout Vandecappelle wrote:
>   Hi Giulio,
> 
> On 03/02/2020 17:59, Giulio Benetti wrote:
>> Following Microblaze experience on gcc ICE and hangs let's treat the same
>> way Riscv32 gcc bugs. So let's introduce gcc bug already reported and
>> work around failing packages using -O0 optimization flash since no other
>> workarounds worked(disable -g, trying -O1).
>>
>> Giulio Benetti (3):
>>    toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93532
>>    package/bullet: fix build failure due to gcc bug 93532
>>    package/lmbench: fix build failure due to gcc bug 93532
> 
>   This series has languished on patchwork for a long time. Since then, we've
> updated our autobuilders to GCC 9 for RISCV32 so we no longer see the issue.
> 
>   Since RISCV is still relatively new, we can kind of assume people will use a
> recent toolchain as well.
> 
>   Therefore, I propose to drop this series rather than introducing complexity
> that benefits nobody.
> 
>   I've marked the series as Rejected in patchwork. Feel free to reopen if there's
> a reason to.

I totally agree, those bugs never showed up anymore since I've submitted 
those patches, so it's ok for me.

Thank you

Best regards
-- 
Giulio Benetti
Benetti Engineering sas

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

end of thread, other threads:[~2021-05-26 20:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-03 16:59 [Buildroot] [PATCH 0/3] Riscv32 gcc bug 93532 workaround Giulio Benetti
2020-02-03 16:59 ` [Buildroot] [PATCH 1/3] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93532 Giulio Benetti
2020-02-03 16:59 ` [Buildroot] [PATCH 2/3] package/bullet: fix build failure due to gcc bug 93532 Giulio Benetti
2020-02-03 16:59 ` [Buildroot] [PATCH 3/3] package/lmbench: " Giulio Benetti
2020-02-08 16:13 ` [Buildroot] [PATCH 0/3] Riscv32 gcc bug 93532 workaround Giulio Benetti
2020-02-08 16:21   ` Giulio Benetti
2021-05-26 18:43 ` Arnout Vandecappelle
2021-05-26 20:06   ` 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.