Bug 248986

Summary: [JSC] Avoid maintaining a list of hidden stdlib symbols
Product: WebKit Reporter: Elliott Williams <emw>
Component: Tools / TestsAssignee: Elliott Williams <emw>
Status: RESOLVED FIXED    
Severity: Normal CC: simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=248982
https://bugs.webkit.org/show_bug.cgi?id=247388

Description Elliott Williams 2022-12-08 15:50:54 PST
We manually maintain a list of symbols to hide from JavaScriptCore in OTHER_LDFLAGS_HIDE_SYMBOLS, which (as I understand it) prevents us from inadvertently exporting weak symbols for C++ standard library operator instantiations. This is a bit of annoying maintenance, as the symbols we need to hide may change arbitrarily with toolchain updates (recently: https://github.com/WebKit/WebKit/pull/6060, https://github.com/WebKit/WebKit/pull/7352). Can we do anything to avoid the maintenance?

One idea is to have a build step that analyzes object files as they are compiled and produces a list of weak stdlib symbols, which can then be passed to the linker via -unexported_symbols_list.
Comment 1 Radar WebKit Bug Importer 2022-12-08 15:51:12 PST
<rdar://problem/103150469>
Comment 2 Elliott Williams 2023-04-21 13:59:10 PDT
Pull request: https://github.com/WebKit/WebKit/pull/13049
Comment 3 Elliott Williams 2023-05-26 18:20:59 PDT
This commit message got rewritten during landing, so it’s confusingly named, but the code has indeed landed in https://commits.webkit.org/263507@main.