[MPlayer-dev-eng] [PATCH] use -fvisibility=hidden

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Aug 14 20:06:46 CEST 2012


On Sun, Aug 05, 2012 at 08:00:16PM +0200, Reimar Döffinger wrote:
> On Sun, Aug 05, 2012 at 07:25:09PM +0200, wbrana wrote:
> > -fvisibility=hidden makes executables smaller with smaller load time
> 
> > --- configure.orig	2012-08-05 19:15:27.000000000 +0200
> > +++ configure	2012-08-05 19:16:00.078697510 +0200
> > @@ -2608,7 +2608,7 @@
> >    elif test "$cc_vendor" != "gnu" ; then
> >      CFLAGS="-O2 $_march $_mcpu $_pipe"
> >    else
> > -    CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
> > +    CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer -fvisibility=hidden"
> 
> That is the GNU only way for something that is supported on many more
> platforms by using a linker script (with -Wl,--version-script,).
> Only disadvantage is that older binutils versions were broken and
> ignored it for executables.

Note: if anyone was to implement this: make sure not to hide the
_IO_stdin_used symbol, or you will get some really curious effects
(shame on libc developers for resorting to such a hack).


More information about the MPlayer-dev-eng mailing list