All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93847
@ 2020-02-20 15:40 Giulio Benetti
  2020-02-20 15:40 ` [Buildroot] [PATCH 2/2] package/git: fix build failure due to gcc bug 93847 Giulio Benetti
  2020-02-26 21:15 ` [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93847 Thomas Petazzoni
  0 siblings, 2 replies; 9+ messages in thread
From: Giulio Benetti @ 2020-02-20 15:40 UTC (permalink / raw)
  To: buildroot

git package fails to build for the Nios2 architecture with optimization
enabled with gcc < 9.x:
http://autobuild.buildroot.net/results/924/92484c49b655e4aa78ca52f124c6d8f605b9d06b/

It's been reported upstream:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93847

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 973c03254f..b8c2f79a36 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=93847
+# ICE: compiler error: Segmentation fault on Nios II. This bug
+# no longer exists in gcc 9.x.
+config BR2_TOOLCHAIN_HAS_GCC_BUG_93847
+	bool
+	default y if BR2_nios2
+	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_9
+
 config BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	bool
 
-- 
2.20.1

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

* [Buildroot] [PATCH 2/2] package/git: fix build failure due to gcc bug 93847
  2020-02-20 15:40 [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93847 Giulio Benetti
@ 2020-02-20 15:40 ` Giulio Benetti
  2020-02-26 21:15   ` Thomas Petazzoni
  2020-02-26 22:22   ` Peter Korsgaard
  2020-02-26 21:15 ` [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93847 Thomas Petazzoni
  1 sibling, 2 replies; 9+ messages in thread
From: Giulio Benetti @ 2020-02-20 15:40 UTC (permalink / raw)
  To: buildroot

The git package exhibits gcc bug 93847 when built for the Nios2
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_93847=y.

Fixes:
http://autobuild.buildroot.net/results/e22/e225e62ea2d48660df4110790664f0c3306c1ea9/

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

diff --git a/package/git/git.mk b/package/git/git.mk
index a5c8669fc9..f32a2f8eb9 100644
--- a/package/git/git.mk
+++ b/package/git/git.mk
@@ -67,7 +67,7 @@ endif
 
 GIT_CFLAGS = $(TARGET_CFLAGS)
 
-ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),y)
 GIT_CFLAGS += -O0
 endif
 
-- 
2.20.1

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

* [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93847
  2020-02-20 15:40 [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93847 Giulio Benetti
  2020-02-20 15:40 ` [Buildroot] [PATCH 2/2] package/git: fix build failure due to gcc bug 93847 Giulio Benetti
@ 2020-02-26 21:15 ` Thomas Petazzoni
  1 sibling, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2020-02-26 21:15 UTC (permalink / raw)
  To: buildroot

On Thu, 20 Feb 2020 16:40:03 +0100
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> git package fails to build for the Nios2 architecture with optimization
> enabled with gcc < 9.x:
> http://autobuild.buildroot.net/results/924/92484c49b655e4aa78ca52f124c6d8f605b9d06b/
> 
> It's been reported upstream:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93847
> 
> 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 973c03254f..b8c2f79a36 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=93847
> +# ICE: compiler error: Segmentation fault on Nios II. This bug
> +# no longer exists in gcc 9.x.
> +config BR2_TOOLCHAIN_HAS_GCC_BUG_93847
> +	bool
> +	default y if BR2_nios2
> +	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_9

	default y if BR2_nios2 && !BR2_TOOLCHAIN_GCC_AT_LEAST_9

felt a bit simpler/easier to read, so I changed it like this and
applied to master. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH 2/2] package/git: fix build failure due to gcc bug 93847
  2020-02-20 15:40 ` [Buildroot] [PATCH 2/2] package/git: fix build failure due to gcc bug 93847 Giulio Benetti
@ 2020-02-26 21:15   ` Thomas Petazzoni
  2020-02-26 22:22   ` Peter Korsgaard
  1 sibling, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2020-02-26 21:15 UTC (permalink / raw)
  To: buildroot

On Thu, 20 Feb 2020 16:40:04 +0100
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> The git package exhibits gcc bug 93847 when built for the Nios2
> 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_93847=y.
> 
> Fixes:
> http://autobuild.buildroot.net/results/e22/e225e62ea2d48660df4110790664f0c3306c1ea9/
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>  package/git/git.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH 2/2] package/git: fix build failure due to gcc bug 93847
  2020-02-20 15:40 ` [Buildroot] [PATCH 2/2] package/git: fix build failure due to gcc bug 93847 Giulio Benetti
  2020-02-26 21:15   ` Thomas Petazzoni
@ 2020-02-26 22:22   ` Peter Korsgaard
  2020-02-27  8:17     ` Thomas Petazzoni
  2020-02-27 21:15     ` Yann E. MORIN
  1 sibling, 2 replies; 9+ messages in thread
From: Peter Korsgaard @ 2020-02-26 22:22 UTC (permalink / raw)
  To: buildroot

>>>>> "Giulio" == Giulio Benetti <giulio.benetti@benettiengineering.com> writes:

 > The git package exhibits gcc bug 93847 when built for the Nios2
 > 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_93847=y.

 > Fixes:
 > http://autobuild.buildroot.net/results/e22/e225e62ea2d48660df4110790664f0c3306c1ea9/

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

 > diff --git a/package/git/git.mk b/package/git/git.mk
 > index a5c8669fc9..f32a2f8eb9 100644
 > --- a/package/git/git.mk
 > +++ b/package/git/git.mk
 > @@ -67,7 +67,7 @@ endif
 
 >  GIT_CFLAGS = $(TARGET_CFLAGS)
 
 > -ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
 > +ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),y)

This fails for a (hypothetical) toolchain affected by both issues,
perhaps something like this would be better?

ifneq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),)

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH 2/2] package/git: fix build failure due to gcc bug 93847
  2020-02-26 22:22   ` Peter Korsgaard
@ 2020-02-27  8:17     ` Thomas Petazzoni
  2020-02-27 11:20       ` Giulio Benetti
  2020-02-27 21:15     ` Yann E. MORIN
  1 sibling, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2020-02-27  8:17 UTC (permalink / raw)
  To: buildroot

Hello Peter,

On Wed, 26 Feb 2020 23:22:08 +0100
Peter Korsgaard <peter@korsgaard.com> wrote:

>  > -ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
>  > +ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),y)  
> 
> This fails for a (hypothetical) toolchain affected by both issues,
> perhaps something like this would be better?
> 
> ifneq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),)

True in the general case. But BR2_TOOLCHAIN_HAS_GCC_BUG_85180 only
applies to Microblaze, and BR2_TOOLCHAIN_HAS_GCC_BUG_93847 to NIOS2. So
practically speaking, they are mutually exclusive options, so the case
where both are enabled at the same time is impossible.

But I agree that in the general case what you showed would be
preferable.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH 2/2] package/git: fix build failure due to gcc bug 93847
  2020-02-27  8:17     ` Thomas Petazzoni
@ 2020-02-27 11:20       ` Giulio Benetti
  0 siblings, 0 replies; 9+ messages in thread
From: Giulio Benetti @ 2020-02-27 11:20 UTC (permalink / raw)
  To: buildroot

Hi All,

On 2/27/20 9:17 AM, Thomas Petazzoni wrote:
> Hello Peter,
> 
> On Wed, 26 Feb 2020 23:22:08 +0100
> Peter Korsgaard <peter@korsgaard.com> wrote:
> 
>>   > -ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
>>   > +ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),y)
>>
>> This fails for a (hypothetical) toolchain affected by both issues,
>> perhaps something like this would be better?
>>
>> ifneq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),)
> 
> True in the general case. But BR2_TOOLCHAIN_HAS_GCC_BUG_85180 only
> applies to Microblaze, and BR2_TOOLCHAIN_HAS_GCC_BUG_93847 to NIOS2. So
> practically speaking, they are mutually exclusive options, so the case
> where both are enabled at the same time is impossible.
> 
> But I agree that in the general case what you showed would be
> preferable.

I've just sent a patch for this:
https://patchwork.ozlabs.org/patch/1245735/

even if not harmful, it's wrong.

Best regards
-- 
Giulio Benetti
Benetti Engineering sas

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

* [Buildroot] [PATCH 2/2] package/git: fix build failure due to gcc bug 93847
  2020-02-26 22:22   ` Peter Korsgaard
  2020-02-27  8:17     ` Thomas Petazzoni
@ 2020-02-27 21:15     ` Yann E. MORIN
  2020-02-27 21:42       ` Peter Korsgaard
  1 sibling, 1 reply; 9+ messages in thread
From: Yann E. MORIN @ 2020-02-27 21:15 UTC (permalink / raw)
  To: buildroot

Peter, All,

On 2020-02-26 23:22 +0100, Peter Korsgaard spake thusly:
> >>>>> "Giulio" == Giulio Benetti <giulio.benetti@benettiengineering.com> writes:
> 
>  > The git package exhibits gcc bug 93847 when built for the Nios2
>  > 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_93847=y.
> 
>  > Fixes:
>  > http://autobuild.buildroot.net/results/e22/e225e62ea2d48660df4110790664f0c3306c1ea9/
> 
>  > Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>  > ---
>  >  package/git/git.mk | 2 +-
>  >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
>  > diff --git a/package/git/git.mk b/package/git/git.mk
>  > index a5c8669fc9..f32a2f8eb9 100644
>  > --- a/package/git/git.mk
>  > +++ b/package/git/git.mk
>  > @@ -67,7 +67,7 @@ endif
>  
>  >  GIT_CFLAGS = $(TARGET_CFLAGS)
>  
>  > -ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
>  > +ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),y)
> 
> This fails for a (hypothetical) toolchain affected by both issues,
> perhaps something like this would be better?
> 
> ifneq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),)

Or we can keep positive logic and use the available make utilities:

    ifeq ($(or $(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847)),y)

Regards,
Yann E. MORIN.

> -- 
> Bye, Peter Korsgaard
> _______________________________________________
> 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] 9+ messages in thread

* [Buildroot] [PATCH 2/2] package/git: fix build failure due to gcc bug 93847
  2020-02-27 21:15     ` Yann E. MORIN
@ 2020-02-27 21:42       ` Peter Korsgaard
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Korsgaard @ 2020-02-27 21:42 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

Hi,

 >> This fails for a (hypothetical) toolchain affected by both issues,
 >> perhaps something like this would be better?
 >> 
 >> ifneq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180)$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847),)

 > Or we can keep positive logic and use the available make utilities:

 >     ifeq ($(or $(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),$(BR2_TOOLCHAIN_HAS_GCC_BUG_93847)),y)

We could, but I already applied the change and we use similar logic in a
number of places:

package/armbian-firmware/armbian-firmware.mk:ifneq ($(ARMBIAN_FIRMWARE_FILES)$(ARMBIAN_FIRMWARE_DIRS),)
package/avahi/avahi.mk:ifneq ($(BR2_PACKAGE_AVAHI_DAEMON)$(BR2_PACKAGE_AVAHI_AUTOIPD),)
package/freerdp/freerdp.mk:ifneq ($(BR2_PACKAGE_FREERDP_CLIENT_X11)$(BR2_PACKAGE_FREERDP_CLIENT_WL),)

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2020-02-27 21:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-20 15:40 [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93847 Giulio Benetti
2020-02-20 15:40 ` [Buildroot] [PATCH 2/2] package/git: fix build failure due to gcc bug 93847 Giulio Benetti
2020-02-26 21:15   ` Thomas Petazzoni
2020-02-26 22:22   ` Peter Korsgaard
2020-02-27  8:17     ` Thomas Petazzoni
2020-02-27 11:20       ` Giulio Benetti
2020-02-27 21:15     ` Yann E. MORIN
2020-02-27 21:42       ` Peter Korsgaard
2020-02-26 21:15 ` [Buildroot] [PATCH 1/2] toolchain: introduce BR2_TOOLCHAIN_HAS_GCC_BUG_93847 Thomas Petazzoni

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.