[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Disable movw/movt with clang

From: Vladimir 'phcoder' Serbinenko
Subject: Re: Disable movw/movt with clang
Date: Sat, 28 Jan 2017 11:51:24 +0000

On Sat, 28 Jan 2017, 14:49 Vladimir 'phcoder' Serbinenko <address@hidden> wrote:

On Sat, 28 Jan 2017, 09:27 Andrei Borzenkov <address@hidden> wrote:
> diff --git a/ b/
> index 4e980c5..ab7fa92 100644
> --- a/
> +++ b/
> @@ -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"
> +                     [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"

Is this option supported by all clang versions? What should we do if
this is *not* supported? As far as I understand commit message this
leads to broken code?
The only other workaround there is, is to use -march=armv6. The window for the problem is narrow as apparently there wasn't a lot of time between use of movt/movw and the option to disable it.
The problem when exists is successfully detected by module-verifier.

Is "-mllvm -arm-use-movt=0" different from "-mno-movt" which appears to
be "official" way to disable it?
 I peeked this option at uboot which has the same problem. 
Mno-movt needs clang 3.8 whereas the llvm variant only 3.7. I'm unsure when movt/movw was introduced.
This being said, I'm fine with preferring mno-movt. I just didn't care enough either way.

Grub-devel mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]