<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="margin: 0px 0px 0px 7px; min-width: 370px;">
<div style="margin: 2px 2px 8px 10px; padding-right: 12px; padding-left: 12px; border-radius: 4px;">
<div class="elementToProof" style="margin: 16px 0px 10px; padding-bottom: 2px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Hello. I am the maintainer of the IKVM project (ikvm.org). IKVM is a set of tools and libraries for translating compiled Java byte code to .NET MSIL. Basically, you can run compiled Java code on .NET.</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
IKVM consists of our own translation logic and runtime stuff. However, to provide the base class library we reuse OpenJDK. So we maintain a weird fork of much of OpenJDK.</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
We also, now, make use of most of the backend C, C++ and Objective-C code that forms the JNI backend of most of the OpenJDK base classes. For instance, we build libjava, libnet, libnio, and all the others. To do so however, we do not make use of the existing
OpenJDK build system. No Makefiles. Instead, we integrate the build of the C code into the same MSBuild process that powers the rest of our build. And we use Clang as the compiler.</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
We also build about a dozen versions of this C code for each of our own supported platforms: win-x86, win-x64, win-arm64, osx-x64, osx-arm64, linux-x64, linux-arm64, linux-musl-*, etc. Since we have our own build system, and use clang, we aren't constrained
by things like Cygwin, MSYS, or various Linux targets. We build everything for every platform from the same build host and process, and the output all gets bundled together into a single distribution. Consequently, we stumble quite a bit onto various issues
with OpenJDK and Clang compatibility. Some of the issues are issues with OpenJDK not supporting certain targets: for instance, we had to patch a few things to get musl to work. Or, for instance, various issues where OpenJDK uses MSVC extensions in the Windows
code which aren't replicated by Clang effectively (ternary implicit casting comes to mind).</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
But also, the big one, and the topic of my question here: there are a few places in OpenJDK where the C code includes a Windows SDK header file using a particular case that might work when building on Windows but does not work when building against the Windows
SDK on Linux.</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
As an example: https://github.com/ikvmnet/jdk8u/commit/6f2c45b0f9f63e3ca24cf850121754a060af70d0</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
I would like to get some of these changes into upstream. Are these the types of changes that might be acceptable to upstream? This seemed like a good place for me to start with this discussion. At the end of the day, they are mostly minor changes fixing various
minor compilation issues with Clang. They should however translate to anybody attempting to build OpenJDK itself, using Clang, on !Windows targeting Windows, or targeting odd platforms like musl.</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Also, we're pretty much stuck at JDK8 (today), so my fixes would be targeting that.</div>
<div style="margin: 16px 0px 10px; padding-bottom: 2px;"></div>
<div style="margin: 16px 0px 10px; padding-bottom: 2px;"></div>
<div style="margin: 0px; padding-bottom: 12px;"></div>
</div>
</div>
</body>
</html>