Re: [PATCH v2] configure: Avoid eh_frame bloat in release builds

Lauri Kasanen <[email protected]>
Newsgroups gmane.comp.video.mplayer.devel
Message-ID <[email protected]>
On Sat, 13 Feb 2016 16:26:42 +0100
Reimar Döffinger <[email protected]> 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

_______________________________________________
MPlayer-dev-eng mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
eh_frame_v2.patch (text/plain, 699 B)
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"
 fi
 
 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.