Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Fix building jnidispatch with Android NDK 18+ using Clang/LLVM

Đang mở
#1,659 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
20/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
android, c, java
Lĩnh vực
build-system, mobile-dev

Hướng nghiên cứu

Trước tiên, hãy xem xét branch và commit android-ndk-llvm được đề xuất, sau đó so sánh các thay đổi build của chúng với thiết lập build jnidispatch hiện tại. Kiểm thử build với các phiên bản Android NDK được hỗ trợ, bao gồm r27c, và xác định xem quá trình chuyển đổi từ GCC sang Clang có hoạt động trên tất cả các target được thảo luận hay không.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

More of a place for discussion than an urgent need to be resolved, I have specifically not made a PR yet as this is nowhere near comprehensively tested. It would be very helpful if anyone with libffi experience in other projects knows about any tricks moving from gcc to clang.

Anyway, here is a branch with my proposed changes: https://github.com/BugsBeGone/jna/commits/android-ndk-llvm/
Actual commit, which may be out of date if branch is rebased to sync with master: https://github.com/BugsBeGone/jna/commit/2be472422f4ea1c479ef1322253b9a1ab7d356e0

Some initial observations:

  • ARMv5 and MIPS (32 & 64) targets were removed in NDK r17. In theory the Play Store still supports versions of Android that could be running on those architectures, so it is a bit soon to drop them entirely if the old toolchains do still work. At the very least I would expect a major JNA version bump to indicate the removed targets (Edit: I guess those libs can always still be built with older NDKs, in which case no need for a breaking change by dropping support).

  • Standalone toolchains are a mess for detecting the version. I cannot think of a way that does not involve the user manually setting either the NDK major version, or a USE_CLANG define to work out which compiler suite to use. I would be in favour of officially not supporting the use of standalone toolchains, as you need approximately 1GB of extra disk space per target, so even testing it is a pain.

  • More to the point, NDKs between r17 & r21 generally seem to be unstable, requiring unholy combinations of GCC/Binutils & Clang/LLVM to work at all. Since the existing build environment has never worked with anything after r15, because of the switch to unified headers, we probably do not need to worry too much so long as everyone is happy to jump from let's say r15 to r22.

I have mostly been testing with NDK r27c, since that was the latest LTS release (Edit: r27d is still the latest LTS, the only differences from r27c are a couple of macOS-specific fixes).

Ngôn ngữ chính
Java
Star
8.9k
Fork
1.7k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của java-native-access/jna

Tất cả issue của java-native-access/jna

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.