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
Support Loongarch64 #1440
Support Loongarch64 #1440
Conversation
libffi code have been merged into upstream, see: libffi/libffi@f259a6f. I have successfully built JNA based on it, tests pass all. Note: We have Loongarch machines in the GCC compile farm, see: https://cfarm.tetaneutral.net/machines/list/. I think you can build the Loongarch port code with it. |
Changes look sane -- there is one TODO in the code. Can you elaborate on if this is still uncertain? |
TODO where I am not very sure, I need to check with my colleagues. Thank you for your valuable comments! |
350c0c1
to
e5646c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change LGTM. I am not sure if we should wait for the libffi update which contains LoongArch.
src/com/sun/jna/NativeLibrary.java
Outdated
@@ -988,6 +988,9 @@ else if (Platform.isARM()) { | |||
else if (Platform.ARCH.equals("mips64el")) { | |||
libc = "-gnuabi64"; | |||
} | |||
else if (Platform.ARCH.equals("loongarch64")) { | |||
libc = "-gnuabi64"; // TODO: not sure | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this could be removed, see https://github.com/loongson/jna/blob/ed826d277fedabbe44d54d392c1219c60c73f0ea/src/com/sun/jna/NativeLibrary.java#L987 . However checking again is suggested by me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is outdated, you already did it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you - generally looks sane to me. The build currently fails as no initial linux-loongarch64.jar
is provided. Please initiate it from out-of-date.jar
.
In the long run the embedded copy of libffi needs also be updated.
libffi just merged into upstream a few days ago, see: libffi/libffi@f259a6f and jna needs to sync with it. By the way, I think linux-loongarch64.jar has been initialized in build.xml,see: |
It is, if a breaking change of the native interface would have been detected. This is not the case. You need to add the empty file by hand. Have a look at the unittests attached to this PR, which all fail because of this. |
e5646c5
to
44210ec
Compare
Hi, @matthiasblaesing . Thank you for your advice, I realized my mistake and fixed it. |
Thanks for the update. I have one (maybe two) last request(s) before this good to go in:
|
91ebb08
to
ac553b8
Compare
CHANGES.md
Outdated
@@ -9,6 +9,7 @@ Features | |||
-------- | |||
* [#1433](https://github.com/java-native-access/jna/pull/1433): Add `CFEqual`, `CFDictionaryRef.ByReference`, `CFStringRef.ByReference` to `c.s.j.p.mac.CoreFoundation` - [@shalupov](https://github.com/shalupov) | |||
* [#978](https://github.com/java-native-access/jna/issues/978): Remove use of finalizers in JNA and improve concurrency for `Memory`, `CallbackReference` and `NativeLibrary` - [@matthiasblaesing](https://github.com/matthiasblaesing). | |||
* [#1440](https://github.com/java-native-access/jna/pull/1440): Support Loongarch64 - [@Panxuefeng-loongson](https://github.com/Panxuefeng-loongson). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“Support for LoongArch64” may be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“Support for LoongArch64” may be better.
Done.
2d84162
to
b0d9853
Compare
Co-Authored-By: Ao Qi <aoqi@loongson.cn>
b0d9853
to
0066b08
Compare
Looks good to me. Thank you. |
1 similar comment
Looks good to me. Thank you. |
Co-Authored-By: Ao Qi