diff --git a/configure.ac b/configure.ac index 8f527544b..4f7765c2d 100644 --- a/configure.ac +++ b/configure.ac @@ -1229,9 +1229,12 @@ grub_CHECK_PIC # and reload $gp in every function. # GCC implements it using symbol __gnu_local_gp in non-PIC as well. # However with clang we need PIC for this reloading to happen. +# With arm64 we need relocations that are in some way representable in +# PE as we need to support arm64-efi. Without -fPIC clang generates +# movk's which aren't representable. # Since default varies across dictributions use either -fPIC or -fno-PIC # explicitly. -if ( test x$target_cpu = xmips || test x$target_cpu = xmipsel ) && test "x$grub_cv_cc_target_clang" = xyes ; then +if ( test x$target_cpu = xmips || test x$target_cpu = xmipsel || test x$target_cpu = xarm64 ) && test "x$grub_cv_cc_target_clang" = xyes ; then TARGET_CFLAGS="$TARGET_CFLAGS -fPIC" elif [ x"$pic_possible" = xyes ]; then TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIC"