Skip to contentSkip to conversation

toolchain-wrapper: do not use deprecated -mfused-madd

PATCH New Waldemar Brodkorb 3 participants 7 messages Aug 11, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toolchain-wrapper: do not use deprecated -mfused-madd

GCC deprecated -mfused-madd, -ffp-contract=off should be used for Xburst workaround.
uClibc compilations will fail, because a gcc warning is emitted while checking for TLS support in the compiler.

---
 toolchain/toolchain-wrapper.c  | 4 ++--
 toolchain/toolchain-wrapper.mk | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
toolchain/toolchain-wrapper.c +2 -2
index dd77c11..44cdcf3 100644
@@ -69,8 +69,8 @@ static char *predef_args[] = {
 #ifdef BR_OMIT_LOCK_PREFIX
 	"-Wa,-momit-lock-prefix=yes",
 #endif
-#ifdef BR_NO_FUSED_MADD
-	"-mno-fused-madd",
+#ifdef BR_FP_CONTRACT_OFF
+	"-ffp-contract=off",
 #endif
 #ifdef BR_BINFMT_FLAT
 	"-Wl,-elf2flt",
toolchain/toolchain-wrapper.mk +2 -1
index 7f72a0c..ecf67a4 100644
@@ -27,8 +27,9 @@ TOOLCHAIN_WRAPPER_ARGS += -DBR_OMIT_LOCK_PREFIX
 endif
 
 # Avoid FPU bug on XBurst CPUs
+# -mfused-madd is deprecated, use -ffp-contract instead
 ifeq ($(BR2_mips_xburst),y)
-TOOLCHAIN_WRAPPER_ARGS += -DBR_NO_FUSED_MADD
+TOOLCHAIN_WRAPPER_ARGS += -DBR_FP_CONTRACT_OFF
 endif
 
 ifeq ($(BR2_CCACHE_USE_BASEDIR),y)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 toolchain-wrapper: do not use deprecated -mfused-madd

Hello,

Quoted 4 lines · Waldemar Brodkorb

GCC deprecated -mfused-madd, -ffp-contract=off should be used for Xburst workaround.
uClibc compilations will fail, because a gcc warning is emitted while checking for TLS support in the compiler.

In which gcc version was -ffp-contract=off added ? Can we use that unconditionally, or is it only available in recent gcc versions ?

Best regards,

Thomas

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

PATCH 1/1 toolchain-wrapper: do not use deprecated -mfused-madd

Quoted 10 lines · Thomas Petazzoni

Hello,

Quoted 4 lines · Waldemar Brodkorb

GCC deprecated -mfused-madd, -ffp-contract=off should be used for Xburst workaround.
uClibc compilations will fail, because a gcc warning is emitted while checking for TLS support in the compiler.

In which gcc version was -ffp-contract=off added ? Can we use that unconditionally, or is it only available in recent gcc versions ?

And remember that we support GCC down to 4.3 in external toolchains...

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#3 lore raw

PATCH 1/1 toolchain-wrapper: do not use deprecated -mfused-madd

Hi Arnout,
Arnout Vandecappelle wrote,

Quoted 11 lines · Thomas Petazzoni
Quoted 8 lines

Hello,

Quoted 4 lines · Waldemar Brodkorb

GCC deprecated -mfused-madd, -ffp-contract=off should be used for Xburst workaround.
uClibc compilations will fail, because a gcc warning is emitted while checking for TLS support in the compiler.

Quoted 4 lines
Quoted 2 lines

In which gcc version was -ffp-contract=off added ? Can we use that unconditionally, or is it only available in recent gcc versions ?

And remember that we support GCC down to 4.3 in external toolchains...

The usage for -ffp-contract=off is limited for MIPS32 xburst and I see only two external toolchains from 2016 for MIPS in make menuconfig...

best regards
Waldemar

#4 lore raw

PATCH 1/1 toolchain-wrapper: do not use deprecated -mfused-madd

Quoted 14 lines · Waldemar Brodkorb

Hi Arnout,
Arnout Vandecappelle wrote,

Quoted 11 lines · Thomas Petazzoni
Quoted 8 lines

Hello,

Quoted 4 lines · Waldemar Brodkorb

GCC deprecated -mfused-madd, -ffp-contract=off should be used for Xburst workaround.
uClibc compilations will fail, because a gcc warning is emitted while checking for TLS support in the compiler.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

In which gcc version was -ffp-contract=off added ? Can we use that unconditionally, or is it only available in recent gcc versions ?

And remember that we support GCC down to 4.3 in external toolchains...

The usage for -ffp-contract=off is limited for MIPS32 xburst and I see only two external toolchains from 2016 for MIPS in make menuconfig...

There's also something called "Custom external toolchain", which could be
anything...

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#5 lore raw

PATCH 1/1 toolchain-wrapper: do not use deprecated -mfused-madd

In reply to Thomas Petazzoni

Hi,
Thomas Petazzoni wrote,

Quoted 10 lines

Hello,

Quoted 4 lines · Waldemar Brodkorb

GCC deprecated -mfused-madd, -ffp-contract=off should be used for Xburst workaround.
uClibc compilations will fail, because a gcc warning is emitted while checking for TLS support in the compiler.

In which gcc version was -ffp-contract=off added ? Can we use that unconditionally, or is it only available in recent gcc versions ?

It was added in commit b9be572eda05cd23bbabd6409387d2c7ac782715.

Not sure how to find when it was added in a release. 4.6.4 seems to have it:
https://gcc.gnu.org/onlinedocs/gcc-4.6.4/gcc/Optimize-Options.html#index-ffp_002dcontract-691

I don't find it in earlier release docs.

best regards
Waldemar

#6 lore raw

PATCH 1/1 toolchain-wrapper: do not use deprecated -mfused-madd

Quoted 11 lines · Waldemar Brodkorb

Hi,
Thomas Petazzoni wrote,

Quoted 8 lines

Hello,

Quoted 4 lines · Waldemar Brodkorb

GCC deprecated -mfused-madd, -ffp-contract=off should be used for Xburst workaround.
uClibc compilations will fail, because a gcc warning is emitted while checking for TLS support in the compiler.

Quoted 6 lines
Quoted 2 lines

In which gcc version was -ffp-contract=off added ? Can we use that unconditionally, or is it only available in recent gcc versions ?

It was added in commit b9be572eda05cd23bbabd6409387d2c7ac782715.

Not sure how to find when it was added in a release.

$ git describe --contains b9be572eda05cd23bbabd6409387d2c7ac782715
gcc-4_6_0-release~2941

So we should use something like:

ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_6),y)
TOOLCHAIN_WRAPPER_ARGS += -DBR_FP_CONTRACT_OFF
else
TOOLCHAIN_WRAPPER_ARGS += -DBR_NO_FUSED_MADD
endif

But actually, I'd much prefer this stuff to just be coded in
TOOLCHAIN_WRAPPER_OPTS. But that's a much bigger patch (series) so not for master.

Regards,
Arnout

Quoted 12 lines

4.6.4 seems to have it:
https://gcc.gnu.org/onlinedocs/gcc-4.6.4/gcc/Optimize-Options.html#index-ffp_002dcontract-691

I don't find it in earlier release docs.

best regards
Waldemar
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF