Bug 226668

Summary: Weak external symbols found in WebKit.framework with Release+Coverage configuration
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: WebKit2Assignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, darin, eric.carlson, ews-watchlist, glenn, jer.noble, kkinnunen, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 226562    
Bug Blocks:    
Attachments:
Description Flags
Patch v1
none
Patch v2
ews-feeder: commit-queue-
Patch v3
ews-feeder: commit-queue-
Patch v4
ews-feeder: commit-queue-
Patch v5 none

Description David Kilzer (:ddkilzer) 2021-06-04 16:02:13 PDT
Weak external symbols found in WebKit.framework with Release+Coverage configuration:

PhaseScriptExecution Check\ For\ Weak\ VTables\ and\ Externals WebKit.build/Release/WebKit.build/Script-5DF408C5131DD46700130071.sh
    cd Source/WebKit
    /bin/sh -c WebKit.build/Release/WebKit.build/Script-5DF408C5131DD46700130071.sh
ERROR: WebKit has a weak external symbol in it (Release/WebKit.framework/Versions/A/WebKit)
ERROR: A weak external symbol is generated when a symbol is defined in multiple compilation units and is also marked as being exported from the library.
ERROR: A common cause of weak external symbols is when an inline function is listed in the linker export file.
ERROR: symbol _TCCAccessPreflight
ERROR: symbol _TCCAccessPreflightWithAuditToken
Command /bin/sh failed with exit code 1

Follow-up to Bug 226562.
Comment 1 Radar WebKit Bug Importer 2021-06-04 16:03:22 PDT
<rdar://problem/78890081>
Comment 2 David Kilzer (:ddkilzer) 2021-06-04 16:12:07 PDT
Created attachment 430629 [details]
Patch v1
Comment 3 Alex Christensen 2021-06-04 16:16:49 PDT
Comment on attachment 430629 [details]
Patch v1

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

> Source/WebKit/ChangeLog:3
> +        Weak external symbols found in WebKit.framework with Release+Coverage configuration

I'm happy to see activity around coverage.

> Source/WebKit/Configurations/WebKit.unexp:8
> +__ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE

I wonder if these are needed any more.  I'm not sure what use of std::stringstream we have in WebKit.  Maybe we used to.  I can't imagine we are re-exporting its use from ANGLE

> Source/WebKit/Configurations/WebKit.unexp:20
> +# Methods from std::__1::function<void (WebCore::PolicyAction)> class.

These shouldn't be needed any more because we use WTF::Function for that.

> Source/WebKit/Configurations/WebKit.unexp:33
> +# Soft-linked functions in source files.  Most probably have

These should probably instead be moved to a TCCSoftLink.{h, cpp}
Comment 4 David Kilzer (:ddkilzer) 2021-06-05 10:37:48 PDT
Comment on attachment 430629 [details]
Patch v1

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

>> Source/WebKit/Configurations/WebKit.unexp:8
>> +__ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE
> 
> I wonder if these are needed any more.  I'm not sure what use of std::stringstream we have in WebKit.  Maybe we used to.  I can't imagine we are re-exporting its use from ANGLE

There are similar entries in WebCore.unexp.  Let's clean these up in a separate patch.

>> Source/WebKit/Configurations/WebKit.unexp:20
>> +# Methods from std::__1::function<void (WebCore::PolicyAction)> class.
> 
> These shouldn't be needed any more because we use WTF::Function for that.

I'll remove these from UNEXPORTED_SYMBOL_LDFLAGS in Configurations/WebKit.xcconfig.

>> Source/WebKit/Configurations/WebKit.unexp:33
>> +# Soft-linked functions in source files.  Most probably have
> 
> These should probably instead be moved to a TCCSoftLink.{h, cpp}

LOL...thanks for reminding me of the correct way to fix this.  It's been too long!
Comment 5 David Kilzer (:ddkilzer) 2021-06-05 12:06:51 PDT
Created attachment 430655 [details]
Patch v2
Comment 6 David Kilzer (:ddkilzer) 2021-06-05 12:37:47 PDT
Created attachment 430657 [details]
Patch v3
Comment 7 David Kilzer (:ddkilzer) 2021-06-05 12:41:48 PDT
Created attachment 430658 [details]
Patch v4
Comment 8 David Kilzer (:ddkilzer) 2021-06-05 13:08:41 PDT
Created attachment 430659 [details]
Patch v5
Comment 9 EWS 2021-06-06 07:44:53 PDT
Committed r278535 (238533@main): <https://commits.webkit.org/238533@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 430659 [details].