grub-devel
[Top][All Lists]
Advanced

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

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


From: Vladimir 'phcoder' Serbinenko
Subject: Re: [PATCH] configure: Add -fno-ident when available
Date: Thu, 11 Jul 2019 17:43:17 +0200

>From 03707a618d13a67f947833a7752c97ce3dda55a6 Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <address@hidden>
Date: Tue, 9 Jul 2019 17:46:25 +0200
Subject: [PATCH] configure: Add -fno-ident when available

With mingw for 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
With other compilers we already strip the relevant sections,
so no effect

Signed-off-by: Vladimir Serbinenko <address@hidden>
---
 configure.ac | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/configure.ac b/configure.ac
index 7656f2434..ce7760930 100644
--- a/configure.ac
+++ b/configure.ac
@@ -999,7 +999,18 @@ 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
+
 CFLAGS="$TARGET_CFLAGS"


-- 
2.11.0

On Thu, Jul 11, 2019 at 12:32 PM Daniel Kiper <address@hidden> wrote:
>
> On Tue, Jul 09, 2019 at 05:52:58PM +0200, Vladimir 'phcoder' Serbinenko wrote:
> > 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.
>
> Out of curiosity, why is the size of lzma_decompress limited to an
> value? I thought that the total size of core.img is limited not
> lzma_decompress module.
>
> > With mingw this also saves a bit of space in modules
> > On other platforms we should already strip this, so no effect
>
> May I ask you to polish a comment a bit. And please add your SOB.
>
> > ---
> >  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
>
> OK...
>
> > +
> > +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
> > +
>
> ...but I am afraid that you copied this part from above by mistake.
> Could you drop that?
>
> Daniel



-- 
Regards
Vladimir 'phcoder' Serbinenko



reply via email to

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