RESOLVED FIXED 167282
JavaScriptCore has a weak external symbol in it
https://bugs.webkit.org/show_bug.cgi?id=167282
Summary JavaScriptCore has a weak external symbol in it
Shuan Zhao
Reported 2017-01-21 02:05:41 PST
ERROR: JavaScriptCore has a weak external symbol in it (/Users/hoolai/Library/Developer/Xcode/DerivedData/WebKit-ehpvmnqmihxdvndqudiokzoxdfuu/Build/Products/Debug/JavaScriptCore.framework/Versions/A/JavaScriptCore) 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 automatically hidden __ZTVN3JSC8Debugger15ProfilingClientE
Attachments
[PATCH] Proposed Fix (1.72 KB, patch)
2017-01-22 22:16 PST, Joseph Pecoraro
no flags
Alexey Proskuryakov
Comment 1 2017-01-21 23:29:17 PST
I don't think that we've seen this particular error. What version of Xcode are you building with?
Shuan Zhao
Comment 2 2017-01-21 23:32:26 PST
I'm using Xcode Version 8.2.1 (8C1002)
Alexey Proskuryakov
Comment 3 2017-01-21 23:52:10 PST
Our bots have version 8.2, which is unlikely to be different in this regard. What command do you build with?
Shuan Zhao
Comment 4 2017-01-22 00:14:51 PST
I just open the workspace file with Xcode, and select the JavaScriptCore target. I have changed the Mach-O Type to static library to run on iOS with my own app. Error was reported for debug build. I can make the release build successfully.
Joseph Pecoraro
Comment 5 2017-01-22 18:41:47 PST
This seems like an issue that I used to see in the past that was solved by newer compilers. In any case, it sounds like we can just make the destructor: virtual ~ProfilingClient() { } Not be inlined to solve this. I'll try to reproduce myself tonight, but I'll just throw up a patch anyways.
Joseph Pecoraro
Comment 6 2017-01-22 22:14:00 PST
With: $ xcrun clang++ -v Apple LLVM version 8.1.0 (clang-802.0.21.2) I only see these weak externals: $ nm -m $build/Release/JavaScriptCore.framework/JavaScriptCore | grep 'weak external' (undefined) weak external __ZdaPv (from libc++) (undefined) weak external __ZdlPv (from libc++) (undefined) weak external __Znam (from libc++) (undefined) weak external __Znwm (from libc++) So I guess I can go ahead speculatively here, seems harmless.
Joseph Pecoraro
Comment 7 2017-01-22 22:16:29 PST
Created attachment 299500 [details] [PATCH] Proposed Fix
Joseph Pecoraro
Comment 8 2017-01-22 22:17:03 PST
Shuan, since I can't reproduce but you can, would you be willing to try the attached patch (very basic) and see if it solves the problem for you?
Shuan Zhao
Comment 9 2017-01-22 22:20:19 PST
Ok, I'll try it and report my result later.
Shuan Zhao
Comment 10 2017-01-22 23:35:47 PST
The patch solved my problem. Thanks for you work.
Yusuke Suzuki
Comment 11 2017-01-23 02:18:28 PST
Comment on attachment 299500 [details] [PATCH] Proposed Fix ok, r=me
WebKit Commit Bot
Comment 12 2017-01-23 02:42:58 PST
Comment on attachment 299500 [details] [PATCH] Proposed Fix Clearing flags on attachment: 299500 Committed r211037: <http://trac.webkit.org/changeset/211037>
WebKit Commit Bot
Comment 13 2017-01-23 02:43:02 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.