ci: align Android .so LOAD segments to 16 KB pages - #2
Open
MudDev wants to merge 1 commit into
Open
Conversation
Android 15+ devices can boot with a 16 KB page size. The Go linker defaults to 4 KB max-page-size, so libepix_snowflake.so fails the 16 KB alignment check and Android flags the whole app. Pass max-page-size=16384 to the external linker for the android build. Verified locally: llvm-readelf -l shows all LOAD segments at 0x4000 with the flag (0x1000 without).
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



The v0.2.0 release's libepix_snowflake.so has 4 KB aligned LOAD segments, so EpixNet's Android app trips the 16 KB page-size compatibility check on Android 15+ devices (the emulator shows an "App isn't 16 KB compatible" dialog naming libepix_snowflake.so: LOAD segment not aligned).
The Go external linker defaults to 4 KB max-page-size for android/arm64. Passing -Wl,-z,max-page-size=16384 through -extldflags fixes it.
Verified locally with NDK r30 and Go 1.26: llvm-readelf -l on the built .so shows every LOAD segment aligned to 0x4000 with the flag, 0x1000 without.
After merging this needs a new tag/release, then a bump of iptproxy.rev and iptproxy.sha256 in EpixNet so the Android build picks the fixed library up.