Add elf alignment check for Android artifacts (#13818)

This commit is contained in:
Matthew Zavislak
2025-08-28 16:31:03 -07:00
committed by GitHub
parent 2734248544
commit 4f11feb708
4 changed files with 141 additions and 23 deletions

View File

@@ -561,6 +561,10 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
"testmultiaudio-apk",
"testsprite-apk",
]
# -fPIC is required after updating NDK from 21 to 28
job.cflags.append("-fPIC")
job.cxxflags.append("-fPIC")
case SdlPlatform.Emscripten:
job.clang_tidy = False # clang-tidy does not understand -gsource-map
job.shared = False

View File

@@ -76,7 +76,7 @@ jobs:
id: setup-ndk
with:
local-cache: true
ndk-version: r21e
ndk-version: r28c
- name: 'Configure Android NDK variables'
if: ${{ matrix.platform.android-ndk }}
shell: sh
@@ -411,6 +411,14 @@ jobs:
build-scripts/test-versioning.sh
python build-scripts/check_android_jni.py
python build-scripts/check_stdlib_usage.py
- name: 'Verify alignment of Android test apks'
if: ${{ matrix.platform.android-ndk && !matrix.platform.no-cmake }}
run: |
find ./ -iname '*.apk' | xargs -L1 ./build-scripts/check_elf_alignment.sh
- name: 'Verify alignment of Android .so files'
if: ${{ matrix.platform.android-ndk && !matrix.platform.no-cmake }}
run: |
find ./ -iname '*.so' | xargs -L1 ./build-scripts/check_elf_alignment.sh
- name: 'Upload binary package'
uses: actions/upload-artifact@v4
if: ${{ always() && matrix.platform.artifact != '' && (steps.package.outcome == 'success' || steps.cpactions.outcome == 'success') && (matrix.platform.enable-artifacts || steps.tests.outcome == 'failure') }}
@@ -433,4 +441,4 @@ jobs:
with:
if-no-files-found: error
name: '${{ matrix.platform.artifact }}-apks'
path: build/test/*.apk
path: build/test/*.apk