Android: Wrong binutils when building with NDK r19+
Building with cmake 3.16 with the toolchain file:
set(CMAKE_SYSTEM_NAME Android)
set(CMAKE_SYSTEM_VERSION 21)
set(CMAKE_ANDROID_ARCH_ABI armeabi-v7a)
set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION clang)
set(CMAKE_ANDROID_STL_TYPE c++_static)
set(CMAKE_ANDROID_ARM_NEON TRUE)
set(CMAKE_ANDROID_ARM_MODE TRUE)
Under NDK r18b, cmake finds the correct version of objcopy with arm support:
//Path to a program.
CMAKE_NM:FILEPATH=<path-to-ndk>/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-nm
//Path to a program.
CMAKE_OBJCOPY:FILEPATH=<path-to-ndk>/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-objcopy
//Path to a program.
CMAKE_OBJDUMP:FILEPATH=<path-to-ndk>/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-objdump
but under NDK r20, it defaults to the system objcopy, which doesn't support arm:
//Path to a program.
CMAKE_NM:FILEPATH=/usr/bin/nm
//Path to a program.
CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy
//Path to a program.
CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump
this seems to effect the entire suite of CMAKE_
binutils programs, and even CMAKE_LINKER
+ CMAKE_AR
, but linking still works ok when doing builds.