grub2/0140-Disable-non-wordsize-allocations-on-arm.patch

45 lines
1.4 KiB
Diff
Raw Normal View History

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