-
-
Notifications
You must be signed in to change notification settings - Fork 22.4k
[Android] Add support for 16 KB page sizes, update to NDK r28b #106358
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
Doing so automatically adds support for 16kib page to the Godot Android shared libraries. See https://developer.android.com/guide/practices/page-sizes#compile-16-kb-alignment for details.
Follow-up to godotengine#106358, this is a separate commit / PR since it shouldn't be cherry-picked in previous releases as it removes existing functionality. Support for 16kb page size added in the previous PR requires the native libraries to be uncompressed, so we're deprecating and removing the option to compress native libraries. See https://developer.android.com/guide/practices/page-sizes#agp_version_851_or_higher for more details.
Follow-up to godotengine#106358, this is a separate commit / PR since it shouldn't be cherry-picked in previous releases as it removes existing functionality. Support for 16kb page size added in the previous PR requires the native libraries to be uncompressed, so we're deprecating and removing the option to compress native libraries. See https://developer.android.com/guide/practices/page-sizes#agp_version_851_or_higher for more details.
Do we still have to test it? |
I did a quick test building the Android editor and running it on an Android device, but yes more tests would be good! |
Have you changed your device to 16 KB via developer options? There are 4 We can probably take our time with this (Q4 2025 ?), Android 16 will have a I have a Pixel 8a with Android 15, so I could switch to 16 KB. But that requires a reboot, and I'm currently unsure whether all the apps that are essential in everyday life will run smoothly. I'll continue with an emulator for now; there's a special image for 16KB. C++ page_size check (UNIX only)#include <unistd.h>
Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_phase) {
Thread::make_main_thread();
set_current_thread_safe_for_nodes(true);
int page_size;
#ifdef _SC_PAGESIZE
page_size = sysconf(_SC_PAGESIZE);
#else
page_size = getpagesize();
#endif
print_line("Main::setup page_size: ", page_size); |
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.
Looks good!
Did some tests with Android Editor, everything seems to work correctly.
@Alex2782 I also validated the update using the script provided by Google at https://developer.android.com/guide/practices/page-sizes#alignment-use-script. |
Thanks! |
Follow-up to godotengine#106358, this is a separate commit / PR since it shouldn't be cherry-picked in previous releases as it removes existing functionality. Support for 16kb page size added in the previous PR requires the native libraries to be uncompressed, so we're deprecating and removing the option to compress native libraries. See https://developer.android.com/guide/practices/page-sizes#agp_version_851_or_higher for more details.
Bump the NDK to version 28.1.13356709; doing so automatically adds support for 16kib page to the Godot Android shared libraries. See https://developer.android.com/guide/practices/page-sizes#compile-16-kb-alignment for details.
Fixes #106313
This PR, alongside #106152 and #105611 should be cherry-picked to previous releases to provide similar support for 16kb page sizes.