Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android NDK - make standalone toolchain fails

I tried to make a standalone Android NDK toolchain on Linux 64 bit:

~/build/android-ndk-r9/build/tools $ ./make-standalone-toolchain.sh --platform=android-14 --ndk-dir=/home/user/build/android-ndk-r9 --system=linux-x86_64 --install-dir=/home/user/build/android-14-toolchain Auto-config: --toolchain=arm-linux-androideabi-4.6 Copying prebuilt binaries...

No files are actually copied. Something goes wrong. The NDK ist the latest release r9. How can I run the script so that the files get copied to the installation directory?

like image 738
user2759621 Avatar asked Oct 02 '13 17:10

user2759621


People also ask

What is standalone toolchain?

A toolchain which is ready to use with all the configuration that is the system headers and libraries in the correct path . For Android it will also have the API headers in the path where the toolchain can look it up. Why the term "standalone"?

What is NDK toolchain?

You can use the toolchains provided with the Android NDK independently or as plug-ins with an existing IDE. This flexibility can be useful if you already have your own build system, and only need the ability to invoke the cross-compiler in order to add support to Android for it.

What is NDK Sysroot?

$NDK/sysroot is the unified headers and is what you should be using when compiling. When linking, you should still be using $NDK/platforms/android-$API/arch-$ARCH . We do have a doc explaining how to use unified headers in a custom build system: android.googlesource.com/platform/ndk/+/master/docs/….

What compiler does NDK use?

Code written in C/C++ can be compiled to ARM, or x86 native code (or their 64-bit variants) using the Android Native Development Kit (NDK). The NDK uses the Clang compiler to compile C/C++. GCC was included until NDK r17, but removed in r18 in 2018.


1 Answers

A suggestion: Use the --verbose option if you haven't already done so; it will tell you in which stage the error occurs.

Here are the options I ran to make a standalone toolchain targeting android-14 and arm-linux-androideabi-4.7

    sudo sh make-standalone-toolchain.sh --verbose --toolchain=x86-4.7\
    --install-dir=/project/arm-cc --ndk-dir=/project/android/ndk/android-ndk-r9\
    --platform=android-14
like image 110
MonaLisaOverdrive Avatar answered Sep 21 '22 15:09

MonaLisaOverdrive