diff --git a/ChangeLog b/ChangeLog index a35961641..79138e8c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-11-07 Robert Millan + + 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 Suppress shell expansion on echo '*' and echo "*" like cases. diff --git a/conf/Makefile.common b/conf/Makefile.common index 32851e34e..a3ccebcc5 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -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 diff --git a/configure.ac b/configure.ac index 66d4a6877..1ad3a8e98 100644 --- a/configure.ac +++ b/configure.ac @@ -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"