[BUG] riscv64 libc++_shared.so is not 16 KB aligned (LOAD p_align 0x1000)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 40/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp
- Lĩnh vực
- build-system
Hướng nghiên cứu
Start by reproducing the mismatch with llvm-readelf -lW on the riscv64-linux-android libc++_shared.so in the NDK sysroot, and compare its LOAD p_align with the aarch64 and x86_64 copies. Then find where the riscv64 runtime libraries are linked and check whether they receive -z max-page-size=16384 the way the other architectures do. Done when the riscv64 LOAD segments report 0x4000 and the other architectures are unchanged.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
The prebuilt libc++_shared.so for riscv64 has 4 KB-aligned LOAD segments, while the arm64-v8a and x86_64 libraries in the same NDK are 16 KB aligned. Apps that ship libc++_shared.so for riscv64 fail the platform's 16 KB page-size compatibility check, even when all of the app's own libraries are linked with -Wl,-z,max-page-size=16384.
Output of llvm-readelf -lW toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/<triple>/libc++_shared.so, LOAD segment alignment:
| NDK | aarch64-linux-android | x86_64-linux-android | riscv64-linux-android |
|---|---|---|---|
| r29 (29.0.14206865) | 0x4000 | 0x4000 | 0x1000 |
| r30 (30.0.16248370) | 0x4000 | 0x4000 | 0x1000 |
| canary 30.0.16868822 | 0x4000 | 0x4000 | 0x1000 |
riscv64-linux-android/libc++_shared.so:
LOAD 0x000000 0x0000000000000000 ... R 0x1000
LOAD 0x092698 0x0000000000093698 ... R E 0x1000
LOAD 0x11a460 0x000000000011c460 ... RW 0x1000
LOAD 0x1244c0 0x00000000001274c0 ... RW 0x1000
Observed on device
On a Cuttlefish riscv64 phone image (aosp_cf_riscv64_phone, Android 17, CP2A.260605.016), installing an APK that contains lib/riscv64/libc++_shared.so results in:
I NativeLibraryHelper: Setting page size compat mode PAGE_SIZE_APP_COMPAT_FLAG_ELF_NOT_ALIGNED
W AppWarnings: Showing PageSizeMismatchDialog for package <package>
dumpsys package reports pageSizeCompat=4. The dialog lists libc++_shared.so as "LOAD segment not aligned". Building the same app with ANDROID_STL=c++_static (so that libc++_shared.so is not packaged) makes the warning go away. All other libraries in the APK have LOAD p_align 0x4000.
Expected
The riscv64 libc++_shared.so (and other riscv64 shared runtime libraries shipped in the NDK) should be linked with -z max-page-size=16384, like the arm64-v8a and x86_64 ones.
Affected versions
r29, r30, canary 30.0.16868822
Canary version
Also affected: canary 30.0.16868822 (r30-canary, CI build 16868822) — riscv64 libc++_shared.so LOAD p_align 0x1000, aarch64/x86_64 0x4000.
I am using a supported NDK
- I have checked and the NDK I'm using is currently supported
Affected versions
r30
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 2.3k
- Fork
- 311
- 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
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của android/ndk
-
[BUG] simpleperf associates wrong header file for lambdaCó thể đã có người làm @Jake-The-Human đã nhận 24 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
-
[BUG] error: PCH file was compiled for the target 'aarch64-unknown-linux-android21' but the current translation unit is being compiled for target 'aarch64-none-linux-android21'Có thể đã có người làm @Sharjeel-Khan đã nhận 24 ngày trước. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 47/100
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
bluesky-social/social-app#12545 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
refactor topic-architecture topic-ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
XCSoar/XCSoar#3547 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
manjaro-sway/manjaro-sway#1079 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
linux-test-project/lcov#579 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
compiler: the island_chunks_not_emitted report gives a count but not which islands were skippedĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100