Skip to content

feat: add Android arm64 Bionic support#62

Draft
besmpl wants to merge 3 commits into
go-webgpu:mainfrom
besmpl:besmpl/android-arm64-bionic
Draft

feat: add Android arm64 Bionic support#62
besmpl wants to merge 3 commits into
go-webgpu:mainfrom
besmpl:besmpl/android-arm64-bionic

Conversation

@besmpl

@besmpl besmpl commented Jul 15, 2026

Copy link
Copy Markdown

Summary

Android arm64/API 29+ is carried as a reviewable preview candidate rooted at canonical goffi v0.6.0 (895a3fa). The candidate keeps the public module path and the required runtime work while separating the review surface into dependency-ordered commits:

  1. 23ffa02a034ef7eca98776ee586dd51c70bee0e0 — Bionic platform loader and __errno/errno routing for cgo=0 and cgo=1.
  2. b1503fc4ed4e6c0f92ae4f7707a70ddc0284d8a0 — Android arm64 fakecgo startup, four-argument _cgo_init, API/TLS guard, Bionic layouts/imports, and explicit callback rejection.
  3. 8ccaae72d877a7af0af4b628bf86e92536e27d88 — generated-source, NDK ABI, cross-build/ELF probes, CI matrix, and preview documentation.

The exact branch head is 8ccaae72d877a7af0af4b628bf86e92536e27d88. The previously published one-commit head is preserved at besmpl/archive/android-arm64-bionic-3d665de, 3d665de6d43af35dd6dae005ef09231c15b0d456.

Android loader mappings remain process-lifetime mappings (RTLD_NODELETE); FreeLibrary is retained for API symmetry. Android callbacks fail with a stable panic until foreign-thread startup has physical-device evidence.

Validation

The Android check passed on both audited toolchains with NDK r29 (29.0.14206865):

ANDROID_NDK_HOME=/path/to/android-ndk-r29 GOTOOLCHAIN=go1.25.12+auto ./scripts/check-android-arm64.sh
ANDROID_NDK_HOME=/path/to/android-ndk-r29 GOTOOLCHAIN=go1.26.5+auto ./scripts/check-android-arm64.sh

Each run covers CGO_ENABLED=0 and CGO_ENABLED=1, generated fakecgo freshness, Bionic LP64 header/layout assertions, AArch64 ELF dependencies, callback/glibc symbol rejection, startup/TLS disassembly, and same-call loader-error capture. Focused host go test ./ffi ./types passes in both cgo modes; root module verification, formatting, shell syntax, and diff checks are clean.

Evidence boundary

This is intentionally still a draft. Cross-build, ABI, and ELF evidence does not prove process startup, adapter use, rendering, or presentation on a physical API 29 or API 30+ arm64 device. No released Android support claim is made, and Android callback support remains explicitly unavailable.

Downstream crosslink

The corresponding WGPU Android implementation preview is gogpu/wgpu#268; it should consume this exact goffi head 8ccaae72d877a7af0af4b628bf86e92536e27d88 while both pull requests remain drafts.

@besmpl

besmpl commented Jul 15, 2026

Copy link
Copy Markdown
Author

Consumer integration preview: gogpu/wgpu#268 at exact head b11d2671e80081a191705c41c4e77e8b61472017 pins this PR's exact head 3d665de6d43af35dd6dae005ef09231c15b0d456 in temporary CI.

The WGPU module commits no replace, go.work, personal fork path, or forked module version. Its PR is explicitly draft/non-mergeable until this work has a canonical release and physical-device evidence is available.

@besmpl besmpl force-pushed the besmpl/android-arm64-bionic branch from 3d665de to 2524e33 Compare July 15, 2026 18:03
@besmpl besmpl force-pushed the besmpl/android-arm64-bionic branch from 2524e33 to 8ccaae7 Compare July 15, 2026 18:09
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.

1 participant