grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] configure: Add -fno-ident when available


From: Vladimir 'phcoder' Serbinenko
Subject: [PATCH] configure: Add -fno-ident when available
Date: Tue, 9 Jul 2019 17:52:58 +0200

On mingw i386-pc without this option mingw generates a
rdata$zzz symbol that is page-aligned and hence lzma_decompress no
longer fits in its allocated space.
With mingw this also saves a bit of space in modules
On other platforms we should already strip this, so no effect
---
 configure.ac | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/configure.ac b/configure.ac
index 7656f2434..a86951b90 100644
--- a/configure.ac
+++ b/configure.ac
@@ -999,6 +999,29 @@ if test "x$grub_cv_cc_fno_unwind_tables" = xyes; then
   TARGET_CFLAGS="$TARGET_CFLAGS -fno-unwind-tables"
 fi

+# Do not generate .ident sections
+AC_CACHE_CHECK([whether -fno-ident works], [grub_cv_cc_fno_ident], [
+  CFLAGS="$TARGET_CFLAGS -fno-ident"
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+      [grub_cv_cc_fno_ident=yes],
+      [grub_cv_cc_fno_ident=no])
+])
+
+if test "x$grub_cv_cc_fno_ident" = xyes; then
+  TARGET_CFLAGS="$TARGET_CFLAGS -fno-ident"
+fi
+
+AC_CACHE_CHECK([whether -fno-unwind-tables works],
[grub_cv_cc_fno_unwind_tables], [
+  CFLAGS="$TARGET_CFLAGS -fno-unwind-tables"
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+      [grub_cv_cc_fno_unwind_tables=yes],
+      [grub_cv_cc_fno_unwind_tables=no])
+])
+
+if test "x$grub_cv_cc_fno_unwind_tables" = xyes; then
+  TARGET_CFLAGS="$TARGET_CFLAGS -fno-unwind-tables"
+fi
+

 CFLAGS="$TARGET_CFLAGS"

-- 
2.11.0


-- 
Regards
Vladimir 'phcoder' Serbinenko



reply via email to

[Prev in Thread] Current Thread [Next in Thread]