RFR: 8353009: Document target selection flag for Windows AArch64 builds

Saint Wesonga duke at openjdk.org
Mon Mar 31 14:47:25 UTC 2025


On Mon, 31 Mar 2025 13:16:34 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

> > Wait a minute. I re-read the discussion a bit more carefully, and let my brain re-process what I said above...
> > Is the goal here to document how you properly do cross-compilation for windows/aarch64 on windows/x64? If so, I think this is a correct solution, but the documentation should be more clear that this applies for cross-compiling to windows/aarch64 from x64 on cygwin.
> > If the problem is that native builds on windows/aarch64 does not work, then it is a different issue that needs to be fixed.
> 
> The problem applies to both native and cross compilation, though cross compilation is no different than other platforms. The reason native compilation doesn't work on Cygwin is that there is no aarch64 distro of Cygwin, so even a native windows aarch64 build will use an x64 version of Cygwin running in emulated mode (I don't know the name on Windows, but pretty much the same as rosetta on mac). This trips up configure into thinking we are running on a native windows x64 machine, and it's the reason why telling configure that the **build** platform is `aarch64-pc-cygwin` helps. Caveat, this is all based on what I've heard, I've never had access to a windows-aarch64 machine.
> 
> I completely agree that fixing this detection issue is better than documenting, but I also think that documenting how to perform a native build is better than how to perform a cross build on a native machine. Cross compiling works, but adds increased complexity and build time unnecessarily in this case.

Upon closer inspection, the --build option results in a native build (per the build system) but the ARM64 C++ compiler binary (cl.exe) is actually an x64 binary, so the compiler is running in emulated mode despite the build system thinking that a native build is happening. I'm investigating this in https://bugs.openjdk.org/browse/JDK-8353066

I propose changing the scope of this PR to documenting cross compilation for windows/aarch64 on windows/x64 and fixing the native build in https://bugs.openjdk.org/browse/JDK-8353066

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

PR Comment: https://git.openjdk.org/jdk/pull/24267#issuecomment-2766469401


More information about the build-dev mailing list