Skip to content

Add 32-bit ARM (armeabi-v7a) Android target support#33

Closed
jappeace-sloth wants to merge 1 commit intojappeace:masterfrom
jappeace-sloth:armv7a-android-support
Closed

Add 32-bit ARM (armeabi-v7a) Android target support#33
jappeace-sloth wants to merge 1 commit intojappeace:masterfrom
jappeace-sloth:armv7a-android-support

Conversation

@jappeace-sloth
Copy link
Copy Markdown

Summary

  • Parameterize Nix files with androidArch parameter (default "aarch64") to support both arm64-v8a and armeabi-v7a targets
  • Multi-arch APK: mkApk now accepts a sharedLibs list of { lib, abiDir } for bundling multiple architectures
  • Patch nixpkgs compiler-rt for armv7a: add to ARM32 arch set, fix baremetal arch detection (COMPILER_RT_DEFAULT_TARGET_ONLY), exclude os_version_check.c (no pthread.h in baremetal)
  • Patch LLVM package set: use libstdcxxClang (no libcxx dependency) for Android targets, avoiding unbuildable libcxx bootstrap (GNU ld.bfd can't link Android libraries due to zstd compression, path mismatches)
  • Disable profiled libraries for armv7a (LLVM ARM backend llc crash in ARMAsmPrinter::emitXXStructor)
  • Update nixpkgs pin to fix broken = useLLVM in GHC (haskell.compiler.ghc{948,967,984,9102,9103,9121,9122}: backport patches for LLVM support NixOS/nixpkgs#440774)

Closes #28

Test plan

  • nix-build nix/android.nix — aarch64 (default) builds successfully
  • nix-build nix/android.nix --arg androidArch '"armv7a"' — armv7a builds successfully
  • nix-build nix/ci.nix -A native -A android-aarch64 -A android-armv7a — all CI targets pass
  • Output contains correct ABI directories: lib/arm64-v8a/ and lib/armeabi-v7a/
  • APK build (nix-build nix/apk.nix) — needs i686-linux builder support for Android SDK tools

🤖 Generated with Claude Code

Enables haskell-mobile to cross-compile for armv7a-android, targeting
Wear OS devices that ship 32-bit ARM userspace only (e.g. OnePlus Watch 3).

Key changes:
- Parameterize nix/lib.nix, cross-deps.nix, android.nix with androidArch
- Multi-arch APK support in mkApk (accepts sharedLibs list)
- Update nixpkgs pin for GHC LLVM backend fix (NixOS/nixpkgs#440774)
- Patch nixpkgs compiler-rt for armv7a: add to ARM32 arch set, fix
  baremetal arch detection, exclude os_version_check.c (no pthread.h)
- Patch LLVM package set: use libstdcxxClang (no libcxx dep) for Android
  to avoid unbuildable libcxx bootstrap (GNU ld.bfd can't link Android libs)
- Disable profiled libraries for armv7a (LLVM ARM backend llc crash in
  ARMAsmPrinter::emitXXStructor)

Closes jappeace#28

Prompt: continue implementing armv7a-android support (issue jappeace#28), fixing
libcxx bootstrap linker issue and LLVM profiling crash

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jappeace-sloth
Copy link
Copy Markdown
Author

Superseded by #34 which was already merged and contains all commits from this PR.

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.

Support 32-bit ARM (armeabi-v7a) Android targets for Wear OS

1 participant