You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/05/17 00:17:49 UTC

[GitHub] merlimat opened a new pull request #1794: Create shared library that only exports API symbols

merlimat opened a new pull request #1794: Create shared library that only exports API symbols
URL: https://github.com/apache/incubator-pulsar/pull/1794
 
 
   ### Motivation
   
   Pass the `-fvisibility=hidden -Wl,--exclude-libs,ALL` flags to the linker when creating `libpulsar.so`. That will ensure we hide all symbols that are not part of Pulsar API.
   
   API symbols are explicitely whitelisted with the `#pragma GCC visibility push(default)` and `#pragma GCC visibility pop` directives.
   
   This is critical especially, when compiling a static `libpulsar.so` (that contains all the other dependencies like boost, log4cxx, protobuf, etc..) to avoid conflicts in case an application uses different versions of the same library.
   
   This was already done before open sourcing C++ client lib, though the flags got dropped when the conversion to CMake happened long time back.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services