diff mbox series

[3/3] package/lmbench: fix build failure due to gcc bug 97208

Message ID 20210813213745.1555522-4-giulio.benetti@benettiengineering.com
State Rejected
Headers show
Series Microblaze gcc bug 97208 | expand

Commit Message

Giulio Benetti Aug. 13, 2021, 9:37 p.m. UTC
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(+)

Comments

Thomas Petazzoni Aug. 14, 2021, 1:51 p.m. UTC | #1
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
Giulio Benetti Aug. 14, 2021, 9:17 p.m. UTC | #2
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
diff mbox series

Patch

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