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

Support for side by side MSVC Toolset versions

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b14

      Backports

        Description

        From Ali Ince on build-dev http://mail.openjdk.java.net/pipermail/build-dev/2019-March/025126.html:
        ---
        Hi Everyone,

        I've been working on getting OpenJDK builds to support side-by-side minor version MSVC toolsets which is now available in VS2017.

        With VS2017, Microsoft switched to a more frequent update policy where they have delivered 8 major updates as of today. As part of this policy, they're no more providing download support for all major updates and they've limited the number of major updates available for public download [1]. However, they're providing earlier minor versions of MSVC toolsets as components that can be installed side-by-side with the latest available major update of VS2017 [2].

        On the other hand, known MSVC compiler versions between OpenJDK versions change slightly. For example, within jdk, jdk12u and jdk11u the latest known version of VS2017 is 15.8 [3], [4], [5] whereas it is 15.6 in jdk8u [6].

        The proposed patch below enables us to provide the intended MSVC toolset version to use, with --with-msvc-toolset-version parameter. The provided value is then passed as 'vcvars_ver' parameter value to 'vcvarsall.bat' invocation. The supplied parameter configures the build environment to use the specified toolset rather than the default one (which is currently the toolset provided with 15.9 - with MSC_VER value of 1916).

        It also adds support for the 'VCToolsRedistDir' environment variable introduced with VS2017 that identifies the root directory that includes the redistributable DLLs instead of searching through all toolset directories.

        This patch will enable a single setup of VS2017, within multiple toolset versions present, to support building OpenJDK with corresponding toolset versions identified as known compilers.

        I've tested the patch with both WSL and Cygwin.

        Let me know if you have any feedback/comments.

        Thanks,

        Ali

        [1] https://docs.microsoft.com/en-us/visualstudio/productinfo/installing-an-earlier-release-of-vs2017
        [2] https://devblogs.microsoft.com/cppblog/side-by-side-minor-version-msvc-toolsets-in-visual-studio-2017/
        [3] http://hg.openjdk.java.net/jdk/jdk/file/0324b3756aa2/src/hotspot/share/runtime/vm_version.cpp#l228
        [4] http://hg.openjdk.java.net/jdk-updates/jdk12u/file/a5881e9139ca/src/hotspot/share/runtime/vm_version.cpp#l228
        [5] http://hg.openjdk.java.net/jdk-updates/jdk11u/file/30892e0c9533/src/hotspot/share/runtime/vm_version.cpp#l230
        [6] http://hg.openjdk.java.net/jdk8u/jdk8u-dev/hotspot/file/ce13ce932e31/src/share/vm/runtime/vm_version.cpp#l233

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                erikj Erik Joelsson
                Reporter:
                erikj Erik Joelsson
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: