Skip to contentSkip to conversation

package/syslogd: workaround a compiler bug with CS powerpc 2012.03

PATCH New Romain Naour 3 participants 5 messages Feb 14, 2016 – Feb 20, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/syslogd: workaround a compiler bug with CS powerpc 2012.03

The O3 optimization triggers a compiler bug with this toolchain, change it with 02.

Fixes:
http://autobuild.buildroot.net/results/2fb/2fb94ecfdc32761a09da35e6fcbdd512847ec911

---
 package/sysklogd/sysklogd.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/sysklogd/sysklogd.mk +8 -0
index de2edf4..9e315bc 100644
@@ -14,6 +14,14 @@ ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 SYSKLOGD_DEPENDENCIES = busybox
 endif
 
+# CS PowerPC 2012.03 triggers compiler bug.
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC_E500V2),y)
+define SYSKLOGD_WORKAROUND_COMPILER_BUG
+	$(SED) 's/-O3/-O2/' $(@D)/Makefile
+endef
+SYSKLOGD_POST_PATCH_HOOKS = SYSKLOGD_WORKAROUND_COMPILER_BUG
+endif
+
 define SYSKLOGD_BUILD_CMDS
 	$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
 endef
Signature · 1 line
2.4.3
#1 lore raw

PATCH 1/1 package/syslogd: workaround a compiler bug with CS powerpc 2012.03

Dear Romain Naour,

Quoted 10 lines · Romain Naour

The O3 optimization triggers a compiler bug with this toolchain, change it with 02.

Fixes:
http://autobuild.buildroot.net/results/2fb/2fb94ecfdc32761a09da35e6fcbdd512847ec911

---
 package/sysklogd/sysklogd.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

I'm not a big fan of such quirks, but sometimes we don't really have the choice. So: applied!

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 package/syslogd: workaround a compiler bug with CS powerpc 2012.03

In reply to Romain Naour
Quoted 18 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Romain" == Romain Naour <[email protected]> writes:

The O3 optimization triggers a compiler bug with this toolchain, change it with 02.

Fixes:
http://autobuild.buildroot.net/results/2fb/2fb94ecfdc32761a09da35e6fcbdd512847ec911

---
 package/sysklogd/sysklogd.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/sysklogd/sysklogd.mk +0 -0
index de2edf4..9e315bc 100644

package/sysklogd/sysklogd.mk ifeq ($(BR2_PACKAGE_BUSYBOX),y) · line 20

Quoted 7 lines
package/sysklogd/sysklogd.mk +4 -0
@@ -14,6 +14,14 @@ ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 SYSKLOGD_DEPENDENCIES = busybox
 endif
 
+# CS PowerPC 2012.03 triggers compiler bug.
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC_E500V2),y)
+define SYSKLOGD_WORKAROUND_COMPILER_BUG
+	$(SED) 's/-O3/-O2/' $(@D)/Makefile

Does this mean that sysklogd isn't using our TARGET_CFLAGS (where we most likely pass -Os)?

Why don't we fix that instead?

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/1 package/syslogd: workaround a compiler bug with CS powerpc 2012.03

Hi Peter,

Le 16/02/2016 23:11, Peter Korsgaard a ?crit :

Quoted 20 lines
Quoted 19 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Romain" == Romain Naour <[email protected]> writes:

The O3 optimization triggers a compiler bug with this toolchain, change it with 02.

Fixes:
http://autobuild.buildroot.net/results/2fb/2fb94ecfdc32761a09da35e6fcbdd512847ec911

---
 package/sysklogd/sysklogd.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/sysklogd/sysklogd.mk +0 -0
index de2edf4..9e315bc 100644
@@ -14,6 +14,14 @@ ifeq ($(BR2_PACKAGE_BUSYBOX),y)
 SYSKLOGD_DEPENDENCIES = busybox
 endif
Quoted 7 lines

package/sysklogd/sysklogd.mk ifeq ($(BR2_PACKAGE_BUSYBOX),y) · line 20

Quoted 4 lines
package/sysklogd/sysklogd.mk +4 -0
+# CS PowerPC 2012.03 triggers compiler bug.
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC_E500V2),y)
+define SYSKLOGD_WORKAROUND_COMPILER_BUG
+	$(SED) 's/-O3/-O2/' $(@D)/Makefile

Does this mean that sysklogd isn't using our TARGET_CFLAGS (where we most likely pass -Os)?

-O3 is added by SKFLAGS variable which is used as CFLAGS. TARGET_CFLAGS is not taken into account :-/

Quoted 2 lines

Why don't we fix that instead?

We could try to replace SKFLAGS by CFLAGS...

Best regards,
Romain

Quoted 2 lines
#4 lore raw

PATCH 1/1 package/syslogd: workaround a compiler bug with CS powerpc 2012.03

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Romain" == Romain Naour <[email protected]> writes:

Hi,

Quoted 9 lines
Quoted 2 lines

Does this mean that sysklogd isn't using our TARGET_CFLAGS (where we most likely pass -Os)?

-O3 is added by SKFLAGS variable which is used as CFLAGS. TARGET_CFLAGS is not taken into account :-/

Quoted 2 lines

Why don't we fix that instead?

We could try to replace SKFLAGS by CFLAGS...

Yes, I believe simply passing SKFLAGS="$(TARGET_CFLAGS)" would work.

Can you give it a try?

Signature · 2 lines
Venlig hilsen,
Peter Korsgaard