Fix armv6 cross-compile target

Similar changes as c09ee66e69.

Also had to use -march instead of -mcpu (also inconsistent with GCC docs),
and disable Thumb.
This commit is contained in:
Splendide Imaginarius 2024-09-03 03:29:11 +00:00
parent 1f1b5105e0
commit a1d438b5dd
2 changed files with 7 additions and 2 deletions

View file

@ -9,5 +9,5 @@ cmake = 'cmake'
[host_machine]
system = 'linux'
cpu_family = 'arm'
cpu = 'generic-armv6+fp'
cpu = 'generic-armv6zk+vfpv2'
endian = 'little'

View file

@ -21,7 +21,12 @@
export ARCH=armv6
export ARCH_OPENSSL=armv4
export ARCH_CFLAGS="-mcpu=generic-armv6+fp -mtune=generic-armv6+fp"
# -march flags from:
# https://raspberrypi.stackexchange.com/questions/2046/which-cpu-flags-are-suitable-for-gcc-on-raspberry-pi
# https://stackoverflow.com/questions/35132319/build-for-armv6-with-gnueabihf
# Disable Thumb since Raspbian doesn't use it and it produces a compiler error:
# https://thinkingeek.com/2014/12/20/arm-assembler-raspberry-pi-chapter-22/
export ARCH_CFLAGS="-march=armv6zk+vfpv2 -marm"
export ARCH_CONFIGURE=arm-linux-gnueabihf
export CC="$ARCH_CONFIGURE-gcc"
export ARCH_CMAKE_TOOLCHAIN=toolchain-arm32.cmake