Title: [150008] trunk
Revision
150008
Author
[email protected]
Date
2013-05-13 06:55:31 -0700 (Mon, 13 May 2013)

Log Message

[GTK] Use WebCore layer archives for TestWebCore, WebKitPluginProcess
https://bugs.webkit.org/show_bug.cgi?id=115918

Reviewed by Gustavo Noronha Silva.

Source/WebKit2: 

Due to layer violations and circular dependencies the WebKitPluginProcess requires for the
libraries containing the built code of the intertwining Platform and WebCore layers to be
specified multiple times when linking. This can be avoided by packing the two layers' archives
into one big archive, named after the WebCore layer due to no clear boundary between it and the
Platform layer. The big archive can then be specified only once when linking, simplifying the code
and suppressing all the layering violations so they do not cause build problems.

First the libtool libraries that the WebCore layer (as required by the WebKitPluginProcess) depends on
are specified. These are then used as dependencies for the archive creation rule as well as the list
from which the archive file paths are constructed and then used to dump the member files from these archives.
The member files are then added to the big archive. The latter is added to the list of libraries the
WebKitPluginProcess requires to successfully link.

* GNUmakefile.am:

Tools: 

Due to layer violations and circular dependencies the TestWebCores requires for the libraries containing
the built code of the intertwining Platform and WebCore layers to be specified multiple times when linking.
This can be avoided by packing the two layers' archives into one big archive, named after the WebCore layer
due to no clear boundary between it and the Platform layer. The big archive can then be specified only once
when linking, simplifying the code and suppressing all the layering violations so they do not cause build
problems.

First the libtool libraries that the WebCore layer (as required by the TestWebCore) depends on are specified.
These are then used as dependencies for the archive creation rule as well as the list from which the archive
file paths are constructed and then used to dump the member files from these archives. The member files are
then added to the big archive. The latter is added to the list of libraries the TestWebCore requires to
successfully link.

* TestWebKitAPI/GNUmakefile.am:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (150007 => 150008)


--- trunk/Source/WebKit2/ChangeLog	2013-05-13 13:52:38 UTC (rev 150007)
+++ trunk/Source/WebKit2/ChangeLog	2013-05-13 13:55:31 UTC (rev 150008)
@@ -1,3 +1,25 @@
+2013-05-13  Zan Dobersek  <[email protected]>
+
+        [GTK] Use WebCore layer archives for TestWebCore, WebKitPluginProcess
+        https://bugs.webkit.org/show_bug.cgi?id=115918
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Due to layer violations and circular dependencies the WebKitPluginProcess requires for the
+        libraries containing the built code of the intertwining Platform and WebCore layers to be
+        specified multiple times when linking. This can be avoided by packing the two layers' archives
+        into one big archive, named after the WebCore layer due to no clear boundary between it and the
+        Platform layer. The big archive can then be specified only once when linking, simplifying the code
+        and suppressing all the layering violations so they do not cause build problems.
+
+        First the libtool libraries that the WebCore layer (as required by the WebKitPluginProcess) depends on
+        are specified. These are then used as dependencies for the archive creation rule as well as the list
+        from which the archive file paths are constructed and then used to dump the member files from these archives.
+        The member files are then added to the big archive. The latter is added to the list of libraries the
+        WebKitPluginProcess requires to successfully link.
+
+        * GNUmakefile.am:
+
 2013-05-13  Zalan Bujtas  <[email protected]>
 
         WebProcess consuming very high CPU on linkedin.com

Modified: trunk/Source/WebKit2/GNUmakefile.am (150007 => 150008)


--- trunk/Source/WebKit2/GNUmakefile.am	2013-05-13 13:52:38 UTC (rev 150007)
+++ trunk/Source/WebKit2/GNUmakefile.am	2013-05-13 13:55:31 UTC (rev 150008)
@@ -592,6 +592,32 @@
 endif
 $(plugin_process_for_dep): $(plugin_process_for_dep_list)
 
+webcore_layer_gtk2_deps = \
+	libPlatform.la \
+	libPlatformGtk2.la \
+	libWebCorePlatform.la \
+	libWebCoreGtk2.la \
+	libWebCore.la \
+	libWebCoreModules.la
+if ENABLE_SVG
+webcore_layer_gtk2_deps += \
+	libWebCoreSVG.la
+endif
+if ENABLE_INDEXED_DATABASE
+webcore_layer_gtk2_deps += \
+	libLevelDB.la
+endif
+if USE_OPENGL
+webcore_layer_gtk2_deps += \
+	libANGLE.la
+endif
+
+webcore_layer_gtk2_archives = $(foreach lib, $(webcore_layer_gtk2_deps), $(shell echo $(lib) | sed "s/\(.*\)\.la/.libs\/\1.a/"))
+
+WebCoreLayerGtk2.a: $(webcore_layer_gtk2_deps)
+	$(AM_V_GEN)
+	$(AM_V_at)$(foreach archive, $(webcore_layer_gtk2_archives), $(shell ar t $(archive) | xargs -n50 ar cruT $@))
+
 Programs_WebKitPluginProcess_CPPFLAGS = \
 	-include $(srcdir)/Source/WebKit2/WebKit2Prefix.h \
 	-I$(srcdir)/Source/WebKit2 \
@@ -649,59 +675,9 @@
 
 Programs_WebKitPluginProcess_LDADD = \
 	-lpthread \
-	libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@[email protected]
-
-# FIXME: Due to layer violations and circular dependencies all these libraries have to be specified multiple times
-# when invoking the linker. This ensures any undefined symbols are resolved when linking. See wkb.ug/114901 for more detail.
-# First time around these libraries are simply listed by their file name that's later resolved to the path of the *.a archive
-# (i.e. .libs/libPlatformGtk2.a) by libtool.
-Programs_WebKitPluginProcess_LDADD += \
-	libPlatformGtk2.la \
-	libWebCoreGtk2.la \
-	libPlatform.la \
-	libWebCorePlatform.la \
-	libWebCore.la \
-	libWebCoreModules.la \
-	libWebKit2Platform.la
-if ENABLE_INDEXED_DATABASE
-Programs_WebKitPluginProcess_LDADD += \
-	libLevelDB.la
-endif
-if USE_OPENGL
-Programs_WebKitPluginProcess_LDADD += \
-	libANGLE.la
-endif
-if ENABLE_SVG
-Programs_WebKitPluginProcess_LDADD += \
-	libWebCoreSVG.la
-endif
-
-# FIXME: Second time around all the libraries are relisted, this time in the -lNAME form. Listed items are resolved into the
-# absolute paths to the *.a archive (i.e. $(abs_builddir)/.libs.libPlatformGtk2.a) by libtool.
-Programs_WebKitPluginProcess_LDADD += \
-	-lPlatformGtk2 -lWebCoreGtk2 -lPlatform -lWebCorePlatform -lWebCore -lWebCoreModules
-if ENABLE_INDEXED_DATABASE
-Programs_WebKitPluginProcess_LDADD += \
-	-lLevelDB
-endif
-if USE_OPENGL
-Programs_WebKitPluginProcess_LDADD += \
-	-lANGLE
-endif
-if ENABLE_SVG
-Programs_WebKitPluginProcess_LDADD += \
-	-lWebCoreSVG
-endif
-
-# FIXME: To make the matter worse, these four libraries are again required to be listed for linking. This time they're added by
-# specifying the symbolic link that points back to the ./lib*.la libtool archives which are again resolved into paths to the
-# *.a archives (i.e. .libs/libPlatformGtk2.la) by libtool. Phony targets are added for these files to prevent Automake to try
-# to build them as these symlinks are just a byproduct of libtool.
-.PHONY : .libs/libPlatformGtk2.la .libs/libWebCoreGtk2.la .libs/libPlatform.la .libs/libWebCorePlatform.la
-Programs_WebKitPluginProcess_LDADD += \
-	.libs/libPlatformGtk2.la .libs/libWebCoreGtk2.la .libs/libPlatform.la .libs/libWebCorePlatform.la
-
-Programs_WebKitPluginProcess_LDADD += \
+	libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@[email protected] \
+	WebCoreLayerGtk2.a \
+	libWebKit2Platform.la \
 	$(CAIRO_LIBS) \
 	$(COVERAGE_LDFLAGS) \
 	$(FREETYPE_LIBS) \

Modified: trunk/Tools/ChangeLog (150007 => 150008)


--- trunk/Tools/ChangeLog	2013-05-13 13:52:38 UTC (rev 150007)
+++ trunk/Tools/ChangeLog	2013-05-13 13:55:31 UTC (rev 150008)
@@ -1,3 +1,25 @@
+2013-05-13  Zan Dobersek  <[email protected]>
+
+        [GTK] Use WebCore layer archives for TestWebCore, WebKitPluginProcess
+        https://bugs.webkit.org/show_bug.cgi?id=115918
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Due to layer violations and circular dependencies the TestWebCores requires for the libraries containing
+        the built code of the intertwining Platform and WebCore layers to be specified multiple times when linking.
+        This can be avoided by packing the two layers' archives into one big archive, named after the WebCore layer
+        due to no clear boundary between it and the Platform layer. The big archive can then be specified only once
+        when linking, simplifying the code and suppressing all the layering violations so they do not cause build
+        problems.
+
+        First the libtool libraries that the WebCore layer (as required by the TestWebCore) depends on are specified.
+        These are then used as dependencies for the archive creation rule as well as the list from which the archive
+        file paths are constructed and then used to dump the member files from these archives. The member files are
+        then added to the big archive. The latter is added to the list of libraries the TestWebCore requires to
+        successfully link.
+
+        * TestWebKitAPI/GNUmakefile.am:
+
 2013-05-13  Anders Carlsson  <[email protected]>
 
         Remove UnusedParam.h

Modified: trunk/Tools/TestWebKitAPI/GNUmakefile.am (150007 => 150008)


--- trunk/Tools/TestWebKitAPI/GNUmakefile.am	2013-05-13 13:52:38 UTC (rev 150007)
+++ trunk/Tools/TestWebKitAPI/GNUmakefile.am	2013-05-13 13:55:31 UTC (rev 150008)
@@ -93,69 +93,45 @@
 Programs_TestWebKitAPI_TestJavaScriptCore_SOURCES = \
 	Tools/TestWebKitAPI/Tests/_javascript_Core/VMInspector.cpp
 
-Programs_TestWebKitAPI_TestWebCore_CPPFLAGS = \
-	$(Libraries_libTestWebKitAPIMain_la_CPPFLAGS) \
-	-I$(top_builddir)/DerivedSources/WebCore/include
-
-Programs_TestWebKitAPI_TestWebCore_CXXFLAGS = \
-	$(global_cxxflags)
-
-Programs_TestWebKitAPI_TestWebCore_LDADD = \
-	Libraries/libTestWebKitAPIMain.la \
-	Libraries/libgtest.la \
-	libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@[email protected] \
-	libWTF.la
-
-# FIXME: Due to layer violations and circular dependencies all these libraries have to be specified multiple times
-# when invoking the linker. This ensures any undefined symbols are resolved when linking. See wkb.ug/114901 for more detail.
-# First time around these libraries are simply listed by their file name that's later resolved to the path of the *.a archive
-# (i.e. .libs/libPlatformGtk2.a) by libtool.
-Programs_TestWebKitAPI_TestWebCore_LDADD += \
-	libPlatformGtk.la \
-	libWebCoreGtk.la \
+webcore_layer_deps = \
 	libPlatform.la \
+	libPlatformGtk.la \
 	libWebCorePlatform.la \
+	libWebCoreGtk.la \
 	libWebCore.la \
 	libWebCoreModules.la
-if ENABLE_INDEXED_DATABASE
-Programs_TestWebKitAPI_TestWebCore_LDADD += \
-	libLevelDB.la
-endif
-if USE_OPENGL
-Programs_TestWebKitAPI_TestWebCore_LDADD += \
-	libANGLE.la
-endif
 if ENABLE_SVG
-Programs_TestWebKitAPI_TestWebCore_LDADD += \
+webcore_layer_deps += \
 	libWebCoreSVG.la
 endif
-
-# FIXME: Second time around all the libraries are relisted, this time in the -lNAME form. Listed items are resolved into the
-# absolute paths to the *.a archive (i.e. $(abs_builddir)/.libs.libPlatformGtk2.a) by libtool.
-Programs_TestWebKitAPI_TestWebCore_LDADD += \
-	-lPlatformGtk -lWebCoreGtk -lPlatform -lWebCorePlatform -lWebCore -lWebCoreModules
 if ENABLE_INDEXED_DATABASE
-Programs_TestWebKitAPI_TestWebCore_LDADD += \
-	-lLevelDB
+webcore_layer_deps += \
+	libLevelDB.la
 endif
 if USE_OPENGL
-Programs_TestWebKitAPI_TestWebCore_LDADD += \
-	-lANGLE
+webcore_layer_deps += \
+	libANGLE.la
 endif
-if ENABLE_SVG
-Programs_TestWebKitAPI_TestWebCore_LDADD += \
-	-lWebCoreSVG
-endif
 
-# FIXME: To make the matter worse, these four libraries are again required to be listed for linking. This time they're added by
-# specifying the symbolic link that points back to the ./lib*.la libtool archives which are again resolved into paths to the
-# *.a archives (i.e. .libs/libPlatformGtk2.la) by libtool. Phony targets are added for these files to prevent Automake to try
-# to build them as these symlinks are just a byproduct of libtool.
-.PHONY : .libs/libPlatformGtk.la .libs/libWebCoreGtk.la .libs/libPlatform.la .libs/libWebCorePlatform.la
-Programs_TestWebKitAPI_TestWebCore_LDADD += \
-	.libs/libWebCoreGtk.la .libs/libPlatformGtk.la .libs/libPlatform.la .libs/libWebCorePlatform.la
+webcore_layer_archives = $(foreach lib, $(webcore_layer_deps), $(shell echo $(lib) | sed "s/\(.*\)\.la/.libs\/\1.a/"))
 
-Programs_TestWebKitAPI_TestWebCore_LDADD += \
+WebCoreLayer.a: $(webcore_layer_deps)
+	$(AM_V_GEN)
+	$(AM_V_at)$(foreach archive, $(webcore_layer_archives), $(shell ar t $(archive) | xargs -n50 ar cruT $@))
+
+Programs_TestWebKitAPI_TestWebCore_CPPFLAGS = \
+	$(Libraries_libTestWebKitAPIMain_la_CPPFLAGS) \
+	-I$(top_builddir)/DerivedSources/WebCore/include
+
+Programs_TestWebKitAPI_TestWebCore_CXXFLAGS = \
+	$(global_cxxflags)
+
+Programs_TestWebKitAPI_TestWebCore_LDADD = \
+	Libraries/libTestWebKitAPIMain.la \
+	Libraries/libgtest.la \
+	libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@[email protected] \
+	libWTF.la \
+	WebCoreLayer.a \
 	$(CAIRO_LIBS) \
 	$(CLUTTER_LIBS) \
 	$(FREETYPE_LIBS) \
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to