-
Using Windows 10 on ARM, Install Visual Studio with ARM compiler support
-
Manually install and configure ANT with Microsoft's experimental ARM Java build https://github.com/microsoft/openjdk-aarch64/releases
-
Download the x86 version of Cygwin (the 64-bit version will NOT run on ARM64)
-
Take the defaults
-
When prompted select a reputable mirror (e.g. for US: https://mirrors.rit.edu)
-
Cygwin will ask for packages. Many required packages are provided by default (
shell
,sed
,grep
) however the following must be manually selected:make automake libtool dos2unix
-
(TODO: Verify) Update
libffi
dependency to latest with arm64 supportcd build\native mv libffi libffi_old git clone https://github.com/libffi/libffi
-
Open the Cygwin Terminal and convert
*.am
and*.sh
files to UNIX format:find . -name \*.ac|xargs dos2unix find . -name \*.am|xargs dos2unix find . -name \*.sh|xargs dos2unix find . -name \*.sub|xargs dos2unix find . -name \*.guess|xargs dos2unix find . -name \*.host|xargs dos2unix
-
Open CMD and source the MSVC environment providing
-host_arch=x86
and-arch=arm64
"%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd" -arch=arm64 -host_arch=x86
-
Add
\cygwin\bin
to your pathset PATH=%SystemDrive%\cygwin\bin;PATH
-
Start the build with verbosity (
--debug=v
) enabledant native -DEXTRA_MAKE_OPTS=--debug=v
Click for full logs: https://gist.github.com/tresf/c88a365f4269adeb011f6e64cec5e9bb
[exec] Assembling: src/x86/win32.asm
[exec] Successfully remade target file 'src/x86/win32.lo'.
[exec] Must remake target 'libffi_convenience.la'.
[exec] /bin/sh ./libtool --tag=CC --mode=link /cygdrive/c/Users/Administrator/jna/native/libffi/msvcc.sh -warn all -o libffi_convenience.la src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo src/x86/ffi.lo src/x86/win32.lo
[exec] libtool: link: lib -OUT:.libs/ffi_convenience.lib src/prep_cif.obj src/types.obj src/raw_api.obj src/java_raw_api.obj src/closures.obj src/x86/ffi.obj src/x86/win32.obj
[exec] Microsoft (R) Library Manager Version 14.26.28806.0
[exec] Copyright (C) Microsoft Corporation. All rights reserved.
[exec]
[exec] src\x86\win32.obj : fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'ARM64'
[exec] make[3]: Leaving directory '/cygdrive/c/Users/Administrator/jna/build/native-win32-aarch64/libffi'
[exec] make[2]: Leaving directory '/cygdrive/c/Users/Administrator/jna/build/native-win32-aarch64/libffi'
[exec] make[1]: Leaving directory '/cygdrive/c/Users/Administrator/jna/build/native-win32-aarch64/libffi'
[exec] make[3]: *** [Makefile:1227: libffi_convenience.la] Error 88
[exec] make[2]: *** [Makefile:1658: all-recursive] Error 1
[exec] make[1]: *** [Makefile:790: all] Error 2
[exec] make: *** [Makefile:483: ../build/native-win32-aarch64/libffi/.libs/libffi.lib] Error 2
BUILD FAILED
C:\Users\Administrator\jna\build.xml:1028: exec returned: 2
Total time: 5 minutes 45 seconds
Keywords: Java Native Access, libffi, msvcc