From: Vladimir Serbinenko <phcoder@gmail.com>
To: grub-devel@gnu.org
Cc: Vladimir Serbinenko <phcoder@gmail.com>
Subject: [PATCH 4/6] configure: Add -mno-gpopt option
Date: Mon, 2 Sep 2024 03:22:52 +0300 [thread overview]
Message-ID: <20240902002254.1008-4-phcoder@gmail.com> (raw)
In-Reply-To: <20240902002254.1008-1-phcoder@gmail.com>
Without it compiler generates GPREL16 references which do not work
with our memory layout
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
---
configure.ac | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/configure.ac b/configure.ac
index fe5493246..c3d9398ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -802,9 +802,21 @@ if test "x$target_cpu" = xmips || test "x$target_cpu" = xmipsel ; then
if test "x$grub_cv_cc_mflush_func" = xyes; then
TARGET_CFLAGS="$TARGET_CFLAGS -mflush-func=grub_red_herring"
fi
+
+ AC_CACHE_CHECK([whether -mno-gpopt works], [grub_cv_cc_mno_gpopt], [
+ CFLAGS="$TARGET_CFLAGS -mno-gpopt -Werror"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+ [grub_cv_cc_mno_gpopt=yes],
+ [grub_cv_cc_mno_gpopt=no])
+ ])
+
+ if test "x$grub_cv_cc_mno_gpopt" = xyes; then
+ TARGET_CFLAGS="$TARGET_CFLAGS -mno-gpopt"
+ fi
fi
+
# Force no alignment to save space on i386.
if test "x$target_cpu" = xi386; then
TARGET_CFLAGS="$TARGET_CFLAGS -falign-functions=1"
--
2.39.2
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next prev parent reply other threads:[~2024-09-02 0:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-02 0:22 [PATCH 1/6] configure: Look for .otf fonts Vladimir Serbinenko
2024-09-02 0:22 ` [PATCH 2/6] erofs: Replace 64-bit modulo with bitwise operations Vladimir Serbinenko
2024-09-02 3:41 ` Gao Xiang
2024-09-02 0:22 ` [PATCH 3/6] xzembed: Silence warning when no BCJ is available Vladimir Serbinenko
2024-09-02 0:22 ` Vladimir Serbinenko [this message]
2024-09-02 0:22 ` [PATCH 5/6] mkimage: Fix section_align for Loongson Vladimir Serbinenko
2024-09-02 0:22 ` [PATCH 6/6] gentpl: Put startup_raw.S into beginning of the image Vladimir Serbinenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240902002254.1008-4-phcoder@gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.