[BUG] Setting -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=OFF does not revert back to 4k pages. · Issue #2145 · android/ndk · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default alignment of shared libraries for arm64-v86 and x86_64 is now 16k. To revert to 4k alignment, set APP_SUPPORT_FLEXIBLE_PAGE_SIZES (ndk-build) or ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES (CMake) to false. See https://developer.android.com/guide/practices/page-sizes for more information.
When ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES is turned off, the only thing NDK's cmake files do is defining __BIONIC_DEPRECATED_PAGE_SIZE_MACRO macro to make PAGE_SIZE macro visible. However -z max-page-size=4096 is not appended to the list of linker flags:
Ugh, I could have sworn we had a test for this, but apparently we only test the default and the "on" mode, not the "off" mode.
I'm a little torn on whether it's better to fix this, which would alter the behavior for existing builds that set this to off but aren't actually getting that behavior, or to leave it as-is and fix the docs.
@asakovets since you're the first person to notice, could you help me out with some background info? Did you just recently upgrade to r28? Also, what are your reasons for opting out?
I just upgraded a few days ago. I didn't actually intend to opt out, but wanted to see how 16k alignment impacts DSO size. This is when I found out ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES is incomplete.
Thanks for the info. I'm leaning towards fixing it rather than updating the docs to reflect the situation, but I'm open to being swayed either way. Thanks for the report either way!
Description
Per the changelog:
The default alignment of shared libraries for arm64-v86 and x86_64 is now 16k. To revert to 4k alignment, set APP_SUPPORT_FLEXIBLE_PAGE_SIZES (ndk-build) or ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES (CMake) to false. See https://developer.android.com/guide/practices/page-sizes for more information.
However, setting
ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES
does not revert back to 4k alignment.-z max-page-size=16384
is now default in clang (as well as in ndk r28) (https://github.com/llvm/llvm-project/blob/6a99d817204dfa39afc42f1f6a810d82f6a8794f/clang/lib/Driver/ToolChains/Linux.cpp#L248).When
ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES
is turned off, the only thing NDK's cmake files do is defining__BIONIC_DEPRECATED_PAGE_SIZE_MACRO
macro to makePAGE_SIZE
macro visible. However-z max-page-size=4096
is not appended to the list of linker flags:https://android.googlesource.com/platform/ndk.git/+/refs/tags/ndk-r28b/build/cmake/flags.cmake#41
https://android.googlesource.com/platform/ndk.git/+/refs/tags/ndk-r28b/build/cmake/android-legacy.toolchain.cmake#475
I am using a supported NDK
Affected versions
r28
The text was updated successfully, but these errors were encountered: