This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 3 of 4] arch: add softfp support


# HG changeset patch
# User Michael Hope <michael.hope@linaro.org>
# Date 1320190577 -3600
# Node ID 43fb1d340cabee3afba58bf21c49daf4482698ff
# Parent  a58704d1826c77882e5723f1ae61d44c12e9ba36
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>

diff --git a/config/target.in b/config/target.in
--- a/config/target.in
+++ b/config/target.in
@@ -15,6 +15,7 @@
 config ARCH_SUPPORT_CPU
 config ARCH_SUPPORT_TUNE
 config ARCH_SUPPORT_FPU
+config ARCH_SUPPORT_SOFTFP
 
 config ARCH_DEFAULT_HAS_MMU
 config ARCH_DEFAULT_BE
@@ -144,6 +145,9 @@
 config ARCH_SUPPORT_FPU
     bool
 
+config ARCH_SUPPORT_SOFTFP
+    bool
+
 config ARCH_ARCH
     string
     prompt "Architecture level"
@@ -271,6 +275,22 @@
       If your processor has no FPU, then you most probably want this, as it
       is faster than emulating the FPU in the kernel.
 
+config ARCH_FLOAT_SOFTFP
+    bool
+    prompt "softfp"
+    depends on ARCH_SUPPORT_SOFTFP
+    help
+      Emit hardware floating point opcodes but use the software
+      floating point calling convention.
+
+      Architectures such as ARM use different registers for passing
+      floating point values depending on if they're in software mode
+      or hardware mode.  softfp emits FPU instructions but uses the
+      software FP calling convention allowing softfp code to
+      interoperate with legacy software only code.
+
+      If in doubt, use 'software' or 'hardware' mode instead.
+
 endchoice
 
 config TARGET_CFLAGS
@@ -300,6 +320,7 @@
     string
     default "hard"   if ARCH_FLOAT_HW
     default "soft"   if ARCH_FLOAT_SW
+    default "softfp" if ARCH_FLOAT_SOFTFP
 
 source "config.gen/arch.in.2"
 
diff --git a/scripts/build/libc/glibc-eglibc.sh-common b/scripts/build/libc/glibc-eglibc.sh-common
--- a/scripts/build/libc/glibc-eglibc.sh-common
+++ b/scripts/build/libc/glibc-eglibc.sh-common
@@ -135,6 +135,7 @@
     case "${CT_ARCH_FLOAT}" in
         hard)   extra_config+=("--with-fp");;
         soft)   extra_config+=("--without-fp");;
+        softfp) extra_config+=("--with-fp");;
     esac
 
     if [ "${CT_LIBC_DISABLE_VERSIONING}" = "y" ]; then
diff --git a/scripts/functions b/scripts/functions
--- a/scripts/functions
+++ b/scripts/functions
@@ -993,6 +993,10 @@
             CT_ARCH_FLOAT_CFLAG="-msoft-float"
             CT_ARCH_WITH_FLOAT="--with-float=soft"
             ;;
+        softfp)
+            CT_ARCH_FLOAT_CFLAG="-mfloat-abi=softfp"
+            CT_ARCH_WITH_FLOAT="--with-float=softfp"
+            ;;
     esac
 
     # Build the default kernel tuple part

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]