Skip to content
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

[native_toolchain_c] Android 15 16kb elf alignment #1611

Open
dcharkes opened this issue Sep 27, 2024 · 5 comments
Open

[native_toolchain_c] Android 15 16kb elf alignment #1611

dcharkes opened this issue Sep 27, 2024 · 5 comments
Labels
P3 A lower priority bug or feature request package:native_toolchain_c

Comments

@dcharkes
Copy link
Collaborator

Android 15 has the support to require dylib elf sections to be 16kb aligned.

We should probably have a default flag for this in package:native_toolchain_c so that packages using flutter create --template package_ffi will work out of the box for Android 15 devices with 16kb memory pages.

Context:

@dcharkes dcharkes added P3 A lower priority bug or feature request package:native_toolchain_c labels Sep 27, 2024
@reidbaker
Copy link

Also possibly related flutter/flutter#125090

@mkustermann
Copy link
Member

Out of curiosity: Does Android's NDK compiler toolchain not automatically use 16 KB by-default? Or is this for handling older Android compiler toolchains that don't have that default yet?

@HosseinYousefi
Copy link
Member

Related: #1608

Out of curiosity: Does Android's NDK compiler toolchain not automatically use 16 KB by-default? Or is this for handling older Android compiler toolchains that don't have that default yet?

NDK r27 does with this flag set: -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON

@dcharkes
Copy link
Collaborator Author

Out of curiosity: Does Android's NDK compiler toolchain not automatically use 16 KB by-default? Or is this for handling older Android compiler toolchains that don't have that default yet?

We're currently still on r26b on the CI here:

ndk-version: r26b

Also flutter_tools is at 26 at the moment:

https://github.com/flutter/flutter/blob/9be22b58c4bfe8b6cb447de13a500db4e1bd8c33/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy#L58-L63

If you invoke 27 or up directly (not via Groovy, Kotlin, or Application.mk) it also requires passing the flag:
https://developer.android.com/guide/practices/page-sizes#other-build-systems

@dcharkes
Copy link
Collaborator Author

Bumping the version on the CI here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 A lower priority bug or feature request package:native_toolchain_c
Projects
None yet
Development

No branches or pull requests

4 participants