WebRTC.framework for iOS doesn't seem to export Boring SSL symbols

273 views
Skip to first unread message

Antonis Tsakiridis

unread,
Sep 29, 2016, 11:31:07 AM9/29/16
to discuss-webrtc
Hello all,

I have a dependency on Boring SSL by one of the static libs I'm using in my iOS Application. The problem is that even though WebRTC framework (as generated by the respective ninja target via xcode) includes Boring SSL, still those symbols don't seem to be exported for some very strange reason (I get unresolved symbols during linking)

Some notes:
  • I managed to fix it by also linking against libboringssl.a, but this seems redundant, so I'd like to avoid it
  • Notice that the order I'm using in the linker is: first my dependent lib and then WebRTC.framework, which I think should be the proper way to do it.
  • Before using WebRTC.framework, I was using a static lib for libjingle, and in that case I had no issues at all, so it's like somehow the framework causes this issue
Best regards,
Antonis Tsakiridis

Nuno Jun

unread,
Sep 29, 2016, 10:49:27 PM9/29/16
to discuss-webrtc
Hi,

Check the symbol from WebRTC framework by "nm" and make sure that the symbol that you use is compiled as "T" not "t". If it is shown as "t", linking that symbol is not allowed as those symbols are not global. WebRTC tends to hide native functions that are not exposed as objective c library and Java JNI interface and hides those symbols using "fvisibility=hidden" option.

"fvisibility" option could be controlled by editing src/build/common.gypi but GYP has moved to GN so you will need to find somewhere else.

Hope this is helpful.


2016년 9월 30일 금요일 오전 12시 31분 7초 UTC+9, Antonis Tsakiridis 님의 말:

Nuno Jun

unread,
Sep 30, 2016, 2:32:52 AM9/30/16
to discuss-webrtc
You can set the fvisibility compile option globally by editing src/build/config/BUILDCONFIG.gn and change 

symbol_visibility_hidden to symbol_visibility_default. After changing it, compile again then this issue should be solved. 

Antonis Tsakiridis

unread,
Sep 30, 2016, 3:15:08 AM9/30/16
to discuss-webrtc
Thanks a lot of checking that Nuno, Will try!

Antonis Tsakiridis

unread,
Oct 5, 2016, 6:24:37 AM10/5/16
to discuss-webrtc
Hi Nuno, 

Just tried your suggestion and although the unresolved symbols are much less, there still are some that break the linking phase :(. With previous setting (i.e. symbol_visibility_hidden) I get 65 boringssl unresolved symbols, while with new setting (i.e. symbol_visibility_default) I get 6 boringssl unresolved symbols:

Undefined symbols for architecture armv7:
  "_X509_verify_cert_error_string", referenced from:
      _tls_verify_cb in libsofia-sip-ua.a(tport_tls.o)
  "_SSL_load_client_CA_file", referenced from:
      _tls_init_master in libsofia-sip-ua.a(tport_tls.o)
  "_SSL_CTX_use_certificate_file", referenced from:
      _tls_init_context in libsofia-sip-ua.a(tport_tls.o)
  "_SSL_CTX_set_default_passwd_cb", referenced from:
      _tls_init_context in libsofia-sip-ua.a(tport_tls.o)
  "_SSL_CTX_set_default_passwd_cb_userdata", referenced from:
      _tls_init_context in libsofia-sip-ua.a(tport_tls.o)
  "_SSL_CTX_use_PrivateKey_file", referenced from:
      _tls_init_context in libsofia-sip-ua.a(tport_tls.o)

I tried to see if these symbols are indeed there using 'strings' command and indeed I can see that in the webrtc lib they are missing, while in the libboringssl.a they are there. Any ideas what might be the issue? Also tried to see if there's another option apart from symbol_visibility_default, but gcc docs suggest that with 'default' everything is public.

Best regards,
Antonis
Reply all
Reply to author
Forward
0 new messages