Patchwork toolchain/crosstool-NG: disable decimal floats

login
register
mail settings
Submitter Yann E. MORIN
Date May 15, 2012, 9:15 p.m.
Message ID <1337116550-12175-1-git-send-email-yann.morin.1998@free.fr>
Download mbox | patch
Permalink /patch/159453/
State Accepted
Commit cb30e130519fcb50e1a2e0d7a02aa628e52ed24c
Headers show

Comments

Yann E. MORIN - May 15, 2012, 9:15 p.m.
Decimal floats were introduced circa gcc-4.2 or -4.3, and requires
the floating-point environement fenv.h in the C library.

The uClibc .config file used by crosstool-NG to build uClibc is the
same as used by the internal buildroot mechanism, and explcitly
disables fenv support.

The quick workaround is to simply disable decimal floats in all
crosstool-NG config files.

In the long run, it might be better to check this situation, and/or
add code and/or options in crosstool-NG to handle this (but it is
much more involved, and this workaround is sane).

Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 .../crosstool-ng.config-eglibc                     |    4 ++--
 .../crosstool-ng.config-glibc                      |    4 ++--
 .../crosstool-ng.config-uClibc                     |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
Arnout Vandecappelle - May 15, 2012, 10:33 p.m.
On 05/15/12 23:15, Yann E. MORIN wrote:
> Decimal floats were introduced circa gcc-4.2 or -4.3, and requires
> the floating-point environement fenv.h in the C library.
>
> The uClibc .config file used by crosstool-NG to build uClibc is the
> same as used by the internal buildroot mechanism, and explcitly
> disables fenv support.
>
> The quick workaround is to simply disable decimal floats in all
> crosstool-NG config files.

  Wouldn't it be better to enable FENV in buildroot's uClibc config?

  I remember there were some packages that had problems with it too.


  Regards,
  Arnout
Peter Korsgaard - May 16, 2012, 7:40 a.m.
>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:

 Arnout> On 05/15/12 23:15, Yann E. MORIN wrote:
 >> Decimal floats were introduced circa gcc-4.2 or -4.3, and requires
 >> the floating-point environement fenv.h in the C library.
 >> 
 >> The uClibc .config file used by crosstool-NG to build uClibc is the
 >> same as used by the internal buildroot mechanism, and explcitly
 >> disables fenv support.
 >> 
 >> The quick workaround is to simply disable decimal floats in all
 >> crosstool-NG config files.

 Arnout>  Wouldn't it be better to enable FENV in buildroot's uClibc config?

It's afaik only available for i386, and even then I believe some things
are missing.
Yann E. MORIN - May 16, 2012, 7:58 a.m.
On Wednesday 16 May 2012 09:40:37 Peter Korsgaard wrote:
> >>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:
> 
>  Arnout> On 05/15/12 23:15, Yann E. MORIN wrote:
>  >> Decimal floats were introduced circa gcc-4.2 or -4.3, and requires
>  >> the floating-point environement fenv.h in the C library.
>  >> 
>  >> The uClibc .config file used by crosstool-NG to build uClibc is the
>  >> same as used by the internal buildroot mechanism, and explcitly
>  >> disables fenv support.
>  >> 
>  >> The quick workaround is to simply disable decimal floats in all
>  >> crosstool-NG config files.
> 
>  Arnout>  Wouldn't it be better to enable FENV in buildroot's uClibc config?

I did not want to impact the internal backend, thus the workaround is
limited to the crosstool-NG backend. This limits the impact for the
now-woon-to-be-released next version of BR.

Switching to enabling fenv by default can be done in the next cycle.

> It's afaik only available for i386, and even then I believe some things
> are missing.

khem told me yesterday on IRC that uClibc had a working fenv for all
supported architectures, with no _known_ problems (which does not mean
there is none, just that none is known so far):
  http://ibot.rikers.org/%23uclibc/20120515.html.gz  @ 20:20:25 - 20:56.17

Regards,
Yann E. MORIN.
Peter Korsgaard - May 16, 2012, 8:38 a.m.
>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 Arnout> Wouldn't it be better to enable FENV in buildroot's uClibc config?

 Yann> I did not want to impact the internal backend, thus the workaround is
 Yann> limited to the crosstool-NG backend. This limits the impact for the
 Yann> now-woon-to-be-released next version of BR.

 Yann> Switching to enabling fenv by default can be done in the next cycle.

Agreed, lets keep it simple for now.

 >> It's afaik only available for i386, and even then I believe some things
 >> are missing.

 Yann> khem told me yesterday on IRC that uClibc had a working fenv for all
 Yann> supported architectures, with no _known_ problems (which does not mean
 Yann> there is none, just that none is known so far):
 Yann>   http://ibot.rikers.org/%23uclibc/20120515.html.gz  @ 20:20:25 - 20:56.17

Yes, I saw that as well, but looking at the uClibc sources I only see .c
files for i386 and sh4.
Peter Korsgaard - May 16, 2012, 8:39 a.m.
>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 Yann> Decimal floats were introduced circa gcc-4.2 or -4.3, and requires
 Yann> the floating-point environement fenv.h in the C library.

 Yann> The uClibc .config file used by crosstool-NG to build uClibc is the
 Yann> same as used by the internal buildroot mechanism, and explcitly
 Yann> disables fenv support.

 Yann> The quick workaround is to simply disable decimal floats in all
 Yann> crosstool-NG config files.

 Yann> In the long run, it might be better to check this situation, and/or
 Yann> add code and/or options in crosstool-NG to handle this (but it is
 Yann> much more involved, and this workaround is sane).

Committed, thanks.

Patch

diff --git a/toolchain/toolchain-crosstool-ng/crosstool-ng.config-eglibc b/toolchain/toolchain-crosstool-ng/crosstool-ng.config-eglibc
index c1ab679..4488d02 100644
--- a/toolchain/toolchain-crosstool-ng/crosstool-ng.config-eglibc
+++ b/toolchain/toolchain-crosstool-ng/crosstool-ng.config-eglibc
@@ -273,8 +273,8 @@  CT_CC_LANG_CXX=y
 # gcc other options
 #
 CT_CC_ENABLE_CXX_FLAGS=""
-CT_CC_CORE_EXTRA_CONFIG_ARRAY=""
-CT_CC_EXTRA_CONFIG_ARRAY=""
+CT_CC_CORE_EXTRA_CONFIG_ARRAY="--disable-decimal-float"
+CT_CC_EXTRA_CONFIG_ARRAY="--disable-decimal-float"
 CT_CC_STATIC_LIBSTDCXX=y
 
 #
diff --git a/toolchain/toolchain-crosstool-ng/crosstool-ng.config-glibc b/toolchain/toolchain-crosstool-ng/crosstool-ng.config-glibc
index 4a555c7..46a636b 100644
--- a/toolchain/toolchain-crosstool-ng/crosstool-ng.config-glibc
+++ b/toolchain/toolchain-crosstool-ng/crosstool-ng.config-glibc
@@ -273,8 +273,8 @@  CT_CC_LANG_CXX=y
 # gcc other options
 #
 CT_CC_ENABLE_CXX_FLAGS=""
-CT_CC_CORE_EXTRA_CONFIG_ARRAY=""
-CT_CC_EXTRA_CONFIG_ARRAY=""
+CT_CC_CORE_EXTRA_CONFIG_ARRAY="--disable-decimal-float"
+CT_CC_EXTRA_CONFIG_ARRAY="--disable-decimal-float"
 CT_CC_STATIC_LIBSTDCXX=y
 
 #
diff --git a/toolchain/toolchain-crosstool-ng/crosstool-ng.config-uClibc b/toolchain/toolchain-crosstool-ng/crosstool-ng.config-uClibc
index 0e442f0..437f455 100644
--- a/toolchain/toolchain-crosstool-ng/crosstool-ng.config-uClibc
+++ b/toolchain/toolchain-crosstool-ng/crosstool-ng.config-uClibc
@@ -272,8 +272,8 @@  CT_CC_LANG_CXX=y
 # gcc other options
 #
 CT_CC_ENABLE_CXX_FLAGS=""
-CT_CC_CORE_EXTRA_CONFIG_ARRAY=""
-CT_CC_EXTRA_CONFIG_ARRAY=""
+CT_CC_CORE_EXTRA_CONFIG_ARRAY="--disable-decimal-float"
+CT_CC_EXTRA_CONFIG_ARRAY="--disable-decimal-float"
 CT_CC_STATIC_LIBSTDCXX=y
 
 #