build_ios_libs.sh error

441 views
Skip to first unread message

Nuno Jun

unread,
Sep 27, 2016, 1:16:50 AM9/27/16
to discuss-webrtc
Hi All,

When I execute new script generating static libraries (webrtc/build/ios/build_ios_libs.sh), I get below error. But this used to work at previous version. Any idea on this?

gyp: chromium/src/third_party/jsoncpp/jsoncpp.gyp not found

Maxim Potapov

unread,
Sep 27, 2016, 11:35:01 AM9/27/16
to discuss-webrtc
GYP is deprecated, you should use GN from now. New instructions are here: https://webrtc.org/native-code/ios/

вторник, 27 сентября 2016 г., 8:16:50 UTC+3 пользователь Nuno Jun написал:

Nuno Jun

unread,
Sep 27, 2016, 11:57:01 PM9/27/16
to discuss-webrtc
Thanks for quick response.

I followed exactly as per the instruction but still got same error on the latest version of webrtc. I executed build_ios_libs.sh after running GN to generate ninja project files but got following errors.

Command Prompt> ./build_ios_libs.sh 

Building WebRTC arch: arm

Building framework.

/work/workspace/webrtc/src /work/workspace/webrtc/src/webrtc/build/ios

Updating projects from gyp files...

gyp: chromium/src/third_party/jsoncpp/jsoncpp.gyp not found (cwd: /work/workspace/webrtc/src)


So looks like there is still some code using gyp files in script.


2016년 9월 28일 수요일 오전 12시 35분 1초 UTC+9, Maxim Potapov 님의 말:

Antonis Tsakiridis

unread,
Sep 28, 2016, 3:11:05 PM9/28/16
to discuss-webrtc
I verify that I get the same issue as well after following latest instructions at https://webrtc.org/native-code/ios/ to use GN.

Here's the output for me:

$ ./build_ios_libs.sh 

Building WebRTC arch: arm

Building framework.

~/Documents/telestax/code/webrtc-ios/webrtc_checkout/src ~/Documents/telestax/code/webrtc-ios/webrtc_checkout/src/webrtc/build/ios

Updating projects from gyp files...

gyp: chromium/src/third_party/boringssl/boringssl.gyp not found (cwd: /Users/antonis/Documents/telestax/code/webrtc-ios/webrtc_checkout/src)

gyp: chromium/src/third_party/jsoncpp/jsoncpp.gyp not found (cwd: /Users/antonis/Documents/telestax/code/webrtc-ios/webrtc_checkout/src)


Any hints?

Best regards,
Antonis

Nuno Jun

unread,
Sep 29, 2016, 3:23:07 AM9/29/16
to discuss-webrtc
I just created script to generate fat binaries using libtool and lipo as before build_ios_libs.sh came out and solved this issue. Using libtool you can merge all the libraries into single one under out/Release/obj and you can create fat binary using lipo. Hope this is helpful.

2016년 9월 29일 목요일 오전 4시 11분 5초 UTC+9, Antonis Tsakiridis 님의 말:

Antonis Tsakiridis

unread,
Sep 29, 2016, 3:52:44 AM9/29/16
to discuss-webrtc
Thanks Nuno,

But I still wonder is build_ios_libs.sh still supported? Also, I though this script was supposed to create an iOS framework for a *single* architecture, but browsing the code it seems that it can also build fat libs containing multiple architectures? Is that the case?

Best regards,
Antonis

Nuno Jun

unread,
Sep 29, 2016, 4:01:31 AM9/29/16
to discuss-webrtc
I am not sure if build_ios_libs.sh is still supported but I guess this must be a bug caused by moving GN from GYP as official webrtc page refers to the build_ios_libs.sh.

And you are right that build_ios_libs.sh creates a single fat WebRTC.framework supporting multiple architectures (i368, x64, arm, arm64). Hope this is helpful.


2016년 9월 29일 목요일 오후 4시 52분 44초 UTC+9, Antonis Tsakiridis 님의 말:

Antonis Tsakiridis

unread,
Sep 29, 2016, 4:03:23 AM9/29/16
to discuss-webrtc
Ok thanks a lot Nuno,

Let's wait for the Google folks on whether it's still supported and why we get this error.

Best regards,
Antonis

--

---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/rh9YqNNH23Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/52284eb3-7923-46cf-811d-05c1d77e039f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Antonis Tsakiridis
Lead Developer, Mobile SDKs at TeleStax

Henrik Kjellander

unread,
Oct 4, 2016, 3:07:21 AM10/4/16
to discuss-webrtc, Zeke Chin, kthel...@webrtc.org
+tkchin, kthelgason

Sorry about the poor communication from our side. The build_ios_libs.sh script is currently not working (due to GYP->GN switch) and fixing it is tracked in https://bugs.chromium.org/p/webrtc/issues/detail?id=6372.
We expected to be able to fix it shortly after migrating to GN, but for a variety of reasons we haven't been able to get to it yet.

Please star the bug to follow its progress.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CAM7er2O8ii0O9VCGLrHNHJrwN9VARijX%2B01%3DCqxoAJsR0qKZtQ%40mail.gmail.com.

Antonis Tsakiridis

unread,
Oct 4, 2016, 3:17:47 AM10/4/16
to discuss-webrtc, tkc...@webrtc.org, kthel...@webrtc.org
Thank you for your response Henrik, will keep that in mind. In the meantime I suppose we can use the non-fat WebRTC.Framework generated by the 'rtc_sdk_framework_objc' target of XCode project generated by gn/ninja, right?

Best regards
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.



--
Antonis Tsakiridis
Lead Developer, Mobile SDKs at TeleStax

--

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

Henrik Kjellander

unread,
Oct 4, 2016, 3:21:14 AM10/4/16
to discuss-webrtc, Zeke Chin, kthel...@webrtc.org
On Tue, Oct 4, 2016 at 9:17 AM, Antonis Tsakiridis <antonis.t...@telestax.com> wrote:
Thank you for your response Henrik, will keep that in mind. In the meantime I suppose we can use the non-fat WebRTC.Framework generated by the 'rtc_sdk_framework_objc' target of XCode project generated by gn/ninja, right?

I think so yes. I think the GN target is setup correctly and that it's just the script and packaging that needs to be updated.
 
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/ba5834e9-3163-4fbd-b0d9-03b8274988dc%40googlegroups.com.

Kári Helgason

unread,
Oct 4, 2016, 8:58:13 AM10/4/16
to Henrik Kjellander, discuss-webrtc, Zeke Chin
It's possible to build a fat .Framework simply with the GN targets by specifying `additional_target_cpus=["arm"]` for example, if you want to build for both 64- and 32-bit iOS devices.
There are some issues with getting this to work with x64, however I tested setting `target_cpu="x64"` and `additional_target_cpus=["arm", "arm64"]` to get a fat framework that works both in the simulator and on any device.

Hope this helps! Please report back if you run into issues.

On Tue, Oct 4, 2016 at 9:20 AM, Henrik Kjellander <kjell...@webrtc.org> wrote:

Antonis Tsakiridis

unread,
Oct 4, 2016, 9:04:14 AM10/4/16
to discuss-webrtc, kjell...@webrtc.org, tkc...@webrtc.org
Thanks Kari, that's exactly what we need actually :)

I thought one would need to trigger separate builds (i.e. have to run separate gn/ninja iterations for each arch). Let me try that and get back to you


On Tuesday, October 4, 2016 at 3:58:13 PM UTC+3, Kári Helgason wrote:
It's possible to build a fat .Framework simply with the GN targets by specifying `additional_target_cpus=["arm"]` for example, if you want to build for both 64- and 32-bit iOS devices.
There are some issues with getting this to work with x64, however I tested setting `target_cpu="x64"` and `additional_target_cpus=["arm", "arm64"]` to get a fat framework that works both in the simulator and on any device.

Hope this helps! Please report back if you run into issues.
On Tue, Oct 4, 2016 at 9:20 AM, Henrik Kjellander <kjell...@webrtc.org> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

Antonis Tsakiridis

unread,
Oct 5, 2016, 5:32:40 AM10/5/16
to discuss-webrtc, kjell...@webrtc.org, tkc...@webrtc.org
Tried your suggestion, and actually added x86 for older simulators, here's what I did for future reference:

$ gn gen out/Release-universal --args='target_os="ios" target_cpu="x64" additional_target_cpus=["arm", "arm64", "x86"] is_component_build=false is_debug=false'
Done. Made 1144 targets from 104 files in 1576ms

$ ninja -C out/Release-universal rtc_sdk_framework_objc
ninja: Entering directory `out/Release-universal'
[7504/7504] STAMP obj/webrtc/sdk/rtc_sdk_framework_objc.stamp

$ file out/Release-universal/WebRTC.framework/WebRTC 
out/Release-universal/WebRTC.framework/WebRTC: Mach-O universal binary with 4 architectures
out/Release-universal/WebRTC.framework/WebRTC (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
out/Release-universal/WebRTC.framework/WebRTC (for architecture i386): Mach-O dynamically linked shared library i386
out/Release-universal/WebRTC.framework/WebRTC (for architecture armv7): Mach-O dynamically linked shared library arm
out/Release-universal/WebRTC.framework/WebRTC (for architecture arm64): Mach-O 64-bit dynamically linked shared library

Worked flawlessly!

Thanks a lot,
Antonis Tsakiridis

kthel...@webrtc.org

unread,
Oct 5, 2016, 2:14:31 PM10/5/16
to discuss-webrtc, kjell...@webrtc.org, tkc...@webrtc.org
Glad to hear you were successful. Thanks for reporting back!

Antonis Tsakiridis

unread,
Oct 5, 2016, 2:57:52 PM10/5/16
to discuss-webrtc, kjell...@webrtc.org, tkc...@webrtc.org
Kari, one more thing.

I noticed that indeed when combining all those architectures (arm, arm64, x86, x64) I *must* to specify x64 as target_cpu (and the rest as additional). If instead I use arm as target_cpu (and the others as additional) the gn step fails. Is there a reason for that, or should I open an issue on the bug tracker?

Best regards

kthel...@webrtc.org

unread,
Oct 5, 2016, 3:23:29 PM10/5/16
to discuss-webrtc
Yes, I noticed this as well. This is definitely not intended behaviour, so feel free to file a bug. I will cc the correct people. Thanks!

Antonis Tsakiridis

unread,
Oct 6, 2016, 6:09:01 AM10/6/16
to discuss-webrtc
Great, just did: https://bugs.chromium.org/p/webrtc/issues/detail?id=6493

Thanks for your help!

Nuno Jun

unread,
Oct 6, 2016, 6:11:35 AM10/6/16
to discuss-webrtc
Thanks all,

I just noticed that the latest version (https://chromium.googlesource.com/external/webrtc/+/5fa51e29479ed584a8879363240863152294abd1) supports build_ios_libs.sh again and verified that it works fine now.

However after I edited build_ios_libs.sh to use openssl instead of boringssl, librtc_sdk_objc.a seems to contain libboringssl.a code inside and this produces runtime error. (conflicts with openssl)

I changed GN_BASE_ARGS as following to use openssl for your information. 

GN_BASE_ARGS="target_os=\"ios\" is_debug=false ios_enable_code_signing=false \

rtc_libvpx_build_vp9=false rtc_build_ssl=false rtc_ssl_root=\"/work/workspace/OpenSSL-for-iPhone/include\""


Any hint for this?


Many Thanks,

 - Nuno

Anakros

unread,
Oct 6, 2016, 7:52:13 AM10/6/16
to discuss-webrtc
Has anyone tested the generated build? I got following errors when trying to use functions from RTCSSLAdapter.h

Undefined symbols for architecture x86_64:
 
"_RTCCleanupSSL", referenced from:
      webrtc_test_framework
.ViewController.viewDidLoad () -> () in ViewController.o
 
"_RTCInitializeSSL", referenced from:
      webrtc_test_framework
.ViewController.viewDidLoad () -> () in ViewController.o
ld
: symbol(s) not found for architecture x86_64


Hou Seaman

unread,
Oct 16, 2016, 11:01:23 PM10/16/16
to discuss-webrtc
Whether the problem has been solved?
Reply all
Reply to author
Forward
0 new messages