Skip to content

Commit

Permalink
fix: support android 15 16k page size (#2043)
Browse files Browse the repository at this point in the history
Close
#2041
  • Loading branch information
littleGnAl authored and peilinok committed Dec 5, 2024
1 parent 189fe02 commit 5c8254e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
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

0 comments on commit 5c8254e

Please sign in to comment.