Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Issue 1444323002: Add files required to link with WebRTC for Chromium on iOS. (Closed)

Created:
5 years, 1 month ago by sdefresne
Modified:
5 years ago
CC:
tterriberry_mozilla.com, webrtc-reviews_webrtc.org
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Add files required to link with WebRTC for Chromium on iOS. When building webrtc for Chromium on iOS, rtc::InitCocoaMultiThreading is called from rtc::ThreadManager::ThreadManager, so add the implementation of that method when targetting iOS. Fixes the following link error: FAILED: ../../third_party/llvm-build/Release+Asserts/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.1.sdk -stdlib=libc++ -mios-simulator-version-min=7.0 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.1.sdk -weak_framework WebKit -o "./components_unittests.app/components_unittests" -Wl,-filelist,"./components_unittests.app/components_unittests.rsp" -framework UIKit -framework QuartzCore -framework OpenGLES -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework CFNetwork -framework MobileCoreServices -framework Security -framework SystemConfiguration -lresolv -lsqlite3 -lz Undefined symbols for architecture x86_64: "rtc::InitCocoaMultiThreading()", referenced from: rtc::ThreadManager::ThreadManager() in librtc_base.a(thread.o) ld: symbol(s) not found for architecture x86_64 BUG=551954

Patch Set 1 #

Total comments: 1

Patch Set 2 : Keep gyp & gn in sync #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -1 line) Patch
M webrtc/base/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M webrtc/base/base.gyp View 1 1 chunk +4 lines, -1 line 0 comments Download

Messages

Total messages: 20 (5 generated)
sdefresne
Please take a look.
5 years, 1 month ago (2015-11-16 14:05:45 UTC) #2
kjellander_webrtc
Unless necessary, please don't run all bots for a GN-only change (we're a bit scarce ...
5 years, 1 month ago (2015-11-16 14:56:31 UTC) #3
sdefresne
On 2015/11/16 at 14:56:31, kjellander wrote: > Unless necessary, please don't run all bots for ...
5 years, 1 month ago (2015-11-16 15:50:52 UTC) #4
sdefresne
Could you take another look?
5 years, 1 month ago (2015-11-16 15:51:07 UTC) #5
kjellander_webrtc
lgtm, but I'm adding henrika@ too since I don't know all the details about iOS.
5 years, 1 month ago (2015-11-16 17:46:35 UTC) #7
kjellander_webrtc
On 2015/11/16 17:46:35, kjellander (webrtc) wrote: > lgtm, but I'm adding henrika@ too since I ...
5 years, 1 month ago (2015-11-16 17:47:13 UTC) #8
henrika_webrtc
Sorry, not sure what the goal is here really. In short, I don't know enough ...
5 years, 1 month ago (2015-11-16 18:09:55 UTC) #11
tkchin_webrtc
On 2015/11/16 18:09:55, henrika_webrtc wrote: > Sorry, not sure what the goal is here really. ...
5 years, 1 month ago (2015-11-16 21:12:26 UTC) #12
henrika_webrtc
And AFAIK, there is no media support in Chromium for iOS. What WebRTC APIs shall ...
5 years, 1 month ago (2015-11-17 08:20:39 UTC) #13
sdefresne
On 2015/11/17 at 08:20:39, henrika wrote: > And AFAIK, there is no media support in ...
5 years, 1 month ago (2015-11-17 09:05:05 UTC) #14
tommi
Can you clarify exactly what it is that you're fixing? What is being linked on ...
5 years, 1 month ago (2015-11-17 10:06:11 UTC) #16
sdefresne
On 2015/11/17 at 10:06:11, tommi wrote: > Can you clarify exactly what it is that ...
5 years, 1 month ago (2015-11-17 10:10:34 UTC) #17
kjellander_webrtc
On 2015/11/17 10:10:34, sdefresne wrote: > On 2015/11/17 at 10:06:11, tommi wrote: > > Can ...
5 years ago (2015-11-23 14:31:52 UTC) #18
sdefresne
On 2015/11/23 at 14:31:52, kjellander wrote: > On 2015/11/17 10:10:34, sdefresne wrote: > > On ...
5 years ago (2015-11-23 14:39:43 UTC) #19
sdefresne
5 years ago (2015-11-23 14:40:12 UTC) #20
On 2015/11/23 at 14:39:43, sdefresne wrote:
> On 2015/11/23 at 14:31:52, kjellander wrote:
> > On 2015/11/17 10:10:34, sdefresne wrote:
> > > On 2015/11/17 at 10:06:11, tommi wrote:
> > > > Can you clarify exactly what it is that you're fixing?  What is being
linked
> > > on iOS and for what reasons?
> > > > 
> > > > If this is related to the XML dependency issue in Chromium bug 556433,
then
> > > I'd rather not commit this since that dependency addition is wrong.
> > > > 
> > > > Tagging as not lgtm for now to be sure.
> > > 
> > > I'm fixing the error that is inlined in the CL description.
> > > 
> > > rtc::ThreadManager::ThreadManager() calls rtc::InitCocoaMultiThreading().
The
> > > method rtc::InitCocoaMultiThreading() is defined in
maccocoathreadhelper.mm. If
> > > this file is not build on iOS, then the library rtc_base is incomplete on
iOS
> > > cannot be linked. This does not manifest with gyp because the none of the
client
> > > of rtc_base calls rtc::ThreadManager and the code is dropped at link time,
> > > however, with gn since static_set are used instead of static_library, no
code is
> > > dropped at link time.
> > > 
> > > This is independent of
> > > https://code.google.com/p/chromium/issues/detail?id=556433 (in the sense
that
> > > there is a bug in rtc_base definition in webrtc/base/BUILD.gn that will
stay
> > > present unless fixed even if Chromium stops using WebRTC on iOS).
> > 
> > It seems to make sense to fix this if it's a problem, but how come we don't
get linking 
> > errors when building rtc_unittests (in webrtc/webrtc_tests.gypi) today in
WebRTC then? 
> > It depends on webrtc/base/base_tests.gyp:rtc_base_tests_utils which depends
on webrtc/base/base.gyp:rtc_base.
> 
> I've explained this in comment #14. Answer is
> 
>   Currently with gyp, all unused code ends up discarded at link time, but with
gn they ends up causing link failures.
> 
> TL;DR: gn uses source_set, gyp uses static_library. They do not behave the
same at link time. static_library allow dropping unused code, source_set do not.

You can use "gn help source_set" to get more information on that.

Powered by Google App Engine
This is Rietveld 408576698