android / android/ndk

[Bug]: NDK r27c Release Contains r27-beta1 Libraries

Open
#2,205 2 comments 0 reactions 1 assignee Claimed by @pirama-arumuga-nainar View on GitHub
bug
Dominant language
No language data
Stars
2.3k
Forks
310
PR merge metrics
No merged PRs in 30d

Description

## Description
The [official Android NDK r27c release](https://github.com/android/ndk/releases/tag/r27c) (`android-ndk-r27c-linux.zip`) contains pre-built C++ standard library binaries (`libc++_shared.so`) that are actually from NDK r27-beta1, not r27c. This causes ABI incompatibility issues with binaries compiled using the r27c toolchain.

## Evidence

### Build ID Mismatch
**NDK r27c official release:**
```bash
$ readelf -p .note.android.ident ./android-ndk-r27c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/libc++_shared.so
String dump of section '.note.android.ident':
[ c] Android
[ 18] r27-beta1
[ 58] 11883388
```

The library reports:
- Version: `r27-beta1` (should be `r27c`)
- Build ID: `11883388` (beta1) instead of expected `12479018` (r27c)

## Expected Behavior
The `android-ndk-r27c-linux.zip` release should contain pre-built libraries with:
- Version string: `r27c`
- Build ID: `12479018`
- ABI-compatible with binaries compiled using the r27c toolchain

## Reproduction
1. Download `android-ndk-r27c-linux.zip` from the official NDK releases page
2. Extract and check the build info:
```bash
readelf -p .note.android.ident android-ndk-r27c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/libc++_shared.so
```
3. Observe it shows `r27-beta1` (11883388) instead of `r27c` (12479018)

## Impact
- Binaries compiled with NDK r27c toolchain cannot safely use the pre-built libraries from the r27c distribution
- This breaks binary compatibility guarantees
- Developers are forced to either:
- Use beta1 libraries (risking uncompiled code issues)
- Rebuild the standard library themselves
- Use an older/different NDK version

## Questions for Google NDK Team
1. Was the r27c release intentionally rebased on r27-beta1, or is this an oversight?
2. Is there a separate source of r27c (12479018) pre-built libraries available?
3. Should the r27c release be republished with correct libraries, or should documentation be updated?

## Tested Environment
- Official NDK r27c release: `android-ndk-r27c-linux.zip`
- Host: Linux x86_64
- Target: x86_64-linux-android (API 26)

### Upstream bug

_No response_

### Commit to cherry-pick

_No response_

### I am using a supported NDK

- [x] I have checked and the NDK I'm using is currently supported

### Affected versions

r27

### Host OS

Linux

### Host OS version

42.20251031.1 (Kinoite) stable

### Affected ABIs

x86_64

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.