Building DLLs/shared libraries: export and visibility
Arjen Markus
arjen.markus@wldelft.nl
Fri Oct 10 09:31:00 GMT 2008
Janne Blomqvist wrote:
>On Fri, Oct 10, 2008 at 10:36 AM, Arjen Markus <arjen.markus@wldelft.nl> wrote:
>
>
>>for the PLplot project (http://plplot.sf.net) we are trying to create
>>DLLs and shared libraries with selected exported symbols only.
>>For the C libraries, we can use __attribute__((visibility())),
>>at least with recent enough versions of gcc.
>>
>>
>
>Note that with newer versions of gcc it may be less work to make all
>symbols hidden by default with the -fvisibility=hidden option and
>explicitly mark exported symbols with an attribute, rather than going
>the other way around. See
>
>http://gcc.gnu.org/wiki/Visibility
>
>
>
>>What is the equivalent for gfortran? If there is any of course.
>>
>>
>
>There is no equivalent. However, what you can do is to use a linker
>version script, which has the effect of hiding all non-exported
>symbols (the exported symbols are listed in a text file, independent
>of gfortran).
>
>In any case, versioned symbols are just good shared library design, so
>you should do it anyway. See
>
>http://gcc.gnu.org/wiki/SymbolVersioning
>
>and links therein.
>
>
>
Thank you - the compile option and the file with exported routines
should present no difficulties.
Regards,
Arjen
More information about the Fortran
mailing list