Bug 211751

Summary: Replace isNullFunctionPointer with real weak-linking support
Product: WebKit Reporter: Jer Noble <jer.noble>
Component: New BugsAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, eric.carlson, ews-watchlist, glenn, hta, mitz, philipj, sam, sergio, tommyw, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Jer Noble 2020-05-11 15:49:51 PDT
Replace isNullFunctionPointer with real weak-linking support
Comment 1 Jer Noble 2020-05-11 16:13:15 PDT
Created attachment 399065 [details]
Patch
Comment 2 Sam Weinig 2020-05-12 08:53:57 PDT
What this change adds is what is commonly called "soft" linking, at least in macOS parlance, not weak linking. This doesn't seem like the right direction to go in to me.
Comment 3 Jer Noble 2020-05-13 08:43:17 PDT
(In reply to Sam Weinig from comment #2)
> What this change adds is what is commonly called "soft" linking, at least in
> macOS parlance, not weak linking. This doesn't seem like the right direction
> to go in to me.

There's a crucial difference: this patch doesn't load symbols at runtime; it only checks whether those symbols were loaded at process launch.
Comment 4 Jer Noble 2020-05-13 09:12:05 PDT
Created attachment 399269 [details]
Patch
Comment 5 Jer Noble 2020-05-13 09:30:33 PDT
Created attachment 399273 [details]
Patch
Comment 6 Sam Weinig 2020-05-13 13:44:34 PDT
Comment on attachment 399273 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=399273&action=review

> Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:37
> +WTF_WEAK_LINK_FORCE_IMPORT(webrtc::setApplicationStatus);

Interesting. I couldn't get this to work when I tried.
Comment 7 EWS 2020-05-13 13:49:29 PDT
Committed r261651: <https://trac.webkit.org/changeset/261651>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 399273 [details].
Comment 8 Radar WebKit Bug Importer 2020-05-13 13:50:15 PDT
<rdar://problem/63198533>
Comment 9 mitz 2020-05-13 13:51:38 PDT
(In reply to Sam Weinig from comment #6)
> Comment on attachment 399273 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=399273&action=review
> 
> > Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:37
> > +WTF_WEAK_LINK_FORCE_IMPORT(webrtc::setApplicationStatus);
> 
> Interesting. I couldn't get this to work when I tried.

I think that thing that doesn’t work is redeclaring member functions like this. webrtc ::setApplicationStatus isn’t a member function.