Hi everyone,
I am still trying to support component build for
private_membership third_party library in this
CL, and stumbled into unusual linking errors.
StatusOrHelper is a class in private_membership, and has
three static methods, as follows:
class StatusOrHelper {
public:
// Move type-agnostic error handling to the .cc.
static absl::Status HandleInvalidStatusCtorArg();
static absl::Status HandleNullObjectCtorArg();
static void Crash(const absl::Status& status);
...
}
After marking the
class to support component build by adding component_export, as follows:
class COMPONENT_EXPORT(PRIVATE_MEMBERSHIP_EXPORT) StatusOrHelper { ... }I am getting lld error as undefined symbols for all these three static methods (see build error log), as follows:
ld.lld: error: undefined symbol: rlwe::internal::StatusOrHelper::HandleInvalidStatusCtorArg()
>>> referenced by statusor.h:150 (../../third_party/shell-encryption/src/statusor.h:150)
>>> obj/third_party/private_membership/private_membership/aes_ctr_256_with_fixed_iv.o:(rlwe::StatusOr<std::__Cr::unique_ptr<private_membership::AesCtr256WithFixedIV, std::__Cr::default_delete<private_membership::AesCtr256WithFixedIV> > >::StatusOr(absl::Status const&))
ld.lld: error: undefined symbol: rlwe::internal::StatusOrHelper::HandleNullObjectCtorArg()
>>> referenced by statusor.h:177 (../../third_party/shell-encryption/src/statusor.h:177)
>>> obj/third_party/private_membership/private_membership/aes_ctr_256_with_fixed_iv.o:(rlwe::StatusOr<std::__Cr::unique_ptr<private_membership::AesCtr256WithFixedIV, std::__Cr::default_delete<private_membership::AesCtr256WithFixedIV> > >::StatusOr(std::__Cr::unique_ptr<private_membership::AesCtr256WithFixedIV, std::__Cr::default_delete<private_membership::AesCtr256WithFixedIV>
ld.lld: error: undefined symbol: rlwe::internal::StatusOrHelper::Crash(absl::Status const&)
>>> referenced by statusor.h:218 (../../third_party/shell-encryption/src/statusor.h:218)
>>> obj/third_party/private_membership/private_membership/crypto_utils.o:(rlwe::StatusOr<unsigned int>::ValueOrDie() &&)
I am not sure how these function symbols aren't exported correctly, despite their wrapped class being already exported. Any idea how to fix that? Or any hypothesis what's the root cause here?
Looking forward to hearing from all of you!
-Amr