Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android NDK GCC appears to be clang - is it the way it should be?

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?

like image 427
hutorny Avatar asked Nov 29 '18 09:11

hutorny


1 Answers

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.

like image 200
Michael Avatar answered Oct 29 '22 18:10

Michael