configure: Check for -falign-jumps=1 beside -falign-loops=1
The Clang does not support -falign-jumps and only recently gained support for -falign-loops. The -falign-jumps=1 should be tested beside -fliang-loops=1 to avoid passing unrecognized options to the Clang: clang-14: error: optimization flag '-falign-jumps=1' is not supported [-Werror,-Wignored-optimization-argument] The -falign-functions=1 is supported by GCC 5.1.0/Clang 3.8.0. So, just add the option unconditionally. Signed-off-by: Fangrui Song <maskray@google.com> Acked-by: Paul Menzel <pmenzel@molgen.mpg.de> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
eb486898da
commit
e372dcb0d4
15
configure.ac
15
configure.ac
@ -798,6 +798,8 @@ fi
|
||||
|
||||
# Force no alignment to save space on i386.
|
||||
if test "x$target_cpu" = xi386; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -falign-functions=1"
|
||||
|
||||
AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
|
||||
CFLAGS="$TARGET_CFLAGS -falign-loops=1 -Werror"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
@ -806,7 +808,18 @@ if test "x$target_cpu" = xi386; then
|
||||
])
|
||||
|
||||
if test "x$grub_cv_cc_falign_loop" = xyes; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -falign-loops=1"
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([whether -falign-jumps works], [grub_cv_cc_falign_jumps], [
|
||||
CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -Werror"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
[grub_cv_cc_falign_jumps=yes],
|
||||
[grub_cv_cc_falign_jumps=no])
|
||||
])
|
||||
|
||||
if test "x$grub_cv_cc_falign_jumps" = xyes; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user