Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing definitions from 0.9.0 #205

Open
Alfus opened this issue Jun 2, 2023 · 1 comment
Open

Missing definitions from 0.9.0 #205

Alfus opened this issue Jun 2, 2023 · 1 comment

Comments

@Alfus
Copy link
Contributor

Alfus commented Jun 2, 2023

When trying to compile against master I am getting the following linker errors:

Undefined symbols for architecture arm64:
  "cel::base_internal::MessageTypeFieldCount(unsigned long)", referenced from:
      cel::base_internal::LegacyStructType::field_count() const in libdata.a(struct_type.o)
  "cel::interop_internal::ProtoStructValueToMessageWrapper(cel::Value const&)", referenced from:
      cel::interop_internal::ToLegacyValue(google::protobuf::Arena*, cel::Handle<cel::Value> const&, bool) in libinterop.a(interop.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I don't see a definition for the first one:
https://github.com/search?q=repo%3Agoogle%2Fcel-cpp%20MessageTypeFieldCount&type=code

Though the second one seems to be defined here:

ProtoStructValueToMessageWrapper(const Value& value) {

though without the ABSL_ATTRIBUTE_WEAK

@Alfus
Copy link
Contributor Author

Alfus commented Jun 5, 2023

The first one seems to be just missing, the second one seems to be a cycle in the dep graph, that is being 'solved' via ABSL_ATTRIBUTE_WEAK:

// ABSL_ATTRIBUTE_WEAK
//
// Tags a function as weak for the purposes of compilation and linking.
// Weak attributes did not work properly in LLVM's Windows backend before
// 9.0.0, so disable them there. See https://bugs.llvm.org/show_bug.cgi?id=37598
// for further information.
// The MinGW compiler doesn't complain about the weak attribute until the link
// step, presumably because Windows doesn't use ELF binaries.

I suspect the problem with the second one is, the xcode linker used on macos does not respect the weak attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant