Skip to content
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

fix: support android 15 16k page size #2043

Merged
merged 2 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -596,3 +596,26 @@ jobs:
with:
name: web-debug-golden-files
path: test_shard/rendering_test/screenshot/*.debug.png

check_android15_16k_page_alignment:
name: Check android15 16k page size alignment
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }}
strategy:
matrix:
version: ['3.x']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '11'
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.version }}
cache: true
- run: flutter pub get
- name: Run flutter build apk
run: flutter build apk
working-directory: example
- name: Check android15 16k page size alignment
run: bash scripts/check_android15_16k_page_alignment.sh example/build/app/intermediates/merged_native_libs/release/out/lib/arm64-v8a/libiris_rendering_android.so
3 changes: 3 additions & 0 deletions android/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ target_link_libraries(${LIBRARY_NAME}
EGL
)

# Support Android 15 16k page size
target_link_options(${LIBRARY_NAME} PRIVATE "-Wl,-z,max-page-size=16384")

set(THIRD_PARTY_INCLUDE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/include/iris"
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/include/agora_rtc"
Expand Down
18 changes: 18 additions & 0 deletions scripts/check_android15_16k_page_alignment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# usage: check_android15_16k_page_alignment.sh path/to/lib.so

SO_FILE="$1"

RED="\e[31m"
GREEN="\e[32m"
ENDCOLOR="\e[0m"

res="$(objdump -p ${SO_FILE} | grep LOAD | awk '{ print $NF }' | head -1)"
if [[ $res =~ "2**14" ]] || [[ $res =~ "2**16" ]]; then
echo -e "${SO_FILE}: ALIGNED ($res)"
exit 0
else
echo -e "${SO_FILE}: UNALIGNED ($res)"
exit 1
fi
Loading