-
Notifications
You must be signed in to change notification settings - Fork 52
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] Use 16 kb pages for Android by default #1740
Conversation
PR HealthBreaking changes ✔️
Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
|
@@ -67,6 +67,9 @@ void main() { | |||
.firstWhere((e) => e.contains('file format')); | |||
expect(machine, contains(objdumpFileFormat[target])); | |||
} | |||
if (linkMode == DynamicLoadingBundled()) { | |||
await expectPageSize(libUri, 16 * 1024); |
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.
Do we have evidence of users running into this issue?
Not all users will use package:native_toolchain_c
, some may ship binaries, etc. So we could add build output validation for this that will apply to all code assets.
if (targetOS == OS.android && androidVersion >= ...) {
ensurePageSizeIs16Kb(...);
}
somewhere in
Future<ValidationErrors> _validateCodeAssetBuildOrLinkOutput( |
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.
Do we have evidence of users running into this issue?
plugin_ffi
users were running into this: fix: support android 15 16k page size for template plugin_ffi flutter/flutter#155508- I'm running into this locally with the latest version of the emulator on Linux and MacOS.
So we could add build output validation for this that will apply to all code assets.
We're not mandating readelf
or objdump
currently. Flutter provides access to a compiler, linker, and archiver via cCompiler
. But we don't have something similar for commandline utilities at the moment.
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.
androidVersion
We don't have an android version. Only a minAndroidSdkVersion. But the minAndroidSdk doesn't matter, something compiled with a lower min SDK trying to run on Android 15 will still fail to load the dylib if the page-size is smaller than 16kb.
Thanks @mkustermann! I've filed #1741 to add the command-line utilities somewhere so that we can rely on them and report users via a doctor command if the utilities are not there. |
Closes: #1611