-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add win32-aarch64 support #93
Comments
Agreed. I'm hoping to get my cross-compilation environment to support ARM soon. Just in case it's of interest, I have a Telegram group chat if you want to get involved. |
Quick update: I've released hid4java version 0.6.0 to Maven Central which has several improvements to JNA and In the examples code I've added an architecture detection logging message which should assist with selection of suitable ARM support. As I understand it, JNA supports Would it be possible for your team to run the
|
WindowsFortunately, Microsoft recently released an alpha JVM for Windows on ARM. Unfortunately... unless you're aware of another way, think this will require JNA for these platforms is available first. Here's what happens when I try to echo the lines you've referenced. It does show public class Main {
public static void main(String[] args) {
System.out.println("Platform architecture: " + Platform.ARCH);
System.out.println("Resource prefix: " + Platform.RESOURCE_PREFIX);
}
}
Raw output from "java HidTest"
MacI'm still trying to get my hands on an openjdk build for MacOS, even a Zero-Assembler build would be a nice start. I'll update as I find out more. |
Thanks for running the tests, Tres. That output clearly shows that JNA doesn't have a compiled DLL for the win32-aarch64 system. Still, that does back up my |
Ok, if you have arm64 MSVC++ installed I believe the main change is to the - -arch=amd64
+ -arch=arm64 -host_arch=amd64 Took me a while for me to find this, wanted to share. |
Awaiting JNA update: JNA #1238 so that |
@gary-rowe java-native-access/jna#1238 is about darwin / darwin-aarch64, not windows. For anyone interested into getting JNA onto mac so aarch64: You need to get involved - I'll look into it, but quite frankly I'm the opposite of an apple fan and while I'm able to get access to mac os on x86-64, mac os aarch64 will not get near me. The current state is described in the above mentioned issue. For support of windows on aarch64 the same is true. I use windows for work and don't own aarch64 hardware (at least none with desktop level performance). If noone steps up, it won't be done. |
I have hardware for both and willing to help.
The current status is available on the JNA mailing list here: https://groups.google.com/g/jna-users/c/UxpFZP4g_ls/m/L3tors4tAQAJ In short,
I have hardware available via SSH for anyone willing to help. I haven't started testing java-native-access/jna#1238 yet but I will make sure to offer any useful information there. |
Just a status on the Windows-side of things, we're able to get |
JNA for Windows ARM64 is available here java-native-access/jna#1264. macOS to follow. |
I've created a branch
If the above goes well we can proceed to the next part of the plan.
git checkout https://github.com/libusb/hidapi.git
cd hidapi
make clean
./bootstrap
./configure The resulting DLL should appear in At this stage it's a shot in the dark but I'm hoping to get some insight into what needs to be done to support this. If anyone can advise on a suitable cross compilation environment (ideally based on Linux) with GCC flags or Mingw32/64 that would speed things up a lot. See this excerpt from dockcross-windows-shared-x64 bash \
sudo dpkg --add-architecture arm64 && \
sudo apt-get update && \
sudo apt-get --yes install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libudev-dev:arm64 libusb-1.0-0-dev:arm64 && \
sudo make clean && \
sudo ./bootstrap && \
sudo ./configure --host=aarch64-w64-mingw64 CC=aarch64-w64-gnu-gcc && \
sudo make |
At the time of writing this, the only non-Windows win32-aarch64 compiler is Clang's. @matthiasblaesing showed doubt when mentioned, so we went the MSVC route through libffi's Assuming you're more concerned with the
This is untested. |
FYI, split the macOS discussion over to #108 so we can focus on Windows support in one thread. |
No luck with Anyway, the |
This was done by:
@gary-rowe has expressed he builds his own binaries by hand, so at this point, I'm not adding anything to the |
Seems to work well thanks to the hard work of @mstorsjo:
Proof of concept gist here. Edit: Shared with dockcross incase they find it useful. |
FYI, aarch64 support has been added to JNA in a 5.7.0-SNAPSHOT for both Windows 64-bit and MacOS 64-bit here: https://groups.google.com/g/jna-users/c/UwUa5qWbIco/m/AMLX8FNlAQAJ. |
Just an update, Windows ARM64 build support through dockcross has landed in the |
Good news! I've managed to compile a @tresf Would you (or anyone, really) have some time to verify that the In anticipation of some success, I'll merge this branch into |
@gary-rowe I'd be happy to test, I have two machines running ARM64, one physical and one VM. Do you have a binary to share, or are you asking about the binary that I created? |
Thanks @tresf . You can find the latest binaries in the develop branch. I’ll use that one for all fixes. |
@gary-rowe I tested the produced At time of writing this, I have not yet tested reading from a device (the device I use is currently in storage). |
* #93 Create placeholder for hidapi win32-aarch64 * #93 Add POM version for local JNA issue 93 support * #93 Add POM version for JNA 5.7.0-SNAPSHOT * #93 Add local library reference for faster JNA turnaround * #93 Re-instate missing DLL and reference JNA-5.7.0-SNAPSHOT * Fix buld-hidapi.sh Closes #114 Make colors easier to read in the shell script * Add win32-aarch64 to dockcross * Fix JNA dependency * Fix unit test Wait 30s for testing as logs indicate * Add darwin-aarch64 to dockcross * Bump JNA to 5.8.0 * Switch darwin to new jna suffix Also adds some sanitization to the build-hidapi.sh * Quality of life improvements :) * Fix missing dollar sign * Remove problematic calls to "make clean" Closes #122 * Add hints for SDKROOT, MACOSX_DEPLOYMENT_TARGET Closes #120 Co-authored-by: Gary Rowe <g.rowe@froot.co.uk>
That's great news, @tresf - thank you for looking at this. I'll continue adding code to the |
Support for |
@gary-rowe as ARM OSs are becoming more popular on Windows and inevitably macOS, can we help contribute binaries to you for those platforms? If so, how can we get started?
The text was updated successfully, but these errors were encountered: