Web lists-archives.com

Re: [MPlayer-dev-eng] [PATCH v2] configure: Avoid eh_frame bloat in release builds

On Sat, 13 Feb 2016 16:26:42 +0100
Reimar Döffinger <Reimar.Doeffinger@xxxxxx> wrote:

> On Sat, Feb 13, 2016 at 05:03:17PM +0200, Lauri Kasanen wrote:
> > Hi,
> > 
> > This patch reduces both mplayer and mencoder size by 1mb, or 6%. The
> > eh_frame sections are mainly used for C++ exceptions and accurate
> > debugging, neither of which is desired in a C program and a release
> > build.
> To the best of my information, at the very least
> -fno-asynchronous-unwind-tables has no effect on debuggability
> if debug info is present.
> Thus is it should be set always.
> Did you check whether -fno-unwind-tables has any effect at all?
> I think this one is potentially not completely safe (we do have
> C++ code) and it would be better to not add it unless it really
> provides a significant benefit.

-fno-async provides the majority of the size benefit indeed, the
difference was just bytes. Attaching v2.

The few C++ files in mplayer and ffmpeg do not use exceptions
(incidentally, -fno-exceptions and -fno-rtti should be added to
CXXFLAGS, they have size impact as well).

- Lauri
Index: configure
--- configure	(revision 37696)
+++ configure	(working copy)
@@ -2847,6 +2847,8 @@
   cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
   cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
   cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
+  # This provides significant size savings on gcc.
+  cflag_check -fno-asynchronous-unwind-tables && CFLAGS="$CFLAGS -fno-asynchronous-unwind-tables"
 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
MPlayer-dev-eng mailing list