Skip to content

multiple definition link time error on some upb symbols #25301

@BusyJay

Description

@BusyJay

What version of gRPC and what language are you using?

1.35.0 and Rust, the project is at https://github.com/tikv/grpc-rs

What operating system (Linux, Windows,...) and version?

Linux

What runtime / compiler are you using (e.g. python version or version of gcc)

clang version 7.0.1-8+deb10u2 (tags/RELEASE_701/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

What did you do?

Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If there’s not enough information to debug the problem, gRPC team may close the issue at their discretion. You’re welcome to re-open the issue once you have a reproduction.
Just compiling tikv/grpc-rs#506 on Linux can reproduce the problem.

What did you expect to see?

It compiles correctly and successfully.

What did you see instead?

It failed with error.
The link contains full error log, but I also quote some lines here for better searching:

/home/runner/work/grpc-rs/grpc-rs/target/debug/build/grpcio-sys-ae1bf4d31b8b3dce/out/build/libupb.a(timestamp.upbdefs.c.o):(.data.rel.local.google_protobuf_timestamp_proto_upbdefinit+0x0): multiple definition of `google_protobuf_timestamp_proto_upbdefinit'
          /home/runner/work/grpc-rs/grpc-rs/target/debug/build/grpcio-sys-ae1bf4d31b8b3dce/out/build/libgrpc.a(timestamp.upbdefs.c.o):(.data.rel.local.google_protobuf_timestamp_proto_upbdefinit+0x0): first defined here
          /home/runner/work/grpc-rs/grpc-rs/target/debug/build/grpcio-sys-ae1bf4d31b8b3dce/out/build/libupb.a(wrappers.upbdefs.c.o):(.data.rel.local.google_protobuf_wrappers_proto_upbdefinit+0x0): multiple definition of `google_protobuf_wrappers_proto_upbdefinit'
          /home/runner/work/grpc-rs/grpc-rs/target/debug/build/grpcio-sys-ae1bf4d31b8b3dce/out/build/libgrpc.a(wrappers.upbdefs.c.o):(.data.rel.local.google_protobuf_wrappers_proto_upbdefinit+0x0): first defined here

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).

See TROUBLESHOOTING.md for how to diagnose problems better.

Anything else we should know about your project / environment?

What it does is simply compile grpc library using cmake, and then link all necessary libraries to build a binary, which includes libgrpc.a and libupb.a. And the reported errors come from these two libraries.

Maybe similar to #23307.

/cc @markdroth

@veblush do you have any suggestions on this? Any help is appreciated.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions