diff mbox series

[v2,02/12] package/atop: fix BUG_85180 build timeout

Message ID 20190521133932.81841-3-giulio.benetti@micronovasrl.com
State Accepted
Headers show
Series Fix GCC BUG 85180 per-package | expand

Commit Message

Giulio Benetti May 21, 2019, 1:39 p.m. UTC
With Microblaze Gcc version < 8.x build hangs on compiling last files
before linking. This is due to bug 85180:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85180
Bug shows up building atop with optimization but not when building with
-O0.

If BR2_TOOLCHAIN_HAS_GCC_BUG_85180=y force using -O0 passing it to
CFLAGS.

Fixes:
http://autobuild.buildroot.net/results/94a/94aa00f776b8a3491ac0b3212c95f5e666c5a29a/

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
---
V1 -> V2:
* use -O0 instead of -g1

 package/atop/atop.mk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Thomas Petazzoni May 22, 2019, 9:07 p.m. UTC | #1
Hello Giulio,

On Tue, 21 May 2019 15:39:22 +0200
Giulio Benetti <giulio.benetti@micronovasrl.com> wrote:

> With Microblaze Gcc version < 8.x build hangs on compiling last files
> before linking. This is due to bug 85180:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85180
> Bug shows up building atop with optimization but not when building with
> -O0.
> 
> If BR2_TOOLCHAIN_HAS_GCC_BUG_85180=y force using -O0 passing it to
> CFLAGS.
> 
> Fixes:
> http://autobuild.buildroot.net/results/94a/94aa00f776b8a3491ac0b3212c95f5e666c5a29a/
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>

I have applied to master after reworking the commit title and commit
log, and also adjusting the code a bit (see below).

> diff --git a/package/atop/atop.mk b/package/atop/atop.mk
> index aaf02908c4..afce71f6cb 100644
> --- a/package/atop/atop.mk
> +++ b/package/atop/atop.mk
> @@ -10,8 +10,13 @@ ATOP_LICENSE = GPL-2.0+
>  ATOP_LICENSE_FILES = COPYING
>  ATOP_DEPENDENCIES = ncurses zlib
>  
> +ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
> +ATOP_CFLAGS += $(TARGET_CFLAGS) -O0
> +endif

I believe:

ATOP_CFLAGS = $(TARGET_CFLAGS)

ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
ATOP_CFLAGS += -O0
endif

is more correct, otherwise you pass an empty CFLAGS when
BR2_TOOLCHAIN_HAS_GCC_BUG_85180 is false.


> +
>  define ATOP_BUILD_CMDS
> -	$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
> +	$(MAKE) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(ATOP_CFLAGS)" \
> +	-C $(@D)

The second line is typically indented with one more tab.

As I said, I've applied to master after fixing those issues.

Thanks!

Thomas
Giulio Benetti May 22, 2019, 9:27 p.m. UTC | #2
Hello,

Il 22/05/2019 23:07, Thomas Petazzoni ha scritto:
> Hello Giulio,
> 
> On Tue, 21 May 2019 15:39:22 +0200
> Giulio Benetti <giulio.benetti@micronovasrl.com> wrote:
> 
>> With Microblaze Gcc version < 8.x build hangs on compiling last files
>> before linking. This is due to bug 85180:
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85180
>> Bug shows up building atop with optimization but not when building with
>> -O0.
>>
>> If BR2_TOOLCHAIN_HAS_GCC_BUG_85180=y force using -O0 passing it to
>> CFLAGS.
>>
>> Fixes:
>> http://autobuild.buildroot.net/results/94a/94aa00f776b8a3491ac0b3212c95f5e666c5a29a/
>>
>> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
> 
> I have applied to master after reworking the commit title and commit
> log,

Again... Need to improve commit logs.

> and also adjusting the code a bit (see below).
> 
>> diff --git a/package/atop/atop.mk b/package/atop/atop.mk
>> index aaf02908c4..afce71f6cb 100644
>> --- a/package/atop/atop.mk
>> +++ b/package/atop/atop.mk
>> @@ -10,8 +10,13 @@ ATOP_LICENSE = GPL-2.0+
>>   ATOP_LICENSE_FILES = COPYING
>>   ATOP_DEPENDENCIES = ncurses zlib
>>   
>> +ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
>> +ATOP_CFLAGS += $(TARGET_CFLAGS) -O0
>> +endif
> 
> I believe:
> 
> ATOP_CFLAGS = $(TARGET_CFLAGS)
> 
> ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
> ATOP_CFLAGS += -O0
> endif
> 
> is more correct, otherwise you pass an empty CFLAGS when
> BR2_TOOLCHAIN_HAS_GCC_BUG_85180 is false.

Yes totally right. Then I need to modify other patches for 
$(generic-package) packages as well as their commit logs at this point.

> 
>> +
>>   define ATOP_BUILD_CMDS
>> -	$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
>> +	$(MAKE) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(ATOP_CFLAGS)" \
>> +	-C $(@D)
> 
> The second line is typically indented with one more tab.

Ok. I've never noticed it. Thanks for pointing.

Best regards!
Peter Korsgaard June 6, 2019, 12:45 p.m. UTC | #3
>>>>> "Giulio" == Giulio Benetti <giulio.benetti@micronovasrl.com> writes:

 > With Microblaze Gcc version < 8.x build hangs on compiling last files
 > before linking. This is due to bug 85180:
 > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85180
 > Bug shows up building atop with optimization but not when building with
 > -O0.

 > If BR2_TOOLCHAIN_HAS_GCC_BUG_85180=y force using -O0 passing it to
 > CFLAGS.

 > Fixes:
 > http://autobuild.buildroot.net/results/94a/94aa00f776b8a3491ac0b3212c95f5e666c5a29a/

 > Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
 > ---
 > V1 -> V2:
 > * use -O0 instead of -g1

Committed to 2019.02.x, thanks.
diff mbox series

Patch

diff --git a/package/atop/atop.mk b/package/atop/atop.mk
index aaf02908c4..afce71f6cb 100644
--- a/package/atop/atop.mk
+++ b/package/atop/atop.mk
@@ -10,8 +10,13 @@  ATOP_LICENSE = GPL-2.0+
 ATOP_LICENSE_FILES = COPYING
 ATOP_DEPENDENCIES = ncurses zlib
 
+ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
+ATOP_CFLAGS += $(TARGET_CFLAGS) -O0
+endif
+
 define ATOP_BUILD_CMDS
-	$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
+	$(MAKE) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(ATOP_CFLAGS)" \
+	-C $(@D)
 endef
 
 define ATOP_INSTALL_TARGET_CMDS