]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-11-07 Robert Millan <rmh@gnu.org>
authorRobert Millan <rmh@gnu.org>
Sun, 7 Nov 2010 15:29:10 +0000 (16:29 +0100)
committerRobert Millan <rmh@gnu.org>
Sun, 7 Nov 2010 15:29:10 +0000 (16:29 +0100)
On mips-yeeloong, build with -march=loongson2f when this flag is
available (GCC >= 4.4).
* conf/Makefile.common [COND_mips_yeeloong] (CFLAGS_PLATFORM): Remove
`-march=mips3'.
* configure.ac: For mips-yeeloong, add -march=loongson2f if available,
or otherwise add -march=mips3.

ChangeLog
conf/Makefile.common
configure.ac

index a35961641e6d57fa4115668ed16b5da1f350d593..79138e8c723b988bd1b20fb912df18aa756d1baf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-11-07  Robert Millan  <rmh@gnu.org>
+
+       On mips-yeeloong, build with -march=loongson2f when this flag is
+       available (GCC >= 4.4).
+       * conf/Makefile.common [COND_mips_yeeloong] (CFLAGS_PLATFORM): Remove
+       `-march=mips3'.
+       * configure.ac: For mips-yeeloong, add -march=loongson2f if available,
+       or otherwise add -march=mips3.
+
 2010-11-07  BVK Chaitanya  <bvk.groups@gmail.com>
 
        Suppress shell expansion on echo '*' and echo "*" like cases.
index 32851e34e3c1e5988743a200093d27642037f5e6..a3ccebcc53eb82a885c384753f68362809805536 100644 (file)
@@ -22,7 +22,7 @@ if COND_i386_ieee1275
   CFLAGS_PLATFORM += -mrtd -mregparm=3
 endif
 if COND_mips_yeeloong
-  CFLAGS_PLATFORM += -march=mips3 -mexplicit-relocs
+  CFLAGS_PLATFORM += -mexplicit-relocs
   CPPFLAGS_PLATFORM = -DUSE_ASCII_FAILBACK
   CCASFLAGS_PLATFORM = -march=mips3
 endif
index 66d4a6877cbcf2d574934e8d45c26f05e3cc03a4..1ad3a8e98325eeda589e670b6c3d4c96f3f15e54 100644 (file)
@@ -401,6 +401,23 @@ if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then
   TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
 fi
 
+if test "${target_cpu}-${platform}" = mips-yeeloong; then
+  AC_CACHE_CHECK([whether -march=loongson2f works], [grub_cv_cc_march_loongson2f], [
+    SAVE_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS -march=loongson2f"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+        [grub_cv_cc_march_loongson2f=yes],
+        [grub_cv_cc_march_loongson2f=no])
+    CFLAGS="$SAVE_CFLAGS"
+  ])
+
+  if test "x$grub_cv_cc_march_loongson2f" = xyes; then
+    TARGET_CFLAGS="$TARGET_CFLAGS -march=loongson2f"
+  else
+    TARGET_CFLAGS="$TARGET_CFLAGS -march=mips3"
+  fi
+fi
+
 grub_apple_target_cc
 if test x$grub_cv_apple_target_cc = xyes ; then
   TARGET_CPPFLAGS="$TARGET_CPPFLAGS -DAPPLE_CC=1"