Changeset 121762 in webkit


Ignore:
Timestamp:
Jul 3, 2012 6:43:13 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[Qt][Win] Fix broken QtWebKit5.lib linking
https://bugs.webkit.org/show_bug.cgi?id=88321

Patch by Jocelyn Turcotte <jocelyn.turcotte@nokia.com> Joel Dillon <joel.dillon@codethink.co.uk> on 2012-07-03
Reviewed by Kenneth Rohde Christiansen.

Source/JavaScriptCore:

The goal is to have different ports build systems define STATICALLY_LINKED_WITH_WTF
when building JavaScriptCore, if both are packaged in the same DLL, instead
of relying on the code to handle this.
The effects of BUILDING_* and STATICALLY_LINKED_WITH_* are currently the same
except for a check in Source/JavaScriptCore/config.h.

Keeping the old way for the WX port as requested by the port's contributors.
For non-Windows ports there is no difference between IMPORT and EXPORT, no
change is needed.

  • API/JSBase.h: JS symbols shouldn't be included by WTF objects anymore. Remove the export when BUILDING_WTF.
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Make sure that JavaScriptCore uses import symbols of WTF for the Win port.
  • runtime/JSExportMacros.h:

Source/WebCore:

  • platform/PlatformExportMacros.h:

Source/WTF:

Instead of letting a module's headers know which other modules depend on them,
have depending modules define explicitely that they want its symbols exported too.

JavaScriptCore should then be compiled with both BUILDING_JavaScriptCore and
STATICALLY_LINKED_WITH_WTF.

  • wtf/ExportMacros.h:

Tools:

On windows the import/export definition is part of the symbol's signature.
Define STATICALLY_LINKED_WITH_$$library for each dependend module
that is being linked statically to make sure that they can be linked together
later on.

Also do not compile Assertions.cpp in DumpRenderTree anymore since all the
used symbols are exported and it would cause a duplicate symbols error.

  • DumpRenderTree/qt/DumpRenderTree.pro:
  • qmake/mkspecs/features/default_post.prf:
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSBase.h

    r81135 r121762  
    7272#define JS_EXPORT __attribute__((visibility("default")))
    7373#elif defined(WIN32) || defined(_WIN32) || defined(_WIN32_WCE) || defined(__CC_ARM) || defined(__ARMCC__)
    74 #if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF)
     74#if defined(BUILDING_JavaScriptCore) || defined(STATICALLY_LINKED_WITH_JavaScriptCore)
    7575#define JS_EXPORT __declspec(dllexport)
    7676#else
  • trunk/Source/JavaScriptCore/ChangeLog

    r121717 r121762  
     12012-07-03  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>  Joel Dillon <joel.dillon@codethink.co.uk>
     2
     3        [Qt][Win] Fix broken QtWebKit5.lib linking
     4        https://bugs.webkit.org/show_bug.cgi?id=88321
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        The goal is to have different ports build systems define STATICALLY_LINKED_WITH_WTF
     9        when building JavaScriptCore, if both are packaged in the same DLL, instead
     10        of relying on the code to handle this.
     11        The effects of BUILDING_* and STATICALLY_LINKED_WITH_* are currently the same
     12        except for a check in Source/JavaScriptCore/config.h.
     13
     14        Keeping the old way for the WX port as requested by the port's contributors.
     15        For non-Windows ports there is no difference between IMPORT and EXPORT, no
     16        change is needed.
     17
     18        * API/JSBase.h:
     19          JS symbols shouldn't be included by WTF objects anymore. Remove the export when BUILDING_WTF.
     20        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
     21          Make sure that JavaScriptCore uses import symbols of WTF for the Win port.
     22        * runtime/JSExportMacros.h:
     23
    1242012-07-02  Filip Pizlo  <fpizlo@apple.com>
    225
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops

    r120745 r121762  
    88                Name="VCCLCompilerTool"
    99                AdditionalIncludeDirectories="&quot;$(ConfigurationBuildDir)\obj\JavaScriptCore\DerivedSources\&quot;;../../;../../API/;../../parser/;../../bytecompiler/;../../dfg/;../../disassembler;../../jit/;../../llint/;../../runtime/;../../tools/;../../bytecode/;../../interpreter/;../../wtf/;../../profiler;../../assembler/;../../debugger/;../../heap/;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;;&quot;$(ConfigurationBuildDir)\include&quot;;&quot;$(ConfigurationBuildDir)\include\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\include\private&quot;;&quot;$(ConfigurationBuildDir)\include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;"
    10                 PreprocessorDefinitions="__STD_C"
     10                PreprocessorDefinitions="STATICALLY_LINKED_WITH_WTF;__STD_C"
    1111                ForcedIncludeFiles="ICUVersion.h"
    1212        />
  • trunk/Source/JavaScriptCore/runtime/JSExportMacros.h

    r103688 r121762  
    3737#if USE(EXPORT_MACROS)
    3838
    39 #if defined(BUILDING_JavaScriptCore)
     39#if defined(BUILDING_JavaScriptCore) || defined(STATICALLY_LINKED_WITH_JavaScriptCore)
    4040#define JS_EXPORT_PRIVATE WTF_EXPORT
    4141#else
     
    5151#if !PLATFORM(CHROMIUM) && OS(WINDOWS) && !defined(BUILDING_WX__) && !COMPILER(GCC)
    5252
    53 #if defined(BUILDING_JavaScriptCore)
     53#if defined(BUILDING_JavaScriptCore) || defined(STATICALLY_LINKED_WITH_JavaScriptCore)
    5454#define JS_EXPORTDATA __declspec(dllexport)
    5555#else
  • trunk/Source/WTF/ChangeLog

    r121578 r121762  
     12012-07-03  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>  Joel Dillon <joel.dillon@codethink.co.uk>
     2
     3        [Qt][Win] Fix broken QtWebKit5.lib linking
     4        https://bugs.webkit.org/show_bug.cgi?id=88321
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Instead of letting a module's headers know which other modules depend on them,
     9        have depending modules define explicitely that they want its symbols exported too.
     10
     11        JavaScriptCore should then be compiled with both BUILDING_JavaScriptCore and
     12        STATICALLY_LINKED_WITH_WTF.
     13
     14        * wtf/ExportMacros.h:
     15
    1162012-06-29  Tony Chang  <tony@chromium.org>
    217
  • trunk/Source/WTF/wtf/ExportMacros.h

    r119857 r121762  
    6666#endif
    6767
    68 // Currently WTF is embedded statically in JSCore, which exports
    69 // WTF symbols in the JSCore shared library.
    70 // Because of this, we need to make sure that we use WTF_EXPORT
    71 // when building JavaScriptCore as well as WTF.
    72 
    7368// FIXME: When all ports are using the export macros, we should replace
    7469// WTF_EXPORTDATA with WTF_EXPORT_PRIVATE macros.
    75 #if defined(BUILDING_WTF)  || defined(BUILDING_JavaScriptCore)
     70#if defined(BUILDING_WTF) || defined(STATICALLY_LINKED_WITH_WTF) || (PLATFORM(WX) && defined(BUILDING_JavaScriptCore))
    7671#define WTF_EXPORTDATA WTF_EXPORT
    7772#else
     
    8277
    8378#if !PLATFORM(CHROMIUM) && OS(WINDOWS) && !COMPILER(GCC)
    84 #if defined(BUILDING_WTF) || defined(BUILDING_JavaScriptCore)
     79#if defined(BUILDING_WTF) || defined(STATICALLY_LINKED_WITH_WTF)
    8580#define WTF_EXPORTDATA __declspec(dllexport)
    8681#else
     
    9994#endif // USE(EXPORT_MACROS)
    10095
    101 #if defined(BUILDING_WTF)  || defined(BUILDING_JavaScriptCore)
     96#if defined(BUILDING_WTF) || defined(STATICALLY_LINKED_WITH_WTF) || (PLATFORM(WX) && defined(BUILDING_JavaScriptCore))
    10297#define WTF_EXPORT_PRIVATE WTF_EXPORT
    10398#else
  • trunk/Source/WebCore/ChangeLog

    r121756 r121762  
     12012-07-03  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>  Joel Dillon <joel.dillon@codethink.co.uk>
     2
     3        [Qt][Win] Fix broken QtWebKit5.lib linking
     4        https://bugs.webkit.org/show_bug.cgi?id=88321
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * platform/PlatformExportMacros.h:
     9
    1102012-07-03  Philip Rogers  <pdr@google.com>
    211
  • trunk/Source/WebCore/platform/PlatformExportMacros.h

    r102869 r121762  
    3636#if USE(EXPORT_MACROS)
    3737
    38 #if defined(BUILDING_WebCore) || defined(BUILDING_WebKit)
     38#if defined(BUILDING_WebCore) || defined(BUILDING_WebKit) || \
     39    defined(STATICALLY_LINKED_WITH_WebCore) || defined(STATICALLY_LINKED_WITH_WebKit)
    3940#define WEBKIT_EXPORTDATA WTF_EXPORT
    4041#else
     
    4647#if !PLATFORM(CHROMIUM) && OS(WINDOWS) && !defined(BUILDING_WX__) && !COMPILER(GCC)
    4748
    48 #if defined(BUILDING_WebCore) || defined(BUILDING_WebKit)
     49#if defined(BUILDING_WebCore) || defined(BUILDING_WebKit) || \
     50    defined(STATICALLY_LINKED_WITH_WebCore) || defined(STATICALLY_LINKED_WITH_WebKit)
    4951#define WEBKIT_EXPORTDATA __declspec(dllexport)
    5052#else
  • trunk/Tools/ChangeLog

    r121760 r121762  
     12012-07-03  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>  Joel Dillon <joel.dillon@codethink.co.uk>
     2
     3        [Qt][Win] Fix broken QtWebKit5.lib linking
     4        https://bugs.webkit.org/show_bug.cgi?id=88321
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        On windows the import/export definition is part of the symbol's signature.
     9        Define STATICALLY_LINKED_WITH_$$library for each dependend module
     10        that is being linked statically to make sure that they can be linked together
     11        later on.
     12
     13        Also do not compile Assertions.cpp in DumpRenderTree anymore since all the
     14        used symbols are exported and it would cause a duplicate symbols error.
     15
     16        * DumpRenderTree/qt/DumpRenderTree.pro:
     17        * qmake/mkspecs/features/default_post.prf:
     18
    1192012-07-03  Szilard Ledan  <szledan@inf.u-szeged.hu>
    220
  • trunk/Tools/DumpRenderTree/qt/DumpRenderTree.pro

    r118155 r121762  
    3838
    3939SOURCES += \
    40     $${ROOT_WEBKIT_DIR}/Source/WTF/wtf/Assertions.cpp \
    4140    $$PWD/../WorkQueue.cpp \
    4241    DumpRenderTreeQt.cpp \
  • trunk/Tools/qmake/mkspecs/features/default_post.prf

    r121545 r121762  
    213213    }
    214214
     215    # Anything not linking dynamically to QtWebKit should make sure to have its export
     216    # macros syncrhonized with the code that it will be linked with statically.
     217    !contains(QT, webkit) {
     218        DEFINES += STATICALLY_LINKED_WITH_$$library
     219    }
     220
    215221    LIBS = $$existing_libs $$LIBS
    216222}
Note: See TracChangeset for help on using the changeset viewer.