Support arm clang 3.8 amd later.
clang 3.8 and later doesn't support -mllvm -use-arm-movt=0 whereas older clang doesn't know -mno-movt. So use -mno-movt whenever possible and fallback to mllvm variant.
This commit is contained in:
parent
a0413e2677
commit
d15f17b2a0
1 changed files with 15 additions and 7 deletions
20
configure.ac
20
configure.ac
|
@ -1152,15 +1152,23 @@ if test "$target_cpu"-"$platform" = x86_64-efi; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$target_cpu" = xarm; then
|
if test "x$target_cpu" = xarm; then
|
||||||
AC_CACHE_CHECK([whether option -mllvm -arm-use-movt=0 works], grub_cv_cc_mllvm_arm_use_movt, [
|
AC_CACHE_CHECK([for options to disable movt and movw], grub_cv_target_cc_mno_movt, [
|
||||||
CPPFLAGS="$TARGET_CPPFLAGS -mllvm -arm-use-movt=0 -Werror"
|
grub_cv_target_cc_mno_movt=no
|
||||||
|
for cand in "-mno-movt" \
|
||||||
|
"-mllvm -arm-use-movt=0"; do
|
||||||
|
if test x"$grub_cv_target_cc_mno_movt" != xno ; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
CFLAGS="$TARGET_CFLAGS $cand -Werror"
|
||||||
|
CPPFLAGS="$TARGET_CPPFLAGS"
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||||
[grub_cv_cc_mllvm_arm_use_movt=yes],
|
[grub_cv_target_cc_mno_movt="$cand"], [])
|
||||||
[grub_cv_cc_mllvm_arm_use_movt=no])
|
done
|
||||||
])
|
])
|
||||||
if test "x$grub_cv_cc_mllvm_arm_use_movt" = xyes; then
|
|
||||||
|
if test x"$grub_cv_target_cc_mno_movt" != xno ; then
|
||||||
# A trick so that clang doesn't see it on link stage
|
# A trick so that clang doesn't see it on link stage
|
||||||
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -mllvm -arm-use-movt=0"
|
TARGET_CPPFLAGS="$TARGET_CPPFLAGS $grub_cv_target_cc_mno_movt"
|
||||||
fi
|
fi
|
||||||
AC_CACHE_CHECK([whether option -mthumb-interwork works], grub_cv_cc_mthumb_interwork, [
|
AC_CACHE_CHECK([whether option -mthumb-interwork works], grub_cv_cc_mthumb_interwork, [
|
||||||
CFLAGS="$TARGET_CFLAGS -mthumb-interwork -Werror"
|
CFLAGS="$TARGET_CFLAGS -mthumb-interwork -Werror"
|
||||||
|
|
Loading…
Add table
Reference in a new issue