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

Bump to NDK r27 #9020

Merged
merged 4 commits into from
Jul 19, 2024
Merged

Bump to NDK r27 #9020

merged 4 commits into from
Jul 19, 2024

Conversation

grendello
Copy link
Contributor

@grendello grendello commented Jun 12, 2024

Changes: https://github.com/android/ndk/wiki/Changelog-r27

NDK r27 has been released. The most important change affecting us is that we should start building
all our native libraries with 16k page alignment,
support for which is already in main and will be refined once #9075 is merged.

Notable changes:

  • NDK switched to LLVM 18.0.1 as its toolchain
  • A RISC-V sysroot (AKA riscv64, or rv64) has been added. It is not supported. It is present to aid bringup for
    OS vendors, but it's not yet a supported Android ABI. It will not be built by default.
  • Added APP_SUPPORT_FLEXIBLE_PAGE_SIZES for ndk-build and ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES for CMake.
  • The unsupported libclang, libclang-cpp, libLLVM, and libLTO libraries were removed to save space.

@grendello grendello force-pushed the dev/grendel/ndk-r27 branch 3 times, most recently from 96f7a5a to 64e69a8 Compare June 18, 2024 14:08
@grendello
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@grendello grendello force-pushed the dev/grendel/ndk-r27 branch 2 times, most recently from e453c75 to fb90280 Compare June 20, 2024 07:57
grendello added a commit that referenced this pull request Jun 20, 2024
Context: https://github.com/dotnet/android/wiki/Android-support-for-devices-with-16k-pages
Context: #9020

Starting sometime next year Google will require all packages submitted
to the Play Store to be aligned to 16 bytes, in order to support Android
devices which use 16kb pages instead of the currently supported 4kb
ones.  The requirement also applies to native shared libaries (`.so`),
which need to be linked so that their loaded sections are aligned to
16kb as well.

This commit implements changes which make the alignment configurable,
while still defaulting to 4kb alignment.  The #9020 PR will enable (when
NDK r27 is released) building of our runtime shared libraries with 16kb
alignment.  While strictly speaking NDK r27 is not necessary to enable
16kb alignment for the runtime (we could just modify our
`CMakeLists.txt` script to pass the appropriate flag), I prefer to rely
on the "official" support once NDK r27 is out.

Linking of application shared libraries, however, doesn't use the NDK at
all, and in this case we must pass the appropriate flag to the linker
explicitly.

This commit also prepares our runtime to verify alignment correctly when
changing between 4k and 16k.
grendello added a commit that referenced this pull request Jun 20, 2024
Context: https://github.com/dotnet/android/wiki/Android-support-for-devices-with-16k-pages
Context: #9020

Starting sometime next year Google will require all packages submitted
to the Play Store to be aligned to 16 bytes, in order to support Android
devices which use 16kb pages instead of the currently supported 4kb
ones.  The requirement also applies to native shared libaries (`.so`),
which need to be linked so that their loaded sections are aligned to
16kb as well.

This commit implements changes which make the alignment configurable,
while still defaulting to 4kb alignment.  The #9020 PR will enable (when
NDK r27 is released) building of our runtime shared libraries with 16kb
alignment.  While strictly speaking NDK r27 is not necessary to enable
16kb alignment for the runtime (we could just modify our
`CMakeLists.txt` script to pass the appropriate flag), I prefer to rely
on the "official" support once NDK r27 is out.

Linking of application shared libraries, however, doesn't use the NDK at
all, and in this case we must pass the appropriate flag to the linker
explicitly.

This commit also prepares our runtime to verify alignment correctly when
changing between 4k and 16k.
@grendello grendello force-pushed the dev/grendel/ndk-r27 branch from fb90280 to 14ed91e Compare June 21, 2024 08:51
@grendello grendello force-pushed the dev/grendel/ndk-r27 branch 2 times, most recently from 2d632d7 to c96e706 Compare July 5, 2024 15:33
@grendello
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@grendello grendello force-pushed the dev/grendel/ndk-r27 branch from c96e706 to 4eb0ca7 Compare July 19, 2024 10:04
@grendello grendello changed the title Bump to NDK r27-rc1/beta2 Bump to NDK r27 Jul 19, 2024
@grendello grendello marked this pull request as ready for review July 19, 2024 10:13
@grendello grendello requested a review from jonpryor as a code owner July 19, 2024 10:13
@grendello grendello force-pushed the dev/grendel/ndk-r27 branch from 4eb0ca7 to 2b5758d Compare July 19, 2024 16:06
@grendello grendello merged commit 05bc90a into main Jul 19, 2024
56 of 58 checks passed
@grendello grendello deleted the dev/grendel/ndk-r27 branch July 19, 2024 22:40
grendello added a commit that referenced this pull request Jul 23, 2024
* main: (23 commits)
  Localized file check-in by OneLocBuild Task (#9129)
  [ci] Disable CodeQL on CI/PR pipelines (#9128)
  Refine 16k page alignment support (#9075)
  [build] fix `ConfigureLocalWorkload` target (#9124)
  Bump to NDK r27 (#9020)
  [ci] Use drop service for SDK insertion artifacts  (#9116)
  Fix up all mapping paths (#9121)
  [ci] Fix maestro publishing for stable packages (#9118)
  Bump to dotnet/sdk@2f14fea98b 9.0.100-preview.7.24367.21 (#9108)
  Missing androidx.window.[extensions|sidecar] warnings (#9085)
  [ci] Use sign-artifacts template for macOS signing (#9091)
  [ci] Use DotNetCoreCLI to sign macOS files (#9102)
  [ci] Disable CodeQL on macOS, Linux, non-main jobs (#9111)
  [tests] re-enable `JavaAbstractMethodTest` (#9097)
  [Microsoft.Android.Sdk.ILLink] preserve types with `IJniNameProviderAttribute` (#9099)
  [Mono.Android] Data sharing and Close() overrides (#9103)
  [AndroidManifest] Add `Android.App.PropertyAttribute` (#9016)
  [Mono.Android] Add support for AndroidMessageHandler ClientCertificates (#8961)
  [Mono.Android] Bind and enumify API-35 (#9043)
  Bump to dotnet/java-interop@7a058c0e (#9066)
  ...
@github-actions github-actions bot locked and limited conversation to collaborators Aug 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant