Title: [121261] trunk
Revision
121261
Author
[email protected]
Date
2012-06-26 07:01:12 -0700 (Tue, 26 Jun 2012)

Log Message

[Qt][Win] Symbols are not exported in QtWebKit5.dll
https://bugs.webkit.org/show_bug.cgi?id=88873

Reviewed by Tor Arne Vestbø.

Source/WebKit:

* api.pri: Remove MAKEDLL setting done now in win32/default_post.prf.

Tools:

When linking the target dll make sure to re-export the symbols from
the static libraries marked as export, with the help of a little python
script and a qmake extra compiler.

* Scripts/generate-win32-export-forwards: Added.
* qmake/mkspecs/features/win32/default_post.prf:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (121260 => 121261)


--- trunk/Source/WebKit/ChangeLog	2012-06-26 13:09:25 UTC (rev 121260)
+++ trunk/Source/WebKit/ChangeLog	2012-06-26 14:01:12 UTC (rev 121261)
@@ -1,3 +1,12 @@
+2012-06-26  Simon Hausmann  <[email protected]>
+
+        [Qt][Win] Symbols are not exported in QtWebKit5.dll
+        https://bugs.webkit.org/show_bug.cgi?id=88873
+
+        Reviewed by Tor Arne Vestbø.
+
+        * api.pri: Remove MAKEDLL setting done now in win32/default_post.prf.
+
 2012-06-25  Simon Hausmann  <[email protected]>
 
         Unreviewed build fix: Don't do QT += widgets with Qt 4

Modified: trunk/Source/api.pri (121260 => 121261)


--- trunk/Source/api.pri	2012-06-26 13:09:25 UTC (rev 121260)
+++ trunk/Source/api.pri	2012-06-26 14:01:12 UTC (rev 121261)
@@ -144,8 +144,6 @@
 
 !no_webkit1: WEBKIT += webkit1
 
-!static: DEFINES += QT_MAKEDLL
-
 # ------------- Install rules -------------
 
 haveQt(5) {

Modified: trunk/Tools/ChangeLog (121260 => 121261)


--- trunk/Tools/ChangeLog	2012-06-26 13:09:25 UTC (rev 121260)
+++ trunk/Tools/ChangeLog	2012-06-26 14:01:12 UTC (rev 121261)
@@ -1,3 +1,17 @@
+2012-06-26  Simon Hausmann  <[email protected]>
+
+        [Qt][Win] Symbols are not exported in QtWebKit5.dll
+        https://bugs.webkit.org/show_bug.cgi?id=88873
+
+        Reviewed by Tor Arne Vestbø.
+
+        When linking the target dll make sure to re-export the symbols from
+        the static libraries marked as export, with the help of a little python
+        script and a qmake extra compiler.
+
+        * Scripts/generate-win32-export-forwards: Added.
+        * qmake/mkspecs/features/win32/default_post.prf:
+
 2012-06-25  Jocelyn Turcotte  <[email protected]>
 
         Add a note about hostname completion not working well with --cc completion

Added: trunk/Tools/Scripts/generate-win32-export-forwards (0 => 121261)


--- trunk/Tools/Scripts/generate-win32-export-forwards	                        (rev 0)
+++ trunk/Tools/Scripts/generate-win32-export-forwards	2012-06-26 14:01:12 UTC (rev 121261)
@@ -0,0 +1,48 @@
+#!/usr/bin/env python
+
+#Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+
+#This library is free software; you can redistribute it and/or
+#modify it under the terms of the GNU Library General Public
+#License as published by the Free Software Foundation; either
+#version 2 of the License, or (at your option) any later version.
+
+#This library is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#Library General Public License for more details.
+
+#You should have received a copy of the GNU Library General Public License
+#along with this library; see the file COPYING.LIB.  If not, write to
+#the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+#Boston, MA 02110-1301, USA.
+
+# Extract /EXPORT: linker directives from static library and write it into a
+# separate file as linker pragmas.
+# Usage: generate-win32-export-forwards \path\to\static\library.lib outputfile.cpp
+# Then compile outputfile.cpp into the final .dll and link the static library
+# into the dll.
+
+import subprocess
+import sys
+import re
+
+dumpBin = subprocess.Popen("dumpbin /directives " + sys.argv[1], stdout=subprocess.PIPE, universal_newlines=True);
+
+output, errors = dumpBin.communicate();
+
+exportedSymbolRegexp = re.compile("\s*(?P<symbol>/EXPORT:.+)");
+
+symbols = set()
+
+for line in output.splitlines():
+    match = exportedSymbolRegexp.match(line)
+    if match != None:
+        symbols.add(match.group("symbol"))
+
+print "Forwarding %s symbols from static library %s" % (len(symbols), sys.argv[1])
+
+exportFile = open(sys.argv[2], "w")
+for symbol in symbols:
+    exportFile.write("#pragma comment(linker, \"%s\")\n" % symbol);
+exportFile.close()
Property changes on: trunk/Tools/Scripts/generate-win32-export-forwards
___________________________________________________________________

Added: svn:executable

Modified: trunk/Tools/qmake/mkspecs/features/win32/default_post.prf (121260 => 121261)


--- trunk/Tools/qmake/mkspecs/features/win32/default_post.prf	2012-06-26 13:09:25 UTC (rev 121260)
+++ trunk/Tools/qmake/mkspecs/features/win32/default_post.prf	2012-06-26 14:01:12 UTC (rev 121261)
@@ -18,3 +18,24 @@
 win32-icc: QMAKE_CXXFLAGS += -wd873
 
 load(default_post)
+
+# When creating the target DLL, extract exporting linker directives from
+# all static libraries we're linking into the DLL and make sure they are
+# also exported from the DLL.
+shared:contains(TEMPLATE, lib) {
+    for(target, POST_TARGETDEPS) {
+        libdep = $$find(target, .*\\.lib)
+        exists($$libdep): LIBSWITHEXPORTS += $$libdep
+    }
+}
+
+!isEmpty(LIBSWITHEXPORTS) {
+    exportgen.input = LIBSWITHEXPORTS
+    exportgen.output = exports_${QMAKE_FILE_BASE}.cpp
+    exportgen.commands = python $${ROOT_WEBKIT_DIR}$${QMAKE_DIR_SEP}Tools$${QMAKE_DIR_SEP}Scripts$${QMAKE_DIR_SEP}generate-win32-export-forwards ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
+    exportgen.variable_out = SOURCES
+    QMAKE_EXTRA_COMPILERS += exportgen
+}
+
+# To ensure the Qt export macros are set to dllexport
+contains(TEMPLATE, lib):!contains(QT, webkit): DEFINES += QT_MAKEDLL
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to