mirror of
https://github.com/termux-pacman/termux-packages.git
synced 2025-12-27 06:00:10 +00:00
By setting `CMAKE_ANDROID_ARM_MODE` we get the normal
`armv7-linux-androideabi` target which we set:
https://github.com/termux/termux-packages/blob/master/scripts/build/setup/termux_setup_rust.sh#L5
See
https://github.com/corrosion-rs/corrosion/blob/master/cmake/FindRust.cmake#L705-L711:
elseif (ANDROID)
if (CMAKE_ANDROID_ARCH_ABI STREQUAL armeabi-v7a)
if (CMAKE_ANDROID_ARM_MODE)
set(_Rust_ANDROID_TARGET armv7-linux-androideabi)
else ()
set(_Rust_ANDROID_TARGET thumbv7neon-linux-androideabi)
endif()
This avoids having to install another rust target, and actually fixes
the current 32-bit arm build which before this change fails with:
cargo:warning=crypto/curve25519/asm/x25519-asm-arm.S:36:1: error: invalid instruction, any one of the following would fix this:
cargo:warning=strd r4,[sp,#0]
cargo:warning=^
cargo:warning=crypto/curve25519/asm/x25519-asm-arm.S:36:14: note: too few operands for instruction
cargo:warning=strd r4,[sp,#0]
cargo:warning= ^
cargo:warning=crypto/curve25519/asm/x25519-asm-arm.S:36:1: note: instruction requires: armv5te
cargo:warning=strd r4,[sp,#0]
cargo:warning=^
cargo:warning=crypto/curve25519/asm/x25519-asm-arm.S:36:1: note: instruction requires: thumb2
cargo:warning=strd r4,[sp,#0]
This seems to be due to cmake (targetting 16-bit Thumb processors if
`CMAKE_ANDROID_ARM_MODE` is not set -
https://cmake.org/cmake/help/latest/variable/CMAKE_ANDROID_ARM_MODE.html:
> When Cross Compiling for Android and CMAKE_ANDROID_ARCH_ABI is set to one of the
> armeabi architectures, set CMAKE_ANDROID_ARM_MODE to ON to target 32-bit ARM processors
> (-marm). Otherwise, the default is to target the 16-bit Thumb processors (-mthumb).
I don't know what has changed since the original taskwarrior 3.0.2 bump
built successfully:
0658b35d86