From: Vladimir Serbinenko Date: Thu, 2 Feb 2017 00:24:11 +0000 (+0100) Subject: Use -fPIC with arm64 with clang. X-Git-Tag: 2.02-rc1~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=393cc59195901ec58509973b8152fbfeb84d04bd;p=thirdparty%2Fgrub.git Use -fPIC with arm64 with clang. Currently it doesn't work either way but with -fPIC it should work once clang bug is fixed. --- 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"