Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8270479

WebKit 612.1 build fails with Visual Studio 2017

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2
    • jfx18
    • jfx11, 8, jfx18
    • javafx
    • Windows 10
      Visual Studio 2017 15.9.24

    • web

    Backports

      Description

        The latest version of WebKit, v612.1, no longer builds with VS 2017. There is one compilation error that is trivial to resolve, but after fixing that locally, it fails during linking.

        Here is the compilation error:

        $ gradle -PCOMPILE_WEBKIT=true sdk
        ../jfx/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.cpp(1222): error C2398: Element '1': conversion from 'const int' to 'float' requires a narrowing conversion
        ../jfx/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.cpp(1229): error C2398: Element '2': conversion from 'const int' to 'float' requires a narrowing conversion
        ../jfx/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.cpp(1230): error C2398: Element '2': conversion from 'const int' to 'float' requires a narrowing conversion
        ../jfx/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.cpp(1232): error C2398: Element '1': conversion from 'const int' to 'float' requires a narrowing conversion
        ../jfx/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.cpp(1232): error C2398: Element '2': conversion from 'const int' to 'float' requires a narrowing conversion
        ../jfx/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.cpp(1233): error C2398: Element '2': conversion from 'const int' to 'float' requires a narrowing conversion
        ../jfx/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.cpp(1240): error C2398: Element '2': conversion from 'const int' to 'float' requires a narrowing conversion
        ../jfx/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.cpp(1249): error C2398: Element '1': conversion from 'const int' to 'float' requires a narrowing conversion
        ../jfx/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.cpp(1250): error C2398: Element '1': conversion from 'const int' to 'float' requires a narrowing conversion
        ../jfx/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.cpp(1250): error C2398: Element '2': conversion from 'const int' to 'float' requires a narrowing conversion
        ../jfx/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.cpp(1252): error C2398: Element '1': conversion from 'const int' to 'float' requires a narrowing conversion
        ../jfx/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.cpp(1253): error C2398: Element '1': conversion from 'const int' to 'float' requires a narrowing conversion

        The fix is simply the following:

        --- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.cpp
        +++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.cpp
        @@ -1195,8 +1195,8 @@ void InspectorOverlay::drawLayoutLabel(GraphicsContext& context, String label, F
             FontCascade font(WTFMove(fontDescription), 0, 0);
             font.update(nullptr);

        - constexpr auto padding = 4;
        - constexpr auto arrowSize = 4;
        + constexpr auto padding = 4.0f;
        + constexpr auto arrowSize = 4.0f;
             float textHeight = font.fontMetrics().floatHeight();
             float textDescent = font.fontMetrics().floatDescent();

        After applying that fix, here is the link error that we get:

        [1967/1981] Linking CXX shared library bin/jfxwebkit.dll
        FAILED: bin/jfxwebkit.dll lib/jfxwebkit.lib
        cmd.exe /C "cd . && jfx/buildSrc/build/build-tools/cmake-3.13.3-win32-x86/cmake-3.13.3-win32-x86/bin/cmake.exe -E vs_link_dll --intdir=Source/WebKitLegacy/CMakeFiles/WebKitLegacy.dir --manifests -- jfx/buildSrc/build/build-tools/devkit-windows_x64-VS2017-15.9.24+1.0.tar/VC/bin/x64/link.exe /nologo @CMakeFiles/WebKitLegacy.rsp /out:bin/jfxwebkit.dll /implib:lib/jfxwebkit.lib /pdb:bin/jfxwebkit.pdb /dll /version:0.0 /machine:x64 /DEBUG /OPT:ICF /OPT:REF /INCREMENTAL:NO /INCREMENTAL:NO jfx/modules/javafx.web/build/win/Release/WebCore/obj/version.res && cd ."
        LINK: command "jfx/buildSrc/build/build-tools/devkit-windows_x64-VS2017-15.9.24+1.0.tar/VC/bin/x64/link.exe /nologo @CMakeFiles/WebKitLegacy.rsp /out:bin/jfxwebkit.dll /implib:lib/jfxwebkit.lib /pdb:bin/jfxwebkit.pdb /dll /version:0.0 /machine:x64 /DEBUG /OPT:ICF /OPT:REF /INCREMENTAL:NO /INCREMENTAL:NO jfx/modules/javafx.web/build/win/Release/WebCore/obj/version.res /MANIFEST /MANIFESTFILE:bin/jfxwebkit.dll.manifest" failed (exit code 1169) with the following output:
        WebStorageNamespaceProvider.cpp.obj : error LNK2005: "public: static class WebCore::PartialOrdering const WebCore::PartialOrdering::less" (?less@PartialOrdering@WebCore@@2V12@B) already defined in StorageAreaImpl.cpp.obj
        WebStorageNamespaceProvider.cpp.obj : error LNK2005: "public: static class WebCore::PartialOrdering const WebCore::PartialOrdering::equivalent" (?equivalent@PartialOrdering@WebCore@@2V12@B) already defined in StorageAreaImpl.cpp.obj
        ...
        WebCoreTestSupport.lib(MockPageOverlay.cpp.obj) : error LNK2005: "public: static class WebCore::PartialOrdering const WebCore::PartialOrdering::greater" (?greater@PartialOrdering@WebCore@@2V12@B) already defined in StorageAreaImpl.cpp.obj
        WebCoreTestSupport.lib(MockPageOverlay.cpp.obj) : error LNK2005: "public: static class WebCore::PartialOrdering const WebCore::PartialOrdering::unordered" (?unordered@PartialOrdering@WebCore@@2V12@B) already defined in StorageAreaImpl.cpp.obj
        Creating library lib/jfxwebkit.lib and object lib/jfxwebkit.exp
        bin/jfxwebkit.dll : fatal error LNK1169: one or more multiply defined symbols found
        ninja: build stopped: subcommand failed.

        See the attached log for the complete list of link errors.

        It's possibly related to the following comment:

        https://github.com/openjdk/jfx/blob/master/modules/javafx.web/src/main/native/Source/WebCore/dom/Node.h#L746

        There are two possible solutions for jfx11u:

        1. Find a solution to the VS 2017 link issue. We would then fix it in mainline (and 8u) and backport it to 11 along with the backport of WebKit 612.1.
        2. Update jfx11u to use VS 2019. This will require solving a long-standing problem where we don't ship the microsoft DLLs in our jmod bundles to avoid the jlink error described in JDK-8207015. Basically our solution to that was to rely on the DLLs in the JDK, which only works if the JDK has the same or newer version of Visual Studio. This means if we update to VS 2019 a jlinked application using JDK 11.0.x and JavaFX 11.0.x will no longer run unless we ship the DLLs (in a separate directory to avoid reintroducing JDK-8207015).

        Solution 1 will likely be the easiest, so is probably what we should do for October. We eventually need solution 2 anyway, since it will become increasingly difficult, to build newer WebKit libraries with VS 2017.

        Attachments

          Issue Links

            Activity

              People

                kcr Kevin Rushforth
                kcr Kevin Rushforth
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: