Currently we are accidentally linking WTF into both libjavascriptcoregtk and libwebkit2gtk, which could in theory cause problems similar to bug #179914. There are only two possible solutions: * Ensure WTF always built as a shared library if JavaScriptCore is built as a shared library * Change PAL to link to JavaScriptCore instead of WTF The problem here is caused by layer hopping. It can never be a problem if each library only links to the next lowest-layered library. The downside is this allows PAL to use JavaScriptCore symbols, which is not super desirable. I came up with a hack yesterday for PAL to link to WTF usually, but link to JavaScriptCore instead if ${JavaScriptCore_LIBRARY_TYPE} MATCHES "SHARED" AND ${WTF_LIBRARY_TYPE} MATCHES "STATIC". But that is getting too complex and introduces more possibility for platform-dependent build failures. Better to just accept that PAL will depend on JavaScriptCore. Note: I'm not brave enough to update the XCode build. We can use that to enforce that no JavaScriptCore symbols actually get used, I guess.
(In reply to Michael Catanzaro from comment #0) > The problem here is caused by layer hopping. It can never be a problem if > each library only links to the next lowest-layered library. Note that, to my knowledge, PAL is the only lib we have that violates this rule.
>Note that, to my knowledge, PAL is the only lib we have that violates this rule. Not at all. WebKit links to WebCore and JSC, and there are more examples in Tools
(In reply to Konstantin Tokarev from comment #2) > >Note that, to my knowledge, PAL is the only lib we have that violates this rule. > > Not at all. WebKit links to WebCore and JSC, and Ah yes, but it shouldn't need to do that. > there are more examples in Tools No doubt :)
Created attachment 331394 [details] Patch
Comment on attachment 331394 [details] Patch It's not right, I should change WebCore to not link directly to JSC now.
Created attachment 331396 [details] Patch
Comment on attachment 331396 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=331396&action=review > Source/WebCore/PAL/pal/CMakeLists.txt:26 > + JavaScriptCore${DEBUG_SUFFIX} In the perfect world it should be PUBLIC if JSC is SHARED and PRIVATE otherwise. Or, it could be specified as PRIVATE here and ports who build JSC as shared can add it as INTERFACE in a separate command. But it's ok in this form for now too.
(In reply to Konstantin Tokarev from comment #7) > In the perfect world it should be PUBLIC if JSC is SHARED and PRIVATE > otherwise. This would be easiest... currently we make almost no use of library dependency visibility, though. Let's explore that in future patches.
Committed r226989: <https://trac.webkit.org/changeset/226989>
<rdar://problem/36552175>