]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
mips: Fix soft-float handling.
authorVladimir Serbinenko <phcoder@gmail.com>
Mon, 23 Feb 2015 21:33:28 +0000 (22:33 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Mon, 23 Feb 2015 21:33:28 +0000 (22:33 +0100)
Add -msoft-float alongside clang arguments to specify ABI.
Specify ABI in asm files explicitly.
This trigers asm warning due to gcc failing to propagate -msoft-float
but it's tolerable.

configure.ac
grub-core/boot/mips/startup_raw.S
grub-core/kern/mips/cache.S
grub-core/kern/mips/startup.S
grub-core/lib/mips/relocator_asm.S
include/grub/mips/kernel.h

index 8f9ab81335718fc7d16a573e93403432bb8ce55f..908bb81e7e5ac5a47b9865969bd0640d849e2177 100644 (file)
@@ -695,7 +695,8 @@ if test x"$platform" != xemu ; then
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
                         [grub_cv_target_cc_soft_float="-mno-inline-float-divide -mno-inline-sqrt"], [])
     fi
-    for cand in "-Xclang -msoft-float -Xclang -no-implicit-float" \
+    for cand in "-msoft-float -Xclang -msoft-float -Xclang -no-implicit-float" \
+               "-Xclang -msoft-float -Xclang -no-implicit-float" \
                "-Xclang -msoft-float" "-msoft-float"; do
       if test x"$grub_cv_target_cc_soft_float" != xno ; then
         break
@@ -711,7 +712,7 @@ if test x"$platform" != xemu ; then
   fi
 
   case x"$grub_cv_target_cc_soft_float" in
-    x"-Xclang"*)
+    x*"-Xclang"*)
       # A trick so that clang doesn't see it on link stаge
       TARGET_CPPFLAGS="$TARGET_CPPFLAGS $grub_cv_target_cc_soft_float"
       ;;
index ca3413bbe09960f5857f330f37b42a7c82105096..fd95c3134ca2a495754b12f439885f6c9b73b43c 100644 (file)
@@ -21,6 +21,7 @@
 #include <grub/offsets.h>
 #include <grub/machine/memory.h>
 #include <grub/machine/kernel.h>
+#include <grub/cpu/kernel.h>
 #include <grub/offsets.h>
 
 #define BASE_ADDR 8
@@ -32,6 +33,7 @@
        .globl __start, _start, start
        .set noreorder
        .set nomacro
+       mips_attributes
 __start:
 _start:
 start:         
index 78e40bcea08ceeb2a1e3ad1ca0c6c89940118feb..e83960fccda4079d5e080bed6183b3e18b98a81b 100644 (file)
@@ -1,8 +1,10 @@
 
 #include <grub/symbol.h>
+#include <grub/cpu/kernel.h>
 
        .set noreorder
        .set nomacro
+       mips_attributes
 
 FUNCTION (grub_arch_sync_caches)
 #include "cache_flush.S"
@@ -65,4 +67,4 @@ FUNCTION (grub_arch_sync_dma_caches)
 #endif
        sync_op
 
-       jr $ra
\ No newline at end of file
+       jr $ra
index 339ab337e507837d289e82591b967d9c7157666f..337aca91440190573c208eccc2fac6f3972f4db6 100644 (file)
@@ -21,6 +21,7 @@
 #include <grub/offsets.h>
 #include <grub/machine/memory.h>
 #include <grub/machine/kernel.h>
+#include <grub/cpu/kernel.h>
 #include <grub/offsets.h>
 
 #define BASE_ADDR 8    
@@ -28,6 +29,7 @@
        .globl __start, _start, start
        .set noreorder
        .set nomacro
+       mips_attributes
 __start:
 _start:
 start:         
index 1d142a4f355b4961edb22b324b05bb941ba88137..959893ca923063dd306c419087e02cb99064be6e 100644 (file)
  */
 
 #include <grub/symbol.h>
+#include <grub/cpu/kernel.h>
        
        .p2align        4       /* force 16-byte alignment */
 
        .set noreorder
        .set nomacro
+       mips_attributes
 
 VARIABLE (grub_relocator_forward_start)
        move $a0, $9
index 07b08848d8268617fe0722e16d757ad4c1ed3dd4..d0e09ddc66bd0357199c73731b151ee8fcaeb56e 100644 (file)
@@ -21,4 +21,8 @@
 
 #include <grub/symbol.h>
 
+#ifdef ASM_FILE
+#define mips_attributes .gnu_attribute 4, 3
+#endif
+
 #endif /* ! GRUB_KERNEL_MACHINE_HEADER */