nodejs / nodejs/node

Android arm64 cross-build fails with current main and NDK r29

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

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

android
Ngôn ngữ chính
JavaScript
Star
122k
Fork
37.3k
Merge trung bình
4 ngày 2 giờ
Pull request đã merge (30 ngày)
283

Mô tả

Version

Current upstream main at 1e9fd9544ef38e6e36ca1d5ab7af3bab5b20496d

Platform
Android 11 target, arm64, API 30
Android NDK r29
Linux x86_64 build host
What steps will reproduce the bug?

On an unmodified checkout of main:

./android-configure /path/to/android-ndk-r29 30 arm64
make
What do you see instead?

The Android configure script assigns the Android target compiler to CC and
CXX. That compiler is also used for host-side tools such as ICU and V8
generators. The Android zlib target includes the NDK CPU-feature header but
does not include the corresponding sources/android/cpufeatures/cpu-features.c
implementation, which causes the Android CPU feature symbols to be missing
from the link.

Android cross builds can also reach V8 host-tool configurations where the
required POSIX trap-handler sources are not selected. Android trap-handler
activation must remain disabled; the required source selection is a separate
build concern.

Expected behavior

android-configure should select separate host and target compilers, and an
Android arm64 build should complete without requiring local absolute paths or
hand-edited generated files when using NDK r29.

Current status

The follow-up changes are kept separately reviewable:

  1. #65772 separates host and
    target compilers.
  2. #65773 compiles the Android
    NDK CPU feature implementation through a checked-in wrapper.
  3. #65774 selects the required V8
    POSIX and host simulator sources while keeping Android trap-handler support
    disabled.

Validation with NDK r29, Android API 30, and arm64 completed successfully. The
resulting Node binary also passed basic zlib, crypto, Intl, WebAssembly, and
SharedArrayBuffer runtime checks on Android 11.

The issue remains open pending upstream review and CI completion for the three
follow-up pull requests.

Validation notes

Runtime loading used the matching NDK libc++_shared.so alongside the binary
and did not require a system-image change.

The earlier NDK r27d std::atomic_ref compatibility observation is retained
only as historical context. PR #65775 was closed because an ordinary simdutf
API is not an equivalent atomic fallback for SharedArrayBuffer access; it is
not part of the current fix.

The changes are intended to be generic and do not depend on a particular
Android system-image integration, device serial number, or checkout path.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.

Hướng nghiên cứu

Bắt đầu với android-configure và đường dẫn build zlib cho Android, sau đó kiểm tra lựa chọn trình tạo ICU/V8 ở phía host và phần triển khai trong sources/android/cpufeatures/cpu-features.c. Xem lại các PR #65772, #65773 và #65774 trước khi tái hiện với NDK r29, API 30 và arm64. Được coi là hoàn tất khi build hoàn thành và các kiểm tra runtime Android được liệt kê đều đạt.

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

Đánh giá

Công nghệ
android, c, cpp, javascript
Lĩnh vực
build-system, mobile-dev
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
25/100

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.