dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0224-Disable-non-wordsize-allocations-on-arm.patch

d9d99f
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
d9d99f
From: Peter Jones <pjones@redhat.com>
d9d99f
Date: Thu, 2 Aug 2018 10:56:38 -0400
d9d99f
Subject: [PATCH] Disable non-wordsize allocations on arm
d9d99f
d9d99f
Signed-off-by: Peter Jones <pjones@redhat.com>
d9d99f
---
d9d99f
 configure.ac | 20 ++++++++++++++++++++
d9d99f
 1 file changed, 20 insertions(+)
d9d99f
d9d99f
diff --git a/configure.ac b/configure.ac
d9d99f
index 819212095ff..9323c125469 100644
d9d99f
--- a/configure.ac
d9d99f
+++ b/configure.ac
d9d99f
@@ -1234,6 +1234,26 @@ if test "x$target_cpu" = xarm; then
d9d99f
     done
d9d99f
   ])
d9d99f
 
d9d99f
+  AC_CACHE_CHECK([for options to disable movt and movw relocations],
d9d99f
+		 grub_cv_target_cc_mword_relocations,
d9d99f
+		 [grub_cv_target_cc_mword_relocations=no
d9d99f
+		  for cand in "-mword-relocations" ; do
d9d99f
+		    if test x"$grub_cv_target_cc_mword_relocations" != xno ; then
d9d99f
+		      break
d9d99f
+		    fi
d9d99f
+		    CFLAGS="$TARGET_CFLAGS $cand -Werror"
d9d99f
+		    CPPFLAGS="$TARGET_CPPFLAGS"
d9d99f
+		    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
d9d99f
+				      [grub_cv_target_cc_mword_relocations="$cand"],
d9d99f
+				      [])
d9d99f
+		  done
d9d99f
+		 ])
d9d99f
+  if test x"$grub_cv_target_cc_mword_relocations" = xno ; then
d9d99f
+    AC_MSG_ERROR(["your compiler doesn't support disabling movw/movt relocations"])
d9d99f
+  else
d9d99f
+    TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_mword_relocations"
d9d99f
+  fi
d9d99f
+
d9d99f
   if test x"$grub_cv_target_cc_mno_movt" != xno ; then
d9d99f
     # A trick so that clang doesn't see it on link stage
d9d99f
     TARGET_CPPFLAGS="$TARGET_CPPFLAGS $grub_cv_target_cc_mno_movt"