Title: [168720] releases/WebKitGTK/webkit-2.4/Source
Revision
168720
Author
g...@gnome.org
Date
2014-05-13 12:31:42 -0700 (Tue, 13 May 2014)

Log Message

Merge 165378 - [GTK] [CMake] Clean up library linking
https://bugs.webkit.org/show_bug.cgi?id=129782

Reviewed by Philippe Normand.

.:

* Source/cmake/OptionsGTK.cmake: Add a macro to wrap all libraries in a list with --whole-archive
so that unused symbols are not dropped. This is useful when building up shared libraries
from convenience libraries.

Source/WebCore:

* PlatformGTK.cmake: Some files are duplicated on the source list of two convenience
libraries. Ensure that they are all compiled into WebCore instead of WebCorePlatformGTK.
Some simply need to be moved to WebCore from WebCorePlatformGTK. Don't try to link
WebCorePlatformGTK against WebCore -- convenience libraries should be able to save
their symbol resolution for the final linking step.

Source/WebKit:

* PlatformGTK.cmake: Use the new macro.

Source/WebKit2:

* PlatformGTK.cmake: Use the new macro.


Conflicts:
	ChangeLog
	Source/WebCore/ChangeLog
	Source/WebKit/ChangeLog
	Source/WebKit2/ChangeLog

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.4/Source/WebCore/PlatformGTK.cmake (168719 => 168720)


--- releases/WebKitGTK/webkit-2.4/Source/WebCore/PlatformGTK.cmake	2014-05-13 19:31:22 UTC (rev 168719)
+++ releases/WebKitGTK/webkit-2.4/Source/WebCore/PlatformGTK.cmake	2014-05-13 19:31:42 UTC (rev 168720)
@@ -112,6 +112,7 @@
     platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp
 
     platform/network/soup/AuthenticationChallengeSoup.cpp
+    platform/network/soup/CertificateInfo.cpp
     platform/network/soup/CookieJarSoup.cpp
     platform/network/soup/CookieStorageSoup.cpp
     platform/network/soup/CredentialStorageSoup.cpp
@@ -138,6 +139,10 @@
     platform/text/TextEncodingDetectorICU.cpp
 
     platform/text/enchant/TextCheckerEnchant.cpp
+
+    platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp
+
+    platform/network/gtk/CredentialBackingStore.cpp
 )
 
 list(APPEND WebCorePlatformGTK_SOURCES
@@ -236,37 +241,6 @@
     platform/gtk/WidgetBackingStoreGtkX11.cpp
     platform/gtk/WidgetGtk.cpp
     platform/gtk/WidgetRenderingContext.cpp
-
-    platform/network/gtk/CredentialBackingStore.cpp
-
-    platform/network/soup/AuthenticationChallengeSoup.cpp
-    platform/network/soup/CertificateInfo.cpp
-    platform/network/soup/CookieJarSoup.cpp
-    platform/network/soup/CookieStorageSoup.cpp
-    platform/network/soup/CredentialStorageSoup.cpp
-    platform/network/soup/DNSSoup.cpp
-    platform/network/soup/NetworkStorageSessionSoup.cpp
-    platform/network/soup/ProxyResolverSoup.cpp
-    platform/network/soup/ProxyServerSoup.cpp
-    platform/network/soup/ResourceErrorSoup.cpp
-    platform/network/soup/ResourceHandleSoup.cpp
-    platform/network/soup/ResourceRequestSoup.cpp
-    platform/network/soup/ResourceResponseSoup.cpp
-    platform/network/soup/SocketStreamHandleSoup.cpp
-    platform/network/soup/SynchronousLoaderClientSoup.cpp
-
-    platform/soup/SharedBufferSoup.cpp
-
-    platform/text/icu/UTextProvider.cpp
-    platform/text/icu/UTextProviderLatin1.cpp
-    platform/text/icu/UTextProviderUTF16.cpp
-    platform/text/LocaleICU.cpp
-    platform/text/TextCodecICU.cpp
-    platform/text/TextEncodingDetectorICU.cpp
-
-    platform/text/enchant/TextCheckerEnchant.cpp
-
-    platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp
 )
 
 if (WTF_USE_GEOCLUE2)

Modified: releases/WebKitGTK/webkit-2.4/Source/WebKit/PlatformGTK.cmake (168719 => 168720)


--- releases/WebKitGTK/webkit-2.4/Source/WebKit/PlatformGTK.cmake	2014-05-13 19:31:22 UTC (rev 168719)
+++ releases/WebKitGTK/webkit-2.4/Source/WebKit/PlatformGTK.cmake	2014-05-13 19:31:42 UTC (rev 168720)
@@ -135,9 +135,10 @@
 # Since the GObjectDOMBindings convenience library exports API that is unused except
 # in embedding applications we need to instruct the linker to link all symbols explicitly.
 list(APPEND WebKit_LIBRARIES
-    -Wl,--whole-archive GObjectDOMBindings -Wl,--no-whole-archive
+    GObjectDOMBindings
     WebCorePlatformGTK
 )
+ADD_WHOLE_ARCHIVE_TO_LIBRARIES(WebKit_LIBRARIES)
 
 set(WebKit_MARSHAL_LIST ${WEBKIT_DIR}/gtk/webkitmarshal.list)
 

Modified: releases/WebKitGTK/webkit-2.4/Source/WebKit2/PlatformGTK.cmake (168719 => 168720)


--- releases/WebKitGTK/webkit-2.4/Source/WebKit2/PlatformGTK.cmake	2014-05-13 19:31:22 UTC (rev 168719)
+++ releases/WebKitGTK/webkit-2.4/Source/WebKit2/PlatformGTK.cmake	2014-05-13 19:31:42 UTC (rev 168720)
@@ -447,9 +447,10 @@
 # Since the GObjectDOMBindings convenience library exports API that is unused except
 # in embedding applications we need to instruct the linker to link all symbols explicitly.
 list(APPEND WebKit2_LIBRARIES
-    -Wl,--whole-archive GObjectDOMBindings -Wl,--no-whole-archive
+    GObjectDOMBindings
     WebCorePlatformGTK
 )
+ADD_WHOLE_ARCHIVE_TO_LIBRARIES(WebKit2_LIBRARIES)
 
 set(WebKit2_MARSHAL_LIST ${WEBKIT2_DIR}/UIProcess/API/gtk/webkit2marshal.list)
 add_custom_command(
@@ -644,11 +645,12 @@
             ${GDK2_INCLUDE_DIRS}
     )
 
-    target_link_libraries(WebKitPluginProcess
+    set(WebKitPluginProcess_LIBRARIES
         ${SharedWebKit2Libraries}
         WebCorePlatformGTK2
-        WebCore
     )
+    ADD_WHOLE_ARCHIVE_TO_LIBRARIES(WebKitPluginProcess_LIBRARIES)
+    target_link_libraries(WebKitPluginProcess ${WebKitPluginProcess_LIBRARIES})
 
     add_dependencies(WebKitPluginProcess WebKit2)
 

Modified: releases/WebKitGTK/webkit-2.4/Source/cmake/OptionsGTK.cmake (168719 => 168720)


--- releases/WebKitGTK/webkit-2.4/Source/cmake/OptionsGTK.cmake	2014-05-13 19:31:22 UTC (rev 168719)
+++ releases/WebKitGTK/webkit-2.4/Source/cmake/OptionsGTK.cmake	2014-05-13 19:31:42 UTC (rev 168720)
@@ -287,3 +287,14 @@
     list(APPEND GObjectIntrospectionTargets ${target_name}-gir)
     set(GObjectIntrospectionTargets ${GObjectIntrospectionTargets} PARENT_SCOPE)
 endmacro()
+
+# CMake does not automatically add --whole-archive when building shared objects from
+# a list of convenience libraries. This can lead to missing symbols in the final output.
+# We add --whole-archive to all libraries manually to prevent the linker from trimming
+# symbols that we actually need later.
+macro(ADD_WHOLE_ARCHIVE_TO_LIBRARIES _list_name)
+    foreach (library IN LISTS ${_list_name})
+      list(APPEND ${_list_name}_TMP -Wl,--whole-archive ${library} -Wl,--no-whole-archive)
+    endforeach ()
+    set(${_list_name} "${${_list_name}_TMP}")
+endmacro()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to