gRPC + Webrtc (chromium) = boringssl multiple definitions

317 views
Skip to first unread message

kristoffer...@gmail.com

unread,
Jul 26, 2017, 12:30:48 PM7/26/17
to grpc.io
Hello!

I'm trying to compile an application linked against webrtc and grpc, both of which use their own builtin boringssl implementation. Thus I get a multiple definitions error when linking.
Is there a way around this? Am I doing something wrong?

aarch64-linux-gnu-g++ webrtc.pb.o webrtc.grpc.pb.o main.o grpc.o webrtc.o -L./lib/grpc -L./lib/protobuf -L./lib/webrtc -L./lib/webrtc/required -lprotobuf -pthread -lpthread -lgrpc++ -lgrpc -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed -ldl -lwebrtc -lpulse -lX11 -lv4l2 -o webrtc-linux
./lib/webrtc/libwebrtc.a(ssl_x509.o): In function `d2i_SSL_SESSION':
ssl_x509.c:(.text.d2i_SSL_SESSION+0x0): multiple definition of `d2i_SSL_SESSION'
./lib/grpc/libgrpc.a(ssl_asn1.o):/root/grpc_aarch64/third_party/boringssl/ssl/ssl_asn1.c:728: first defined here
./lib/webrtc/libwebrtc.a(ssl_x509.o): In function `SSL_get_peer_certificate':
ssl_x509.c:(.text.SSL_get_peer_certificate+0x0): multiple definition of `SSL_get_peer_certificate'
./lib/grpc/libgrpc.a(ssl_lib.o):/root/grpc_aarch64/third_party/boringssl/ssl/ssl_lib.c:1044: first defined here

(...)


Nicolas Noble

unread,
Jul 27, 2017, 3:12:30 AM7/27/17
to kristoffer...@gmail.com, grpc.io
You can disable building boringssl by specifying EMBED_OPENSSL=false, but you'll need to provide headers for it. 

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/107218ba-4dd7-474c-acb5-6d0605273661%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

kristoffer...@gmail.com

unread,
Jul 27, 2017, 5:37:18 AM7/27/17
to grpc.io, kristoffer...@gmail.com
Thanks Nicolas

I looked around and it seems boringssl is only included because it doesn't find an alternative. And I guess I would have to find a way of mixing them if I needed SSL. But since I'm only using grpc in insecure mode I figured out I could use the static libraries that are "unsecure" versions of grpc, bypassing my entire problem.


torsdag 27. juli 2017 09.12.30 UTC+2 skrev Nicolas Noble følgende:
You can disable building boringssl by specifying EMBED_OPENSSL=false, but you'll need to provide headers for it. 
On Jul 26, 2017 09:30, <kristoffer...@gmail.com> wrote:
Hello!

I'm trying to compile an application linked against webrtc and grpc, both of which use their own builtin boringssl implementation. Thus I get a multiple definitions error when linking.
Is there a way around this? Am I doing something wrong?

aarch64-linux-gnu-g++ webrtc.pb.o webrtc.grpc.pb.o main.o grpc.o webrtc.o -L./lib/grpc -L./lib/protobuf -L./lib/webrtc -L./lib/webrtc/required -lprotobuf -pthread -lpthread -lgrpc++ -lgrpc -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed -ldl -lwebrtc -lpulse -lX11 -lv4l2 -o webrtc-linux
./lib/webrtc/libwebrtc.a(ssl_x509.o): In function `d2i_SSL_SESSION':
ssl_x509.c:(.text.d2i_SSL_SESSION+0x0): multiple definition of `d2i_SSL_SESSION'
./lib/grpc/libgrpc.a(ssl_asn1.o):/root/grpc_aarch64/third_party/boringssl/ssl/ssl_asn1.c:728: first defined here
./lib/webrtc/libwebrtc.a(ssl_x509.o): In function `SSL_get_peer_certificate':
ssl_x509.c:(.text.SSL_get_peer_certificate+0x0): multiple definition of `SSL_get_peer_certificate'
./lib/grpc/libgrpc.a(ssl_lib.o):/root/grpc_aarch64/third_party/boringssl/ssl/ssl_lib.c:1044: first defined here

(...)


--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.

Nicolas Noble

unread,
Jul 27, 2017, 12:41:08 PM7/27/17
to Kristoffer Iversen, grpc.io
That works too :-)

To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.

To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
Reply all
Reply to author
Forward
0 new messages