diff --git a/ChangeLog b/ChangeLog index ffb87f386..dabc4120a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-11-07 Vladimir Serbinenko + + * configure.ac: Check that -malign-loops works rather than assuming that + either -falign-loops or -malign-loops work. + 2013-11-07 Vladimir Serbinenko * configure.ac: Remove -fnested-functions. We don't need it anymore. diff --git a/configure.ac b/configure.ac index cebf27fbe..081bbdde4 100644 --- a/configure.ac +++ b/configure.ac @@ -485,9 +485,16 @@ if test "x$target_cpu" = xi386; then [grub_cv_cc_falign_loop=no]) ]) + AC_CACHE_CHECK([whether -malign-loops works], [grub_cv_cc_malign_loop], [ + CFLAGS="$TARGET_CFLAGS -malign-loops=1" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_malign_loop=yes], + [grub_cv_cc_malign_loop=no]) + ]) + if test "x$grub_cv_cc_falign_loop" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" - else + elif test "x$grub_cv_cc_malign_loop" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" fi fi