[petsc-dev] Symbol visibility

Jed Brown jed at 59A2.org
Mon Dec 6 11:53:41 CST 2010


I'm not convinced that removing the PETSCXXX_DLLEXPORT stuff was a good
thing.  Besides the obvious issues on Windows, it removes the ability to do
proper export control.  This is discussed at length in section 2.2:

http://www.akkadia.org/drepper/dsohowto.pdf#page=17

but the tangible benefit is that distro packagers would be happier because
it allows more robust handling of dependencies.  I realize that it was
unused, but the "export" label has real meaning (even if only as
documentation at this point) in a library context.  Most internal functions
can (and should) be static, but there are a few that need more than file
scope, but still shouldn't be exported.

I understand that it's one more thing, and perhaps the simplicity is worth
it, but I wanted to point out that with those macros, we could have used
(gcc/clang/intel) -fvisibility=hidden and defined the macro to
__attribute__((visibility("default"))).

Jed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20101206/fbb5e9e0/attachment.html>


More information about the petsc-dev mailing list