[Ffmpeg-devel] [patch] gcc4 visibility support
Luca Barbato
lu_zero
Fri Jun 2 18:39:20 CEST 2006
Mike Melanson wrote:
>
> Could you explain this a bit? What is meant by "gcc visibility"? A
> cursory review of the patch seems to indicate that public symbols in the
> C files are now qualified with the keyword EXPORTED. What's this all
> about? I haven't heard of this before.
>
gcc-4 added support for -fvisibility*, a way to define if you want
export or not certain symbols marking them with an specific
__attribute__ and defining the default elsewhere. Usually you set the
default to hidden and just mark as visible the symbols you care about.
That's is quite a boon on C++ bloated projects, but is also nice for C libs.
here follows the used car speech about it (from manpages)
-fvisibility=default|internal|hidden|protected
Set the default ELF image symbol visibility to the specified
option---all symbols will be marked with this unless
overridden within the code. Using this feature can very
substantially improve linking and load times of shared object
libraries, produce more optimized code, provide near-perfect
API export and prevent symbol clashes. It is strongly
recommended that you use this in any shared objects you
distribute.
By marking explicitly what's is public api and what's not and enforcing
it you make less likely having programs broken because of internal
changes in ffmpeg beside the other promoted goods.
lu
--
Luca Barbato
Gentoo/linux Gentoo/PPC
http://dev.gentoo.org/~lu_zero
More information about the ffmpeg-devel
mailing list