Skip to content

zlib: compile Android CPU feature implementation - #65773

Open
luoqianlin wants to merge 1 commit into
nodejs:mainfrom
luoqianlin:android-zlib-cpu-features
Open

zlib: compile Android CPU feature implementation#65773
luoqianlin wants to merge 1 commit into
nodejs:mainfrom
luoqianlin:android-zlib-cpu-features

Conversation

@luoqianlin

@luoqianlin luoqianlin commented Sep 4, 2026

Copy link
Copy Markdown

Fix the Android zlib build by compiling the Android NDK CPU feature
implementation as part of the zlib target.

On Android, zlib/cpu_features.c calls android_getCpuFeatures(). The
function is implemented by the NDK source
sources/android/cpufeatures/cpu-features.c, but listing only zlib's local
sources leaves that implementation out of the link.

The GYP target now builds a small checked-in wrapper that includes that source
through the configured Android NDK include path. This keeps the generated
source and object paths relative to the Node.js checkout, which is required by
the Make and Ninja GYP generators. No machine-specific absolute path is
committed.

NDK r29 with Android API 30 and arm64 is the current validation baseline.

Refs: #65771

Validation:

  • git diff --check
  • Android arm64/API 30 GYP generation includes the checked-in wrapper and the
    configured NDK CPU feature include path.
  • Android arm64/API 30 build links without an undefined
    android_getCpuFeatures symbol.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/security-wg

@nodejs-github-bot nodejs-github-bot added dependencies PRs that add, update, or configure Node.js dependencies. needs-ci PRs that need a full CI run. zlib Issues and PRs related to the zlib module and its compression dependencies. labels Sep 4, 2026
@MikeMcC399 MikeMcC399 added the android Issues and PRs related to the Android platform. label Sep 4, 2026
@luoqianlin luoqianlin changed the title zlib: include Android CPU feature implementation zlib: compile Android CPU feature implementation Sep 4, 2026
@luoqianlin
luoqianlin force-pushed the android-zlib-cpu-features branch from cb95eea to c34d3ba Compare September 4, 2026 12:34
@luoqianlin
luoqianlin requested a review from a team as a code owner September 4, 2026 12:34
Signed-off-by: luoqianlin <qianlinluo@foxmail.com>
@luoqianlin
luoqianlin force-pushed the android-zlib-cpu-features branch from c34d3ba to 37ab30f Compare September 4, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

android Issues and PRs related to the Android platform. dependencies PRs that add, update, or configure Node.js dependencies. needs-ci PRs that need a full CI run. zlib Issues and PRs related to the zlib module and its compression dependencies.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants