RFR: 8321533: Clang build for Windows

Daniel Jeliński djelinski at openjdk.org
Thu Dec 7 19:55:06 UTC 2023


I'd like to propose a new toolchain for Windows using the clang-cl compiler frontend.

Clang-cl is available as an optional feature in all Visual Studio editions, including the free-for-OSS-development community edition.

Clang-cl command line is mostly compatible with cl. However, clang-cl offers a distinct set of diagnostic messages and warnings, which can be used to improve code quality.

In order to use the clang compiler:
- install Visual Studio 2022
- install C++ Clang Compiler (https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170)
- configure `--with-toolchain-type=clcl`
- compile as usual.

Note: at this moment the code does not build; I plan to submit separate patches that fix the build problems separately. For the impatient, [this patch](https://github.com/djelinski/jdk/commit/d67a16244f4e6db8e6e8c59266bebd17827bc2a5) should be enough to compile the JDK, and [this one](https://github.com/djelinski/jdk/commit/1580e7cf54cca61d3ab58891619553994ea26b10) is needed to get tier1 to pass.

-------------

Commit messages:
 - Rename mscl->clcl
 - Add MSCL toolchain type

Changes: https://git.openjdk.org/jdk/pull/17019/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17019&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8321533
  Stats: 109 lines in 9 files changed: 72 ins; 0 del; 37 mod
  Patch: https://git.openjdk.org/jdk/pull/17019.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17019/head:pull/17019

PR: https://git.openjdk.org/jdk/pull/17019


More information about the build-dev mailing list