Skip to content

framework: add support armv7 and x86_32#1541

Closed
jagobagascon wants to merge 2 commits into
bazel-contrib:mainfrom
jagobagascon:feature/add-support-for-32bit-architectures
Closed

framework: add support armv7 and x86_32#1541
jagobagascon wants to merge 2 commits into
bazel-contrib:mainfrom
jagobagascon:feature/add-support-for-32bit-architectures

Conversation

@jagobagascon
Copy link
Copy Markdown
Contributor

Adds CMAKE support for armv7 and x86_32 architectures.

fixes #1540


SUPPORTED_CPU = [
"aarch64",
"armv7",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't forget to update triplet_name, too; one way to get the correct value is to run config.guess on the machine in question, or you can use config.sub to normalize from a different platform.

Adds CMAKE support for armv7 and x86_32 architectures.

fixes bazel-contrib#1540
@jagobagascon jagobagascon force-pushed the feature/add-support-for-32bit-architectures branch from 8ddfa1f to a97817d Compare May 29, 2026 09:27
@novas0x2a
Copy link
Copy Markdown
Collaborator

@jagobagascon can you retest with #1555 and make sure I didn't break it? I did a more comprehensive fix (android and linux use different names for the same cpu family...)

@jagobagascon
Copy link
Copy Markdown
Contributor Author

@jagobagascon can you retest with #1555 and make sure I didn't break it? I did a more comprehensive fix (android and linux use different names for the same cpu family...)

Yes it works. Thank you so much!

novas0x2a added a commit that referenced this pull request Jun 4, 2026
…1555)

Based on #1541 by @jagobagascon; should fix #1540 (android cmake builds
for armeabi-v7a/x86 failing with "target_arch is unknown").

`x86_32` is `i686` everywhere. `armv7` depends on the target OS: Linux
reports `armv7l` (`uname -m` / config.guess), but CMake's NDK support
only accepts `armv7-a` and `FATAL_ERROR`s on anything else (see
[`Android-Determine.cmake`](https://gitlab.kitware.com/cmake/cmake/-/blob/v3.31.12/Modules/Platform/Android-Determine.cmake#L358)),
which mirrors the NDK's canonical
[`meta/abis.json`](https://android.googlesource.com/platform/ndk/+/refs/tags/ndk-r28c/meta/abis.json)
(`armeabi-v7a` -> `armv7-a`, `x86` -> `i686`). So the static
`_TARGET_OS_PARAMS` / `_TARGET_ARCH_PARAMS` dicts are replaced with a
single `_cmake_target_params(os, arch)` function (mirroring
`triplet_name`), with armv7 handled inline as the exception.

`triplet_name` gets the config.guess linux triplets
`armv7l-unknown-linux-gnueabihf` and `i686-pc-linux-gnu` for the
autotools path. (We have no known users of android/autotools, so
triplet_name doesn't support it currently).

Co-authored-by: Jagoba Gascón <jagoba@arima.eu>
@novas0x2a
Copy link
Copy Markdown
Collaborator

should be fixed now!

@novas0x2a novas0x2a closed this Jun 5, 2026
@jagobagascon
Copy link
Copy Markdown
Contributor Author

Thank you so much!

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.

android: unknown target error when compiling for 32bit after upgrading to v0.15.1

2 participants