]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Don't add -mflush-func if it's not supported by compiler.
authorVladimir Serbinenko <phcoder@gmail.com>
Sat, 23 Nov 2013 11:40:44 +0000 (12:40 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sat, 23 Nov 2013 11:40:44 +0000 (12:40 +0100)
ChangeLog
conf/Makefile.common
configure.ac

index 0c87f158c86aa2a4871b524b05905a3b60d1719f..fb67de1d307b7db387a94fdaeb621d90103de162 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-23  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Don't add -mflush-func if it's not supported by compiler.
+
 2013-11-23  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Move common BIOS/coreboot memory map declarations to
index 835aeeac5b914932a881bb8c5df92205bc08aae6..9f0d1d6d5e4f8fc05cad268a878282946720b8c3 100644 (file)
@@ -10,9 +10,6 @@ if COND_mips_loongson
   CFLAGS_PLATFORM += -mexplicit-relocs
   CPPFLAGS_PLATFORM = -DUSE_ASCII_FALLBACK
 endif
-if COND_mips
-  CFLAGS_PLATFORM += -mflush-func=grub_red_herring
-endif
 if COND_sparc64_ieee1275
   CFLAGS_PLATFORM += -mno-app-regs
   LDFLAGS_PLATFORM = -Wl,-melf64_sparc -mno-relax
index cb12f24012c7dad67876e16d9867db74e69d5711..8619a676e468d543fac529379f21025a6a8ca048 100644 (file)
@@ -520,6 +520,21 @@ if test "x$grub_cv_cc_target_clang" = xno && test "x$target_cpu" = xi386 && test
    TARGET_CFLAGS="$TARGET_CFLAGS -mrtd -mregparm=3"
 fi
 
+# on mips redirect cache flushing function to non-existant one.
+if test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ; then
+  AC_CACHE_CHECK([whether -mflush-func=grub_red_herring works], [grub_cv_cc_mflush_func], [
+    CFLAGS="$TARGET_CFLAGS -mflush-func=grub_red_herring -Werror"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+        [grub_cv_cc_mflush_func=yes],
+       [grub_cv_cc_mflush_func=no])
+  ])
+
+  if test "x$grub_cv_cc_mflush_func" = xyes; then
+    TARGET_CFLAGS="$TARGET_CFLAGS -mflush-func=grub_red_herring"
+  fi
+fi
+
+
 # Force no alignment to save space on i386.
 if test "x$target_cpu" = xi386; then
   AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [