[FFmpeg-devel] Visibility implementation

matthieu castet castet.matthieu
Thu Jul 31 21:53:44 CEST 2008


matthieu castet wrote:
> Michael Niedermayer wrote:
>> On Thu, Jul 31, 2008 at 08:03:50PM +0300, Uoti Urpala wrote:
>>> On Wed, 2008-07-30 at 05:45 +0300, Uoti Urpala wrote:
>>>> The attached patch adds visibility information for lots of symbols in
>>> Does anyone have comments about the substance of the patch (something
>>> more than M?ns's general hostility towards visibility)?
> It can help to do smaller shared library (I am not sure if the 
> visibility stuff hide all internal symbol). But that's a start.
> 
> 
> $ ./configure --enable-shared --extra-cflags="-ffunction-sections 
> -fdata-sections" --extra-ldflags="-Wl,--gc-sections 
> -Wl,--print-gc-sections" --disable-decoders --disable-encoders 
> --disable-muxers
> $size */*.so
>     text    data     bss     dec     hex filename
> 1164633    3576   32556 1200765  12527d libavcodec/libavcodec.so
>    20334     652      12   20998    5206 libavdevice/libavdevice.so
>   481499    9144      32  490675   77cb3 libavformat/libavformat.so
>    41078     300   13876   55254    d7d6 libavutil/libavutil.so
>     8155     388       8    8551    2167 vhook/drawtext.so
>     7135     384      16    7535    1d6f vhook/fish.so
>     2464     316       8    2788     ae4 vhook/null.so
>     5001     376       8    5385    1509 vhook/ppm.so
>     8026     384       8    8418    20e2 vhook/watermark.so
> 
> $ ./configure --enable-shared --disable-decoders --disable-encoders 
> --disable-muxers
> $size */*.so                                text    data     bss     dec 
>      hex filename
> 1270473    3768  545612 1819853  1bc4cd libavcodec/libavcodec.so
>    20334     652      12   20998    5206 libavdevice/libavdevice.so
>   481643    9144      32  490819   77d43 libavformat/libavformat.so
>    41078     300   13876   55254    d7d6 libavutil/libavutil.so
>     8155     388       8    8551    2167 vhook/drawtext.so
>     7135     384      16    7535    1d6f vhook/fish.so
>     2464     316       8    2788     ae4 vhook/null.so
>     5001     376       8    5385    1509 vhook/ppm.so
>     8026     384       8    8418    20e2 vhook/watermark.so
> 
And for information with the same configuration, --gc-sections, 
-fvisibility=hidden + default pragma visibility in public header, I 
manage to a single library (containing libavcodec, libavdevice, ...) :
    text    data     bss     dec     hex filename
5153895   36364 2249092 7439351  7183f7 libavcodec/libavxxx.so

So the current visibility stuff is far from covering everything.


Matthieu




More information about the ffmpeg-devel mailing list