Bug 186949 - Adjust UNEXPORTED_SYMBOL_LDFLAGS for LTO
Summary: Adjust UNEXPORTED_SYMBOL_LDFLAGS for LTO
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Rollin
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-06-22 16:27 PDT by Keith Rollin
Modified: 2018-06-25 13:16 PDT (History)
5 users (show)

See Also:


Attachments
Patch (6.68 KB, patch)
2018-06-22 17:01 PDT, Keith Rollin
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews200 for win-future (12.93 MB, application/zip)
2018-06-23 08:15 PDT, EWS Watchlist
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Rollin 2018-06-22 16:27:49 PDT
When building with LTO, WebKit's 'check-for-weak-vtables-and-externals' script reports weak external symbols:

ERROR: WebKit has a weak external symbol in it (.../OpenSource/WebKitBuild/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 __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE
ERROR: symbol __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_14basic_iostreamIcS2_EE
ERROR: symbol __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE16_NS_13basic_ostreamIcS2_EE
ERROR: symbol __ZTTNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
ERROR: symbol __ZTVNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE
ERROR: symbol __ZTVNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
Command /bin/sh failed with exit code 1

Address these by adding those symbols to UNEXPORTED_SYMBOL_LDFLAGS in WebKit.xcconfig.
Comment 1 Radar WebKit Bug Importer 2018-06-22 16:28:00 PDT
<rdar://problem/41386438>
Comment 2 Keith Rollin 2018-06-22 17:01:13 PDT
Created attachment 343398 [details]
Patch
Comment 3 EWS Watchlist 2018-06-23 08:15:30 PDT
Comment on attachment 343398 [details]
Patch

Attachment 343398 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/8304706

New failing tests:
http/tests/security/canvas-remote-read-remote-video-blocked-no-crossorigin.html
Comment 4 EWS Watchlist 2018-06-23 08:15:42 PDT
Created attachment 343435 [details]
Archive of layout-test-results from ews200 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews200  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 5 Keith Rollin 2018-06-25 10:32:44 PDT
This patch affects a *Mac build*, and can't affect a *Windows layout test*.
Comment 6 David Kilzer (:ddkilzer) 2018-06-25 12:41:50 PDT
Comment on attachment 343398 [details]
Patch

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

r=me

> Source/WebKit/Configurations/WebKit.xcconfig:118
> +UNEXPORTED_SYMBOL_LDFLAGS = -Wl,-unexported_symbol -Wl,__ZTISt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTISt9exception -Wl,-unexported_symbol -Wl,__ZTSSt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTSSt9exception -Wl,-unexported_symbol -Wl,__ZdlPvS_ -Wl,-unexported_symbol -Wl,__ZnwmPv -Wl,-unexported_symbol -Wl,__Znwm -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC2EOS4_ -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC1EOS4_ -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEaSEDn -Wl,-unexported_symbol -Wl,__ZNKSt3__18functionIFvN7WebCore12PolicyActionEEEclES2_ -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEE4swapERS4_ -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC1ERKS4_ -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC2ERKS4_ -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEED1Ev -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEED2Ev -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEaSERKS4_ -Wl,-unexported_symbol -Wl,__ZTVNSt3__117bad_function_callE -Wl,-unexported_symbol -Wl,__ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE -Wl,-unexported_symbol -Wl,__ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_14basic_iostreamIcS2_EE -Wl,-unexported_symbol -Wl,__ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE16_NS_13basic_ostreamIcS2_EE -Wl,-unexported_symbol -Wl,__ZTTNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE -Wl,-unexported_symbol -Wl,__ZTVNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE -Wl,-unexported_symbol -Wl,__ZTVNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE -Wl,-unexported_symbol -Wl,__ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE8_NS_13basic_ostreamIcS2_EE;

In the future, this should really be moved to a *.unexp file like was done in WebCore; makes maintenance MUCH easier:
Source/WebCore/Configurations/WebCore.unexp
Comment 7 WebKit Commit Bot 2018-06-25 13:16:11 PDT
Comment on attachment 343398 [details]
Patch

Clearing flags on attachment: 343398

Committed r233168: <https://trac.webkit.org/changeset/233168>
Comment 8 WebKit Commit Bot 2018-06-25 13:16:12 PDT
All reviewed patches have been landed.  Closing bug.