[FFmpeg-devel] Visibility implementation

Michael Niedermayer michaelni
Thu Jul 31 19:32:11 CEST 2008


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
> 
> I created a new version that adds visibility information for most
> libavcodec symbols. This time I split the patch into two parts. The
> first one has the repeated changes per internal header marking them as
> such. The second adds visibility information for some of the symbols
> that are not static but not declared in any header either, adds
> exceptions for some symbols which are declared in libavcodec headers but
> used outside it (mainly in libavformat), and defines the macros used.
> 
> One special case is the ff_inverse symbol. It's defined in dsputil.c but
> declared in libavutil/internal.h and used in the FASTDIV macro. I made
> the symbol hidden, which means FASTDIV will not work outside libavcodec
> as the symbol is not visible outside the library (it's not used
> elsewhere now). If it's supposed to be used for cases where speed
> matters then slower access to a global from another library probably
> isn't good.
> 
> Does anyone have comments about the substance of the patch (something
> more than M?ns's general hostility towards visibility)?

I have no technical objections to the patch, it does make -fPIC code faster,
smaller and i suspect improves linking times.
A technical objection would be if i knew a better solution but i do not,
at least not with current gcc. If its -visibility=hidden was a little smarter,
that is mark all symbols hidden unless they are in a header under /usr/...
then all this could be done much nicer.
But truth is gcc does not treat externs as hidden even with 
-visibility=hidden. thus one has no choice, if hidden is wanted pragma or
attribute must be in the files ...

Besides this i agree with mans that it is very ugly. Also as is the patch
is missing configure changes.

If someone does finish it and applies it, i wont complain, though i
hope that one day gcc will be able to handle a default of hidden that
is useable. Then we can implement it cleanly and drop this in case
someone finished & commited it ...

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080731/08e0ded4/attachment.pgp>



More information about the ffmpeg-devel mailing list