cc/gcc: add option to enable/disable decimal floats
author"Yann E. MORIN" <yann.morin.1998@free.fr>
Sat Jan 04 16:17:40 2014 +0100 (2014-01-04)
changeset 3279c4b4bb58f639
parent 3278 b8da1339f9fc
child 3280 31d303a49013
cc/gcc: add option to enable/disable decimal floats

Decimal floats need support form the C library, namely support
for fenv, which is missing in uClibc for any architecture but
x86/32.

Add an option (a choice) to enable or disable decimal floats.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
config/cc/gcc.in.2
scripts/build/cc/gcc.sh
     1.1 --- a/config/cc/gcc.in.2	Wed Jan 15 23:24:27 2014 +0100
     1.2 +++ b/config/cc/gcc.in.2	Sat Jan 04 16:17:40 2014 +0100
     1.3 @@ -255,6 +255,52 @@
     1.4      default "gnu"   if CC_GCC_LNK_HASH_STYLE_GNU
     1.5      default "both"  if CC_GCC_LNK_HASH_STYLE_BOTH
     1.6  
     1.7 +choice CC_GCC_DEC_FLOATS_CHOICE
     1.8 +    bool "Decimal floats"
     1.9 +    default CC_GCC_DEC_FLOATS_AUTO
    1.10 +    help
    1.11 +      Choose what type of decimal floats to support.
    1.12 +      
    1.13 +      Note that using decimal floats requires a C library that provides
    1.14 +      support for fenv (namely, the fenv.h header).  This is the case
    1.15 +      for (e)glibc, and uClibc on x86/32.  For other C libraries, or
    1.16 +      uClibc on other archs, this might not be the case, so you should
    1.17 +      disable support for decimal floats.
    1.18 +      
    1.19 +      The default is to let ./configure decide.
    1.20 +
    1.21 +config CC_GCC_DEC_FLOAT_AUTO
    1.22 +    bool "auto"
    1.23 +    help
    1.24 +      Let ./configure decide. If you say 'y' here, gcc will default to:
    1.25 +        - 'bid' for x86 (32- and 64-bit)
    1.26 +        - 'dpd' for powerpc
    1.27 +        - 'no' for the other architectures
    1.28 +
    1.29 +config CC_GCC_DEC_FLOAT_BID
    1.30 +    bool "bid"
    1.31 +    help
    1.32 +      Use the 'binary integer decimal' format for decimal floats.
    1.33 +
    1.34 +config CC_GCC_DEC_FLOAT_DPD
    1.35 +    bool "dpd"
    1.36 +    help
    1.37 +      Use the 'densely packed decimal' for decimal floats.
    1.38 +
    1.39 +config CC_GCC_DEC_FLOATS_NO
    1.40 +    bool "no"
    1.41 +    help
    1.42 +      Do not support decimal floats. The default.
    1.43 +
    1.44 +endchoice # CC_GCC_DEC_FLOATS_CHOICE
    1.45 +
    1.46 +config CC_GCC_DEC_FLOATS
    1.47 +    string
    1.48 +    default ""      if CC_GCC_DEC_FLOATS_AUTO
    1.49 +    default "bid"   if CC_GCC_DEC_FLOATS_BID
    1.50 +    default "dpd"   if CC_GCC_DEC_FLOATS_DPD
    1.51 +    default "no"    if CC_GCC_DEC_FLOATS_NO
    1.52 +
    1.53  #-----------------------------------------------------------------------------
    1.54  
    1.55  config CC_GCC_HAS_ARCH_OPTIONS
     2.1 --- a/scripts/build/cc/gcc.sh	Wed Jan 15 23:24:27 2014 +0100
     2.2 +++ b/scripts/build/cc/gcc.sh	Sat Jan 04 16:17:40 2014 +0100
     2.3 @@ -333,6 +333,11 @@
     2.4          *)  extra_config+=( "--with-linker-hash-style=${CT_CC_GCC_LNK_HASH_STYLE}" );;
     2.5      esac
     2.6  
     2.7 +    case "${CT_CC_GCC_DEC_FLOATS}" in
     2.8 +        "") ;;
     2.9 +        *)  extra_config+=( "--enable-decimal-float=${CT_CC_GCC_DEC_FLOATS}" );;
    2.10 +    esac
    2.11 +
    2.12      case "${CT_ARCH}" in
    2.13          mips)
    2.14              case "${CT_CC_GCC_mips_llsc}" in
    2.15 @@ -784,6 +789,11 @@
    2.16          *)  extra_config+=( "--with-linker-hash-style=${CT_CC_GCC_LNK_HASH_STYLE}" );;
    2.17      esac
    2.18  
    2.19 +    case "${CT_CC_GCC_DEC_FLOATS}" in
    2.20 +        "") ;;
    2.21 +        *)  extra_config+=( "--enable-decimal-float=${CT_CC_GCC_DEC_FLOATS}" );;
    2.22 +    esac
    2.23 +
    2.24      if [ "${CT_CC_GCC_ENABLE_PLUGINS}" = "y" ]; then
    2.25          extra_config+=( --enable-plugin )
    2.26      fi