Title: [226989] trunk/Source/WebCore
Revision
226989
Author
[email protected]
Date
2018-01-16 11:41:49 -0800 (Tue, 16 Jan 2018)

Log Message

PAL should link to _javascript_Core rather than WTF
https://bugs.webkit.org/show_bug.cgi?id=181683

Reviewed by Konstantin Tokarev.

Source/WebCore:

Do not link directly to _javascript_Core. Get it via PAL.

* CMakeLists.txt:

Source/WebCore/PAL:

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 _javascript_Core is built as a shared
   library
 - Change PAL to link to _javascript_Core 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 _javascript_Core symbols, which is not super desirable.
I came up with a hack yesterday for PAL to link to WTF usually, but link to _javascript_Core
instead if ${_javascript_Core_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 _javascript_Core.

Note: I'm not brave enough to update the XCode build. We can use that to enforce that no
_javascript_Core symbols actually get used, I guess....

* pal/CMakeLists.txt:

Modified Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (226988 => 226989)


--- trunk/Source/WebCore/CMakeLists.txt	2018-01-16 19:26:08 UTC (rev 226988)
+++ trunk/Source/WebCore/CMakeLists.txt	2018-01-16 19:41:49 UTC (rev 226989)
@@ -1077,7 +1077,6 @@
     ${LIBXSLT_LIBRARIES}
     ${SQLITE_LIBRARIES}
     ${ZLIB_LIBRARIES}
-    _javascript_Core${DEBUG_SUFFIX}
     PAL${DEBUG_SUFFIX}
 )
 

Modified: trunk/Source/WebCore/ChangeLog (226988 => 226989)


--- trunk/Source/WebCore/ChangeLog	2018-01-16 19:26:08 UTC (rev 226988)
+++ trunk/Source/WebCore/ChangeLog	2018-01-16 19:41:49 UTC (rev 226989)
@@ -1,3 +1,14 @@
+2018-01-16  Michael Catanzaro  <[email protected]>
+
+        PAL should link to _javascript_Core rather than WTF
+        https://bugs.webkit.org/show_bug.cgi?id=181683
+
+        Reviewed by Konstantin Tokarev.
+
+        Do not link directly to _javascript_Core. Get it via PAL.
+
+        * CMakeLists.txt:
+
 2018-01-16  Zach Li  <[email protected]>
 
         Add pop-up policy support in website policies.

Modified: trunk/Source/WebCore/PAL/ChangeLog (226988 => 226989)


--- trunk/Source/WebCore/PAL/ChangeLog	2018-01-16 19:26:08 UTC (rev 226988)
+++ trunk/Source/WebCore/PAL/ChangeLog	2018-01-16 19:41:49 UTC (rev 226989)
@@ -1,3 +1,32 @@
+2018-01-16  Michael Catanzaro  <[email protected]>
+
+        PAL should link to _javascript_Core rather than WTF
+        https://bugs.webkit.org/show_bug.cgi?id=181683
+
+        Reviewed by Konstantin Tokarev.
+
+        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 _javascript_Core is built as a shared
+           library
+         - Change PAL to link to _javascript_Core 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 _javascript_Core symbols, which is not super desirable.
+        I came up with a hack yesterday for PAL to link to WTF usually, but link to _javascript_Core
+        instead if ${_javascript_Core_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 _javascript_Core.
+
+        Note: I'm not brave enough to update the XCode build. We can use that to enforce that no
+        _javascript_Core symbols actually get used, I guess....
+
+        * pal/CMakeLists.txt:
+
 2018-01-15  Michael Catanzaro  <[email protected]>
 
         Improve use of ExportMacros

Modified: trunk/Source/WebCore/PAL/pal/CMakeLists.txt (226988 => 226989)


--- trunk/Source/WebCore/PAL/pal/CMakeLists.txt	2018-01-16 19:26:08 UTC (rev 226988)
+++ trunk/Source/WebCore/PAL/pal/CMakeLists.txt	2018-01-16 19:41:49 UTC (rev 226989)
@@ -23,7 +23,7 @@
 )
 
 set(PAL_LIBRARIES
-    PRIVATE WTF
+    _javascript_Core${DEBUG_SUFFIX}
 )
 
 WEBKIT_FRAMEWORK_DECLARE(PAL)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to