Alexey Serbin has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/18000 )

Change subject: KUDU-3334 hide protobuf symbols in libkudu_client
......................................................................

KUDU-3334 hide protobuf symbols in libkudu_client

As it turns out, there are conflicts during static initialization of
symbols related to protobuf extensions in an application using
libkudu_client and also linking in libprotobuf on its own.  That
seems to be attributed to the creation of two independent descriptor
pools in such cases [1].  At least, such issues became apparent when
both the application and libkudu_client started using libprotobuf
3.14.0.

One example of an application described above is impalad.  It links in
libkudu_client and libprotobuf: the former is used to talk to Kudu
servers and the latter is necessary to communicate with other Impala's
backend components via KRPC.

This patch adds the --exclude-libs flag for the GNU linker [2] to
completely hide all the symbols inherited by libkudu_client from
libprotobuf which is statically linked into the Kudu C++ library
in case of RELEASE builds.

As for the rest of libraries statically linked into libkudu_client,
it seems no problems encountered so far if those symbols are just made
local using the version script mechanism, so no other libraries are put
under --exclude-libs linker's flag except for libprotobuf.

[1] https://stackoverflow.com/a/29975019
[2] https://www.man7.org/linux/man-pages/man1/ld.1.html

Change-Id: I584e1f726f8a4f368579c2c323a230fe98e29dee
Reviewed-on: http://gerrit.cloudera.org:8080/18000
Tested-by: Kudu Jenkins
Reviewed-by: Attila Bukor <[email protected]>
---
M src/kudu/client/CMakeLists.txt
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Kudu Jenkins: Verified
  Attila Bukor: Looks good to me, approved

--
To view, visit http://gerrit.cloudera.org:8080/18000
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I584e1f726f8a4f368579c2c323a230fe98e29dee
Gerrit-Change-Number: 18000
Gerrit-PatchSet: 5
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>
Gerrit-Reviewer: Attila Bukor <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Wenzhe Zhou <[email protected]>

Reply via email to