Skip to content

Conversation

@ysxlmk
Copy link

@ysxlmk ysxlmk commented Feb 5, 2026

Summary / 概述

This PR adds support for Android 16KB page size devices (Android 15+).

本 PR 为 Matrix 添加了 Android 16KB 页面大小设备(Android 15+)的支持。

Changes / 修改内容

Build Environment Updates / 构建环境升级

  • NDK: 27.0.12077973 (NDK 27+ supports 16KB alignment by default / NDK 27+ 默认支持 16KB 对齐)
  • Gradle: 7.5
  • Android Gradle Plugin: 7.4.2
  • Kotlin: 1.6.21

Key Modifications / 主要修改

  1. CMakeLists.txt - Added 16KB alignment linker options to all native modules / 为所有 native 模块添加 16KB 对齐链接选项:

    add_link_options(-Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384)
  2. build.gradle - Added NDK version specification to modules with native code / 为包含 native 代码的模块指定 NDK 版本

  3. Code Compatibility Fixes / 代码兼容性修复:

    • Added missing headers (<cassert>, <utility>) for NDK 27 compatibility / 添加 NDK 27 所需的缺失头文件
    • Fixed version script files (.ver) to remove undefined symbols / 修复版本脚本文件,移除未定义的符号
    • Added -Wno-deprecated-declarations flag where needed / 添加必要的编译选项

Affected Modules / 涉及模块

  • matrix-android-commons
  • matrix-backtrace
  • matrix-hooks
  • matrix-fd
  • matrix-io-canary
  • matrix-mallctl
  • matrix-memguard
  • matrix-opengl-leak
  • matrix-trace-canary
  • matrix-traffic
  • matrix-resource-canary-android
  • matrix-sqlite-lint-android-sdk

References / 参考资料

适配16kb---基于v2.0.8
@tencent-adm
Copy link
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


moy seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants