5

A freshly downloaded NDK fails on linking old projects with error:

/usr/bin/ld: unrecognised emulation mode: armelf_linux_eabi

As it appears, clang hides behind the mask of gcc:

/opt/android-ndk-r18b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc --version
Android (4751641 based on r328903) clang version 7.0.2 (https://android.googlesource.com/toolchain/clang 003100370607242ddd5815e4a043907ea9004281) (https://android.googlesource.com/toolchain/llvm 1d739ffb0366421d383e04ff80ec2ee591315116) (based on LLVM 7.0.2svn)
Target: arm--linux-android
Thread model: posix
InstalledDir: /opt/android-ndk-r18b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../../../../llvm/prebuilt/linux-x86_64/bin

Is it just a bug in this NDK version or it was made by intent?

hutorny
  • 863
  • 11
  • 17

1 Answers1

8

It's as it should be.

GCC was deprecated in r15, and removed in r18. But to ease the transition for developers, wrapper scripts were provided which makes it seem like GCC still exists while actually using Clang.

Michael
  • 57,169
  • 9
  • 80
  • 125
  • 1
    FWIW, you'll find the same thing on a Mac. – Dan Albert Nov 29 '18 at 20:21
  • 1
    Not being able to find the linker is something we fixed in r19, but it looks like r19 still won't find the crt objects because Clang only knows how to find them for a versioned target... `arm-linux-androideabi-gcc -target arm-linux-androideabi16` works as expected, but the idea what that `arm-linux-androideabi-gcc -D__ANDROID_API__=16 --sysroot $NDK/sysroot -L $NDK/platforms/android-16/arch-arm/usr/lib` should work since that worked before. Not sure that can be fixed trivially. – Dan Albert Nov 29 '18 at 20:42
  • 1
    I'm probably just going to remove these since they aren't actually useful: https://github.com/android-ndk/ndk/issues/862 – Dan Albert Nov 29 '18 at 20:58