arch: add softfp support
authorMichael Hope <michael.hope@linaro.org>
Wed Oct 19 15:27:32 2011 +1300 (2011-10-19)
changeset 2739f320e22f2cba
parent 2738 149c33923f47
child 2740 8f5f36b3473b
arch: add softfp support

Some architectures support a mixed hard/soft floating point, where
the compiler emits hardware floating point instructions, but passes
the operands in core (aka integer) registers.

For example, ARM supports this mode (to come in the next changeset).

Add support for softfp cross compilers to the GCC and GLIBC
configuration. Needed for Ubuntu and other distros that are softfp.

Signed-off-by: Michael Hope <michael.hope@linaro.org>
[yann.morin.1998@anciens.enib.fr: split the original patch]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
config/target.in
scripts/build/libc/glibc-eglibc.sh-common
scripts/functions
     1.1 --- a/config/target.in	Wed Oct 19 15:27:32 2011 +1300
     1.2 +++ b/config/target.in	Wed Oct 19 15:27:32 2011 +1300
     1.3 @@ -15,6 +15,7 @@
     1.4  config ARCH_SUPPORT_CPU
     1.5  config ARCH_SUPPORT_TUNE
     1.6  config ARCH_SUPPORT_FPU
     1.7 +config ARCH_SUPPORT_SOFTFP
     1.8  
     1.9  config ARCH_DEFAULT_HAS_MMU
    1.10  config ARCH_DEFAULT_BE
    1.11 @@ -144,6 +145,9 @@
    1.12  config ARCH_SUPPORT_FPU
    1.13      bool
    1.14  
    1.15 +config ARCH_SUPPORT_SOFTFP
    1.16 +    bool
    1.17 +
    1.18  config ARCH_ARCH
    1.19      string
    1.20      prompt "Architecture level"
    1.21 @@ -271,6 +275,22 @@
    1.22        If your processor has no FPU, then you most probably want this, as it
    1.23        is faster than emulating the FPU in the kernel.
    1.24  
    1.25 +config ARCH_FLOAT_SOFTFP
    1.26 +    bool
    1.27 +    prompt "softfp"
    1.28 +    depends on ARCH_SUPPORT_SOFTFP
    1.29 +    help
    1.30 +      Emit hardware floating point opcodes but use the software
    1.31 +      floating point calling convention.
    1.32 +
    1.33 +      Architectures such as ARM use different registers for passing
    1.34 +      floating point values depending on if they're in software mode
    1.35 +      or hardware mode.  softfp emits FPU instructions but uses the
    1.36 +      software FP calling convention allowing softfp code to
    1.37 +      interoperate with legacy software only code.
    1.38 +
    1.39 +      If in doubt, use 'software' or 'hardware' mode instead.
    1.40 +
    1.41  endchoice
    1.42  
    1.43  config TARGET_CFLAGS
    1.44 @@ -300,6 +320,7 @@
    1.45      string
    1.46      default "hard"   if ARCH_FLOAT_HW
    1.47      default "soft"   if ARCH_FLOAT_SW
    1.48 +    default "softfp" if ARCH_FLOAT_SOFTFP
    1.49  
    1.50  source "config.gen/arch.in.2"
    1.51  
     2.1 --- a/scripts/build/libc/glibc-eglibc.sh-common	Wed Oct 19 15:27:32 2011 +1300
     2.2 +++ b/scripts/build/libc/glibc-eglibc.sh-common	Wed Oct 19 15:27:32 2011 +1300
     2.3 @@ -135,6 +135,7 @@
     2.4      case "${CT_ARCH_FLOAT}" in
     2.5          hard)   extra_config+=("--with-fp");;
     2.6          soft)   extra_config+=("--without-fp");;
     2.7 +        softfp) extra_config+=("--with-fp");;
     2.8      esac
     2.9  
    2.10      if [ "${CT_LIBC_DISABLE_VERSIONING}" = "y" ]; then
     3.1 --- a/scripts/functions	Wed Oct 19 15:27:32 2011 +1300
     3.2 +++ b/scripts/functions	Wed Oct 19 15:27:32 2011 +1300
     3.3 @@ -993,6 +993,10 @@
     3.4              CT_ARCH_FLOAT_CFLAG="-msoft-float"
     3.5              CT_ARCH_WITH_FLOAT="--with-float=soft"
     3.6              ;;
     3.7 +        softfp)
     3.8 +            CT_ARCH_FLOAT_CFLAG="-mfloat-abi=softfp"
     3.9 +            CT_ARCH_WITH_FLOAT="--with-float=softfp"
    3.10 +            ;;
    3.11      esac
    3.12  
    3.13      # Build the default kernel tuple part