https://bugs.gentoo.org/917046 https://github.com/protocolbuffers/protobuf/commit/e6f8b9d1026996f6463d4f014d7760256b757227 From e6f8b9d1026996f6463d4f014d7760256b757227 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Wed, 8 Nov 2023 09:20:10 -0800 Subject: [PATCH] message_lite.h: Use PROTOBUF_EXPORT_TEMPLATE_DECLARE with extern template Export extern templates in message_lite.h to avoid missing symbols when linking protobuf-lite.so. PiperOrigin-RevId: 580556084 --- a/src/google/protobuf/message_lite.h +++ b/src/google/protobuf/message_lite.h @@ -616,22 +616,22 @@ namespace internal { template bool MergeFromImpl(absl::string_view input, MessageLite* msg, MessageLite::ParseFlags parse_flags); -extern template bool MergeFromImpl(absl::string_view input, - MessageLite* msg, - MessageLite::ParseFlags parse_flags); -extern template bool MergeFromImpl(absl::string_view input, - MessageLite* msg, - MessageLite::ParseFlags parse_flags); +extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl( + absl::string_view input, MessageLite* msg, + MessageLite::ParseFlags parse_flags); +extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl( + absl::string_view input, MessageLite* msg, + MessageLite::ParseFlags parse_flags); template bool MergeFromImpl(io::ZeroCopyInputStream* input, MessageLite* msg, MessageLite::ParseFlags parse_flags); -extern template bool MergeFromImpl(io::ZeroCopyInputStream* input, - MessageLite* msg, - MessageLite::ParseFlags parse_flags); -extern template bool MergeFromImpl(io::ZeroCopyInputStream* input, - MessageLite* msg, - MessageLite::ParseFlags parse_flags); +extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl( + io::ZeroCopyInputStream* input, MessageLite* msg, + MessageLite::ParseFlags parse_flags); +extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl( + io::ZeroCopyInputStream* input, MessageLite* msg, + MessageLite::ParseFlags parse_flags); struct BoundedZCIS { io::ZeroCopyInputStream* zcis; @@ -641,10 +641,10 @@ struct BoundedZCIS { template bool MergeFromImpl(BoundedZCIS input, MessageLite* msg, MessageLite::ParseFlags parse_flags); -extern template bool MergeFromImpl(BoundedZCIS input, MessageLite* msg, - MessageLite::ParseFlags parse_flags); -extern template bool MergeFromImpl(BoundedZCIS input, MessageLite* msg, - MessageLite::ParseFlags parse_flags); +extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl( + BoundedZCIS input, MessageLite* msg, MessageLite::ParseFlags parse_flags); +extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl( + BoundedZCIS input, MessageLite* msg, MessageLite::ParseFlags parse_flags); template struct SourceWrapper;