-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Use 16 KB ELF alignment for shared native libraries #7897
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
Conversation
|
Realm welcomes all contributions! The only requirement we have is that, like many other projects, we need to have a Contributor License Agreement (CLA) in place before we can accept any external code. Our own CLA is a modified version of the Apache Software Foundation’s CLA. Our records show that CLA has not been signed by @mannodermaus. Please submit your CLA electronically using our Google form so we can accept your submissions. After signing the CLA you can recheck this PR with a |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a good fix.
164d111 to
4b05ef1
Compare
4b05ef1 to
1f23d31
Compare
|
@swankjesse Thanks for the review! I added a changelog entry as well, but the PR may require another review pass because of that. If we don't foresee any issues with objectServer, then I suppose this would be safe to go in after. |
|
Thanks @mannodermaus @swankjesse for the PR and review, I've introduced the same change in Kotlin in https://github.com/realm/realm-kotlin/pull/1788/files#diff-20de1441ff4c65066df79aa3e4da6a14c3705f68f5327ae1113591e135a6b3c0 |
|
@mannodermaus I just pushed |
|
I can confirm that using |
Starting from the upcoming Android 15, the possibility for devices configured with a memory page size of 16 KB (rather than the default 4 KB) becomes available to OEMs. This has an impact on how native code must be packed into Android applications in order to prevent crashes at runtime when unaligned code is being loaded on these devices (ref #7894).
This PR applies the suggested migration steps for 16 KB ELF packaging to the output of
realm-library. As I did not want to upgrade the entire stack to AGP 8.3+ and NDK 27+, it follows the "legacy path" that yields the same results: After building the native libraries with these flags, calls toRealm.init()no longer cause an immediate crash on devices/emulators configured with 16 KB page size.Full disclaimer: This change also applies to the
objectServerbinaries, which we aren't using for our use case. I don't know if there are any ramifications of 16 KB page size for those binaries.