Bug 218453

Summary: libwebrtc.dylib relies on dead code stripping (fails to link if dead code is not stripped in Debug builds)
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: WebRTCAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, eric.carlson, ews-watchlist, glenn, jer.noble, philipj, sergio, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=218315
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description David Kilzer (:ddkilzer) 2020-11-02 10:49:10 PST
libwebrtc.dylib relies on dead code stripping (fails to link if dead code is not stripped in Debug builds).

Found (rediscovered) while working on:

Bug 218315: WebKit should support building with variants other than debug and normal
<https://bugs.webkit.org/show_bug.cgi?id=218315>

See FIXME in Source/ThirdParty/libwebrtc/Configurations/Base.xcconfig.
Comment 1 youenn fablet 2020-11-02 11:04:36 PST
What is the build instruction to trigger that issue?
Comment 2 David Kilzer (:ddkilzer) 2020-11-03 14:19:23 PST
(In reply to youenn fablet from comment #1)
> What is the build instruction to trigger that issue?

Rough steps to reproduce (I didn't try):

1. Apply patch from Bug 218315.

2. In Source/ThirdParty/libwebrtc/Configurations/Base.xcconfig, change "DEAD_CODE_STRIPPING = YES" to "DEAD_CODE_STRIPPING = NO":

  // FIXME: Bug 218453: libwebrtc.dylib fails to link if this value is changed in libwebrtc.xcconfig or changed here for all targets.
- DEAD_CODE_STRIPPING = YES;
+ DEAD_CODE_STRIPPING = NO;

3. Build Release or Debug.  (I don't think it matters which if "DEAD_CODE_STRIPPING = NO" for both.)
Comment 3 David Kilzer (:ddkilzer) 2020-11-03 14:21:28 PST
(In reply to David Kilzer (:ddkilzer) from comment #2)
> (In reply to youenn fablet from comment #1)
> > What is the build instruction to trigger that issue?
> 
> Rough steps to reproduce (I didn't try):

Specifically, this is how I reproduced it while working on Bug 218315, but I did not try it again before posting this info.
Comment 4 youenn fablet 2020-11-04 00:38:49 PST
Thanks, we are probably missing some files that are only used by code that got stripped. Hopefully, we just need to compile this missing files.
Comment 5 youenn fablet 2020-11-04 01:06:41 PST
Created attachment 413144 [details]
Patch
Comment 6 Radar WebKit Bug Importer 2020-11-13 16:21:26 PST
<rdar://problem/71389632>
Comment 7 youenn fablet 2020-11-27 01:04:02 PST
Created attachment 414920 [details]
Patch
Comment 8 youenn fablet 2020-11-27 01:58:33 PST
Created attachment 414926 [details]
Patch
Comment 9 youenn fablet 2020-12-01 06:01:58 PST
Ping review
Comment 10 EWS 2020-12-01 09:46:20 PST
Committed r270305: <https://trac.webkit.org/changeset/270305>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 414926 [details].
Comment 11 David Kilzer (:ddkilzer) 2020-12-01 10:17:25 PST
Thanks Youenn!