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

Change subject: KUDU-3804 fix --exclude-libs for libkudu_client
......................................................................

KUDU-3804 fix --exclude-libs for libkudu_client

With [1] which addressed KUDU-3334 came the --exclude-libs linker
directive for libprotobuf.  It seems Kudu used the GNU gold linker
for the majority of supported platforms before relatively recent
update [2], and --exclude-libs worked as expected.  BTW, the GNU gold
linker has been deprecated for some time already, and the binutils
of versions 2.44 and newer no longer contain the gold linker [3].

As mentioned in [4], GNU ld and gold allow --exclude-libs=b to hide b.a,
but ld.lld requires --exclude=libs=b.a.  Since Kudu switched to
thirdparty ld.lld instead of GNU gold since [2], it makes sense to keep
the --exclude-libs linker's directive behaving as expected for all the
linkers that Kudu is able to use.

I compared the list of protobuf symbols exposed by the exported
libkudu_client.so library with and without this patch.  The difference
is below:

  --- /tmp/no-a-suffix.symbols    2026-09-15 15:24:38.125949226 -0700
  +++ /tmp/a-suffix.symbols       2026-09-15 15:22:40.369171889 -0700
  @@ -1,13 +1,5 @@
  -W descriptor_table_google_2fprotobuf_2fany_2eproto_getter()
  -W descriptor_table_google_2fprotobuf_2ftype_2eproto_getter()
  -W descriptor_table_google_2fprotobuf_2fwrappers_2eproto_getter()
  -W descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_getter()
  -W descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto_getter()
   W bool google_breakpad::MinidumpFileWriter::WriteStringCore<char>(char 
const*, unsigned int, MDLocationDescriptor*)
   W bool google_breakpad::MinidumpFileWriter::WriteStringCore<wchar_t>(wchar_t 
const*, unsigned int, MDLocationDescriptor*)
  -R TableStruct_google_2fprotobuf_2fany_2eproto::offsets
  -R TableStruct_google_2fprotobuf_2ftype_2eproto::offsets
  -R TableStruct_google_2fprotobuf_2fwrappers_2eproto::offsets
   T kudu::KuduPartialRow::SetVarchar(kudu::Slice const&, kudu::Slice const&)
   T kudu::KuduPartialRow::SetVarchar(int, kudu::Slice const&)
   T kudu::KuduPartialRow::SetArrayBool(kudu::Slice const&, std::vector<bool, 
std::allocator<bool> > const&, std::vector<bool, std::allocator<bool> > const&)
  @@ -633,8 +625,6 @@
   T kudu::operator!=(kudu::MonoDelta const&, kudu::MonoDelta const&)
   T kudu::operator+(kudu::MonoTime const&, kudu::MonoDelta const&)
   T kudu::operator+(kudu::MonoDelta const&, kudu::MonoDelta const&)
  -R TableStruct_google_2fprotobuf_2fdescriptor_2eproto::offsets
  -R TableStruct_google_2fprotobuf_2fsource_5fcontext_2eproto::offsets
   W boost::exception::~exception()
   W boost::exception::~exception()
   W boost::exception::~exception()
  @@ -1165,9 +1150,4 @@
   V vtable for std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>
   V vtable for std::bad_optional_access
   V vtable for std::_Sp_counted_ptr_inplace<kudu::KuduPartialRow, 
std::allocator<void>, (__gnu_cxx::_Lock_policy)2>
  -D descriptor_table_google_2fprotobuf_2fany_2eproto
  -D descriptor_table_google_2fprotobuf_2fdescriptor_2eproto
  -D descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto
  -D descriptor_table_google_2fprotobuf_2ftype_2eproto
  -D descriptor_table_google_2fprotobuf_2fwrappers_2eproto
   D z_errmsg

[1] https://github.com/apache/kudu/commit/5d39a74a1
[2] https://github.com/apache/kudu/commit/1d789a87a
[3] https://www.phoronix.com/news/GNU-Gold-Linker-Deprecated
[4] https://maskray.me/blog/lld-and-gnu-linker-incompatibilities

Change-Id: I8950dc0d2c0f4b56782f201f417608acd2420025
Reviewed-on: http://gerrit.cloudera.org:8080/24859
Reviewed-by: Michael Smith <[email protected]>
Tested-by: Alexey Serbin <[email protected]>
Reviewed-by: Abhishek Chennaka <[email protected]>
---
M src/kudu/client/CMakeLists.txt
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Michael Smith: Looks good to me, but someone else must approve
  Alexey Serbin: Verified
  Abhishek Chennaka: Looks good to me, approved

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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I8950dc0d2c0f4b56782f201f417608acd2420025
Gerrit-Change-Number: 24859
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Abhishek Chennaka <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Zoltan Martonka <[email protected]>

Reply via email to