[Ffmpeg-devel] [patch] gcc4 visibility support
Roman Shaposhnick
rvs
Fri Jun 2 20:05:24 CEST 2006
On Fri, Jun 02, 2006 at 06:39:20PM +0200, Luca Barbato wrote:
> 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.
It sounds like the same effect could be achieved with linker map files,
which not only is portable across compilers but also keeps the source
clean.
Thanks,
Roman.
More information about the ffmpeg-devel
mailing list