+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
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
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], [