From bf9c5616708dcfd905acdd730e4d63b3be84dadd Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 23 Jan 2017 00:52:32 +0300 Subject: [PATCH] configure: Disable movw/movt with clang. Those relocations are not compatible with PE and also not compatible with custom uboot relocator. Disable them. --- configure.ac | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/configure.ac b/configure.ac index 4e980c5fe..ab7fa92e0 100644 --- a/configure.ac +++ b/configure.ac @@ -1152,6 +1152,16 @@ if test "$target_cpu"-"$platform" = x86_64-efi; then fi 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, [ + CPPFLAGS="$TARGET_CPPFLAGS -mllvm -arm-use-movt=0 -Werror" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_mllvm_arm_use_movt=yes], + [grub_cv_cc_mllvm_arm_use_movt=no]) + ]) + if test "x$grub_cv_cc_mllvm_arm_use_movt" = xyes; then + # A trick so that clang doesn't see it on link stage + TARGET_CPPFLAGS="$TARGET_CPPFLAGS -mllvm -arm-use-movt=0" + fi AC_CACHE_CHECK([whether option -mlong-calls works], grub_cv_cc_mlong_calls, [ CFLAGS="$TARGET_CFLAGS -mlong-calls -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],