Android (Command Line)

From Crypto++ Wiki
Jump to navigation Jump to search

This page will provide instructions for cross-compiling Crypto++ on the command line for Android. The instructions below provide a treatment of building from the command line with a script that sets the environment and a makefile tuned for cross-compiles. If you want to try an, then see below.

There are four steps to building Crypto++ for Android, and the process will create an Android version of cryptest.exe, the dynamic library, and the static library. After building the library, you can push cryptest.exe and the test vectors to the device, and then execute the tests using a remote shell.

While you can use the Crypto++ shared object directly though JNI, you will likely provide an application specific shared object with C-style external interfaces which depends upon the static Crypto++ library. The C-style interface will make your shared object easy to call using JNI; while the Crypto++ static library will allow you to aggressively strip unused code.

Three related pages for Android are Android Setup (Command Line), (Command Line) and Android Activity. Android Setup (Command Line) discusses how to setup an Android build machine. (Command Line) builds the library using and Android Activity uses the Crypto++ shared object in an Android activity.

Note: at Crypto++ 5.6.3, the patches that used to be required were added to the library, so you won't need to apply them. was also added to the library sources in March 2016. It is available in Git and library ZIP files after 5.6.3. Also see Commit 22d6374ce7151ad0, Added Android and embedded environment and test script.

Before we begin, the history of needs to be explained. From about 2011 or 2012 until about 2018 the project used It supported Android NDK r6 or so up to about NDK r15. At around NDK r15 the script needed to be rewritten due to changes in the NDK. The original script from 2011-2018 was renamed to Also see Commit 7aa3377bbdfa.

In 2018 was modified to support the updated NDK. The updated NDK is r15 or r16 and above. A lot of breaking changes occurred in the NDK so the script had a lot of reworking. Thanks to Skycoder for doing the work. Also see PR #546, Apply updated android build rules.

In 2018 Android announced Clang was the new default compiler, and GCC support was going to be dropped. In response our recently updated was renamed to Also see Commit e2bc3b55caab.

We are currently working on, but it is not ready to be checked-in.

In short, here are the variations you should used based on NDK and compiler:

  • Old NDK (< r15), GCC compiler -
  • New NDK (r16 ~ r18), GCC compiler -
  • New NDK (> r16), Clang compiler -

When you see used below in the procedures, please know it is one of the three scripts listed above.

Set the Environment


Before you begin you must set the cross-compilation environment. Setting the environment will do two things. First, it will ensure the Android toolchain is on-path. Second, it will ensure some environmental variables are set so the makefile picks up specific device flags. For example, the script will set IS_ANDROID, AOSP_SYSROOT, AOSP_STL_INC and AOSP_STL_LIB.

You must set ANDROID_NDK_ROOT prior to running the script. You should also set ANDROID_SDK_ROOT for that matter, though its not used for cross-compiling. Android recommends setting both ANDROID_NDK_ROOT and ANDROID_SDK_ROOT because the NDK and SDK use the variables internally. For details, see Recommended NDK Directory?.

Perform the following to run the script. The source command is required to make changes to the current shell.

$ source 
ANDROID_NDK_ROOT: /opt/android-ndk
AOSP_TOOLCHAIN_PATH: /opt/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin
AOSP_ABI: armeabi-v7a
AOSP_API: android-21
AOSP_SYSROOT: /opt/android-ndk/platforms/android-21/arch-arm
AOSP_FLAGS: -march=armv7-a -mfpu=neon -mfloat-abi=softfp -Wl,--fix-cortex-a8 -funwind-tables -fexceptions -frtti
AOSP_STL_INC: /opt/android-ndk/sources/cxx-stl/gnu-libstdc++/4.9/include
AOSP_STL_LIB: /opt/android-ndk/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/
AOSP_BITS_INC: /opt/android-ndk/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include
CPU FEATURES: cpu-features.h and cpu-features.c are present takes two optional arguments. The first optional argument is the architecture. The default is armeabi-v7a. Architectures can be one of:

  • armeabi
  • armeabi-v7a
  • armeabi-v7a-hard
  • arm64-v8a
  • mips
  • mips64
  • x86
  • x86_64

The second optional argument is a STL library. The default is the GNU runtime and STL library as a shared library. STL libraries can be one of the following:

  • gnu-static
  • gnu-shared
  • llvm-static
  • llvm-shared
  • stlport-static
  • stlport-shared

There are three caveats when selecting runtime and STL libraries. First, using GNU's runtime and STL library has severe licensing requirements. Its not uncommon to perform contract work with clauses that forbid any GNU licensed components.

Second, all projects must use the same runtime and STL libraries. You cannot use STLport for Crypto++ and then use the resulting binary in a Qt project. Qt uses GNU's runtime and STL library, and mixing and matching of runtime libraries causes obscure memory errors.

Third, if more than one library requires the C++ runtime or STL library, then you must use the dynamic version of the library. For example, if you are using Qt and Crypto++ and they depend on the GNU gear, then you must use

By default, the script uses the ARMv7a eabi, GNU runtime in a shared library configuration and the Android 21 API (Android 5.0). If you want to use STLport rather than GNU's C++ runtime library, then you have to specify both an architecture and runtime. Below are some additional ways to invoke the script.

# Build for Android 4.0
AOSP_API="android-14" source

# Build for Android 4.4
AOSP_API="android-19" source

# Build for ARM with hard floats
$ source hard

# Build for ARM with NEON
$ source neon

# Build for ARM64 (AARCH64)
$ source arm64

# Build for ARM64 (again)
$ source armv8a

# Build for MIPS
$ source mips

# Build for MIPS64
$ source mips64

# Build using GCC 4.8 toolchain
$ $ AOSP_TOOLCHAIN_SUFFIX="4.8" source

Build the Library

Building the library consists of running the following command after setting the environment:

$ make -f GNUmakefile-cross static shared
arm-linux-androideabi-g++ -DNDEBUG -g2 -O3 -fPIC -pipe -march=armv7-a -mfpu=neon
 -mfloat-abi=softfp -Wl,--fix-cortex-a8 -funwind-tables -fexceptions -frtti -DAN
DROID --sysroot=/opt/android-ndk/platforms/android-21/arch-arm -Wa,--noexecstack
 -I/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/4.9/include -I/opt/android-ndk
/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -c cryptlib.cpp
arm-linux-androideabi-g++ -DNDEBUG -g2 -O3 -fPIC -pipe -march=armv7-a -mfpu=neon
 -mfloat-abi=softfp -Wl,--fix-cortex-a8 -funwind-tables -fexceptions -frtti -DAN
DROID --sysroot=/opt/android-ndk/platforms/android-21/arch-arm -Wa,--noexecstack
 -I/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/4.9/include -I/opt/android-ndk
/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -c cpu.cpp
arm-linux-androideabi-g++ -DNDEBUG -g2 -O3 -fPIC -pipe -march=armv7-a -mfpu=neon
 -mfloat-abi=softfp -Wl,--fix-cortex-a8 -funwind-tables -fexceptions -frtti -DAN
DROID --sysroot=/opt/android-ndk/platforms/android-21/arch-arm -Wa,--noexecstack
 -I/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/4.9/include -I/opt/android-ndk
/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -c integer.cpp

You can verify the library was built for the correct architecture with the following.

$ find . -name cryptest.exe
$ readelf -h ./cryptest.exe | grep -i 'class\|machine'
  Class:                             ELF32
  Machine:                           ARM
$ find . -name
$ readelf -h ./ | grep -i 'class\|machine'
  Class:                             ELF32
  Machine:                           ARM

You can run ndk-depends to verify dependencies:

$ $ANDROID_NDK_ROOT/ndk-depends

If you want to use SOLIB versioning, then you must include HAS_SOLIB_VERSION=1 in the make command. For example:

$ make -f GNUmakefile-cross lean HAS_SOLIB_VERSION=1

Strip the Library

To perform dead-code stripping, be sure to link your final executable with -Wl,--gc-sections. If you link your final application against libcryptopp.a then you will see significant gains. If you link your final application against then you will experience a small gains.

You can also strip debug symbols from your final executable, but it will make back traces useless. To do so, you can strip by running arm-linux-androideabi-strip with --strip-debug, --strip-unneeded or --strip-all. arm-linux-androideabi-strip is available on path after running See arm-eabi-strip and binary size for details.

$ ls -al cryptest.exe
-rwxr-xr-x  1 jwalton  staff 42860268 Jul 29 00:41 cryptest.exe
$ arm-linux-androideabi-strip --strip-debug cryptest.exe
$ ls -al cryptest.exe
-rwxr-xr-x  1 jwalton  staff  6112963 Jul 29 00:41 cryptest.exe
$ arm-linux-androideabi-strip --strip-all cryptest.exe
$ ls -al cryptest.exe
-rwxr-xr-x  1 jwalton  staff  2903712 Jul 29 00:41 cryptest.exe
$ ls -al 
-rwxr-xr-x  1 jwalton  staff  28668308 Jul 29 00:52
$ arm-linux-androideabi-strip --strip-debug 
$ ls -al 
-rwxr-xr-x  1 jwalton  staff  5478765 Jul 29 00:52
$ arm-linux-androideabi-strip --strip-all 
$ ls -al 
-rwxr-xr-x  1 jwalton  staff  3808428 Jul 29 00:52

Additionally, there are other tricks for modest gains. See Android NDK: How to Reduce Binaries Size for details.

Execute the Program

To test on the device, you will use adb to push cryptest.exe and the test vectors to the device. Once on a device, the program will be executed with the remote shell. To begin, ensure Android's platform-tools are on path (i.e., ANDROID_SDK_ROOT/platform-tools), and your device is recognized:

$ adb devices
List of devices attached 
0380614543dfd297	device

With a device available, push cryptest.exe, TestData, and TestVectors to /data/local/tmp.

$ adb push cryptest.exe /data/local/tmp
1295 KB/s (43249212 bytes in 32.591s)
$ adb push TestData /data/local/tmp/TestData
push: TestData/xtrdh342.dat -> /data/local/tmp/TestData/xtrdh342.dat
push: TestData/xtrdh171.dat -> /data/local/tmp/TestData/xtrdh171.dat
push: TestData/usage.dat -> /data/local/tmp/TestData/usage.dat
55 files pushed. 0 files skipped.
471 KB/s (57449 bytes in 0.119s)
$ adb push TestVectors /data/local/tmp/TestVectors
push: TestVectors/whrlpool.txt -> /data/local/tmp/TestVectors/whrlpool.txt
push: TestVectors/wake.txt -> /data/local/tmp/TestVectors/wake.txt
push: TestVectors/vmac.txt -> /data/local/tmp/TestVectors/vmac.txt
33 files pushed. 0 files skipped.
3643 KB/s (1314149 bytes in 0.352s)

If you linked against or, then you will need to push it also:

$ adb push "$AOSP_STL_LIB" /data/local/tmp
3261 KB/s (3547204 bytes in 1.062s)

After pushing, open a remote shell with adb shell and verify all files are present on the device:

$ adb shell
shell@android: $ ls -l /data/local/tmp                                       
drwxrwxr-x shell     shell              2015-12-07 00:37 TestData
drwxrwxr-x shell     shell              2015-12-07 00:38 TestVectors
-rwxrwxrwx shell     shell     26930220 2015-12-07 00:36 cryptest.exe
-rwxrwxrwx shell     shell      5630724 2014-10-17 02:40
-rwxrwxrwx shell     shell      3547204 2014-12-10 05:01

With the program and test vectors on the device, execute the test program:

shell@android:/ $ cd /data/local/tmp
shell@android:/data/local/tmp $ ./cryptest.exe v
Using seed: 1374978640

Testing Settings...

passed:  Your machine is little endian.
passed:  CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS is not defined. Will restrict to aligned data access.
passed:  sizeof(byte) == 1
passed:  sizeof(word16) == 2
passed:  sizeof(word32) == 4
passed:  sizeof(word64) == 8
passed:  sizeof(hword) == 2, sizeof(word) == 4, sizeof(dword) == 8

If you linked against or, then you will need to modify LD_LIBRARY_PATH when running cryptest.exe:

shell@android:/ $ cd /data/local/tmp
shell@android:/data/local/tmp $ LD_LIBRARY_PATH=./; ./cryptest.exe v
Using seed: 1374994654

Testing Settings...

If you link to both and, then you will have to preload

shell@android:/ $ cd /data/local/tmp
shell@android:/data/local/tmp $ LD_LIBRARY_PATH=./; ./cryptest.exe v
link_image[1936]:  5431 could not load needed library './' for './cryptest.exe'
(reloc_library[1285]:  5431 cannot locate '_ZNSt12__node_alloc11_M_allocateERj'...)
shell@android:/data/local/tmp $
shell@android:/data/local/tmp $ export LD_PRELOAD=`pwd`/
shell@android:/data/local/tmp $ LD_LIBRARY_PATH=./; ./cryptest.exe v
Using seed: 1375005963

Testing Settings...

If all goes well, the tail of cryptest.exe v will display "All tests passed!" as shown below.


Install the Library

Once the library has been verified on a device, copy the header files (*.h), the dynamic library (, and the static library (libcryptopp.a) to a directory for use in other projects. You can run sudo make install PREFIX=/usr/local/cryptopp/android-armeabi-v7a since the libraries are for API 21 and ARMv7 architecture.

Under this scheme, headers will be found at /usr/local/cryptopp/android-armeabi-v7a/include, and the libraries will be found at /usr/local/cryptopp/android-armeabi-v7a/lib. You can use the following with ndk-build. ndk-build will set $(TARGET_ARCH_ABI):

  • CRYPTOPP_INCL := /usr/local/cryptopp/android-$(TARGET_ARCH_ABI)/include
  • CRYPTOPP_LIB := /usr/local/cryptopp/android-$(TARGET_ARCH_ABI)/lib

All Architectures

If you need to build all the architectures and install them, then the following script will accomplish it for you. Place the script in the root of the Crypto++ folder. Prior to running the script, ensure both ANDROID_NDK_ROOT and ANDROID_SDK_ROOT are set.

$ cat 
#!/usr/bin/env bash

for arch in armeabi armeabi-v7a armeabi-v7a-hard arm64-v8a mips mips64 x86 x86_64
    source $arch
    if [ "$?" -eq "0" ]; then
        make -f GNUmakefile-cross distclean
        make -f GNUmakefile-cross static dynamic
        sudo make -f GNUmakefile-cross install PREFIX=/usr/local/cryptopp/android-$arch

To build arm64-v8a and other new additions, you will need the NDK r10e, and you will need to use the Android 21 API. The script uses them by default.

Loading Shared Objects

Crypto++ or your shared object wrapper can be loaded in a number of different ways on Android. Development environments, like QT, can further complicate matters because of the way it calls dlopen. If you are experiencing an UnsatisfiedLinkError: dlopen failed: library "./obj/local/armeabi-v7a/", then please see the following:

Android provides a modified makefile based build system. If you are interested in an to use with ndk-build, Eclipse, or Android Sudio, then see Pull Request 3, Add to build using android NDK. Thanks to Alex Afanasyev for providing it.

An unofficial is available at GitHub cryptopp-android. It is based on Afanasyev's pull request.

An has not been added to the Crypto++ sources because there are some open questions about using it to safely build static archives and shared objects. See, for example, No archive symbol table (run ranlib) while building libcryptopp.a through ndk-build and How to run ranlib on an archive built through

Android Activity


You can find an example of using prebuilt Crypto++ shared objects on the wiki at Android Activity. Android Activity uses a sample project called Android-PRNG, and it demonstrates two topics. First, it shows you how to integrate a prebuilt Crypto++ library shared object into a Ant-based or NDK-based project. It may work for Android Studio, too. It may even work for Eclipse, depending on how well it imports an Android java project with JNI.

Second, it shows you how to accumulate seed data from sensors that can be used to seed your software based random number generators. A generator should have a fresh seed applied with IncorporateEntropy before each call to GenerateBlock to ensure the fitness of the generator.

If you are using Android Studio, then you may need to add the following. Also see JNI and Gradle in Android Studio on Stack Overflow.

sourceSets.main {
    jni.srcDirs = []
    jniLibs.srcDir 'src/main/libs'

Keep in mind you must statically load the libraries in the order that satisfies link dependencies. An example of doing that is:

public class MyClass {
    static {

Android's C++ Library Support now recommends using ReLinker to relieve you of manually loading libraries in the correct order.


The following lists Android's GCC CXXFLAGS used by default in a NDK build. The flags were in effect for most of Android NDK. At NDK 16 Android switched to Clang as its default compiler so the flags changed. You can find the Clang flags below.

Options like -DNDEBUG, -Os, -g and -fmessage-length=0 were omitted. Some flags, like -fexception, must be used to ensure exceptions pass through C routines. Other flags must not be used, like -fno-exceptions and -fno-rtti.


  • -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector -march=armv5te -mtune=xscale -msoft-float -mthumb -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -DANDROID -Wa,--noexecstack -Wformat -Werror=format-security
  • Do not use: -fno-exceptions -fno-rtti


  • -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -mthumb -Wl,--fix-cortex-a8 -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -DANDROID -Wa,--noexecstack -Wformat -Werror=format-security
  • Do not use: -fno-exceptions -fno-rtti


  • -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -DANDROID -Wa,--noexecstack -Wformat -Werror=format-security
  • Do not use: -fno-exceptions -fno-rtti


  • -MMD -MP -MF -fpic -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -fomit-frame-pointer -funswitch-loops -finline-limit=300 -DANDROID -Wa,--noexecstack -Wformat -Werror=format-security
  • Do not use: -fno-exceptions -fno-rtti


  • -MMD -MP -MF -fpic -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -fomit-frame-pointer -funswitch-loops -finline-limit=300 -DANDROID -Wa,--noexecstack -Wformat -Werror=format-security
  • Do not use: -fno-exceptions -fno-rtti


  • -MMD -MP -MF -ffunction-sections -funwind-tables -fstack-protector -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -DANDROID -Wa,--noexecstack -Wformat -Werror=format-security
  • Do not use: -fno-exceptions -fno-rtti


  • -MMD -MP -MF -ffunction-sections -funwind-tables -fstack-protector-strong -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -DANDROID -Wa,--noexecstack -Wformat -Werror=format-security
  • Do not use: -fno-exceptions -fno-rtti


The following was taken from the Google Samples GitHub. They are being cut-in for

android$ git clone
android$ cd android-ndk
android$ git checkout android-mk
android$ cd hello-jni

android:hello-jni$ ndk-build APP_PLATFORM=android-20 V=1 
Android NDK: WARNING: APP_PLATFORM android-19 is higher than android:minSdkVersion 3 in ./AndroidManifest.xml. NDK binaries will *not* be comptible with devices older than android-19. See for more information.    
/opt/android-ndk-r16b/build/core/ Android NDK: Application targets deprecated ABI(s): mips64 armeabi mips    
/opt/android-ndk-r16b/build/core/ Android NDK: Support for these ABIs will be removed in a future NDK release.    
rm -f ./libs/arm64-v8a/* ./libs/armeabi/* ./libs/armeabi-v7a/* ./libs/mips/* ./libs/mips64/* ./libs/x86/* ./libs/x86_64/*
rm -f ./libs/arm64-v8a/gdbserver ./libs/armeabi/gdbserver ./libs/armeabi-v7a/gdbserver ./libs/mips/gdbserver ./libs/mips64/gdbserver ./libs/x86/gdbserver ./libs/x86_64/gdbserver
rm -f ./libs/arm64-v8a/gdb.setup ./libs/armeabi/gdb.setup ./libs/armeabi-v7a/gdb.setup ./libs/mips/gdb.setup ./libs/mips64/gdb.setup ./libs/x86/gdb.setup ./libs/x86_64/gdb.setup
[arm64-v8a] Gdbserver      : [aarch64-linux-android] libs/arm64-v8a/gdbserver
install -p /opt/android-ndk-r16b/prebuilt/android-arm64/gdbserver/gdbserver ./libs/arm64-v8a/gdbserver
[arm64-v8a] Gdbsetup       : libs/arm64-v8a/gdb.setup
echo "set solib-search-path ./obj/local/arm64-v8a" > ./libs/arm64-v8a/gdb.setup
echo "directory /opt/android-ndk-r16b/sysroot jni /opt/android-ndk-r16b/sources/cxx-stl/system" >> ./libs/arm64-v8a/gdb.setup
[mips64] Gdbserver      : [mips64el-linux-android] libs/mips64/gdbserver
install -p /opt/android-ndk-r16b/prebuilt/android-mips64/gdbserver/gdbserver ./libs/mips64/gdbserver
[mips64] Gdbsetup       : libs/mips64/gdb.setup
echo "set solib-search-path ./obj/local/mips64" > ./libs/mips64/gdb.setup
echo "directory /opt/android-ndk-r16b/sysroot jni /opt/android-ndk-r16b/sources/cxx-stl/system" >> ./libs/mips64/gdb.setup
[x86_64] Gdbserver      : [x86_64-linux-android] libs/x86_64/gdbserver
install -p /opt/android-ndk-r16b/prebuilt/android-x86_64/gdbserver/gdbserver ./libs/x86_64/gdbserver
[x86_64] Gdbsetup       : libs/x86_64/gdb.setup
echo "set solib-search-path ./obj/local/x86_64" > ./libs/x86_64/gdb.setup
echo "directory /opt/android-ndk-r16b/sysroot jni /opt/android-ndk-r16b/sources/cxx-stl/system" >> ./libs/x86_64/gdb.setup
[armeabi] Gdbserver      : [arm-linux-androideabi] libs/armeabi/gdbserver
install -p /opt/android-ndk-r16b/prebuilt/android-arm/gdbserver/gdbserver ./libs/armeabi/gdbserver
[armeabi] Gdbsetup       : libs/armeabi/gdb.setup
echo "set solib-search-path ./obj/local/armeabi" > ./libs/armeabi/gdb.setup
echo "directory /opt/android-ndk-r16b/sysroot jni /opt/android-ndk-r16b/sources/cxx-stl/system" >> ./libs/armeabi/gdb.setup
[armeabi-v7a] Gdbserver      : [arm-linux-androideabi] libs/armeabi-v7a/gdbserver
install -p /opt/android-ndk-r16b/prebuilt/android-arm/gdbserver/gdbserver ./libs/armeabi-v7a/gdbserver
[armeabi-v7a] Gdbsetup       : libs/armeabi-v7a/gdb.setup
echo "set solib-search-path ./obj/local/armeabi-v7a" > ./libs/armeabi-v7a/gdb.setup
echo "directory /opt/android-ndk-r16b/sysroot jni /opt/android-ndk-r16b/sources/cxx-stl/system" >> ./libs/armeabi-v7a/gdb.setup
[mips] Gdbserver      : [mips64el-linux-android] libs/mips/gdbserver
install -p /opt/android-ndk-r16b/prebuilt/android-mips/gdbserver/gdbserver ./libs/mips/gdbserver
[mips] Gdbsetup       : libs/mips/gdb.setup
echo "set solib-search-path ./obj/local/mips" > ./libs/mips/gdb.setup
echo "directory /opt/android-ndk-r16b/sysroot jni /opt/android-ndk-r16b/sources/cxx-stl/system" >> ./libs/mips/gdb.setup
[x86] Gdbserver      : [i686-linux-android] libs/x86/gdbserver
install -p /opt/android-ndk-r16b/prebuilt/android-x86/gdbserver/gdbserver ./libs/x86/gdbserver
[x86] Gdbsetup       : libs/x86/gdb.setup
echo "set solib-search-path ./obj/local/x86" > ./libs/x86/gdb.setup
echo "directory /opt/android-ndk-r16b/sysroot jni /opt/android-ndk-r16b/sources/cxx-stl/system" >> ./libs/x86/gdb.setup
[arm64-v8a] Compile        : hello-jni <= hello-jni.c
/opt/android-ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -MMD -MP -MF ./obj/local/arm64-v8a/objs-debug/hello-jni/hello-jni.o.d -gcc-toolchain /opt/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -target aarch64-none-linux-android -ffunction-sections -funwind-tables -fstack-protector-strong -fpic -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes  -g -O0 -UNDEBUG -fno-limit-debug-info  -Ijni   -DANDROID  -D__ANDROID_API__=21 -Wa,--noexecstack -Wformat -Werror=format-security  --sysroot /opt/android-ndk-r16b/sysroot -isystem /opt/android-ndk-r16b/sysroot/usr/include/aarch64-linux-android -c  jni/hello-jni.c -o ./obj/local/arm64-v8a/objs-debug/hello-jni/hello-jni.o
[arm64-v8a] SharedLibrary  :
/opt/android-ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -Wl,-soname, -shared --sysroot=/opt/android-ndk-r16b/platforms/android-21/arch-arm64 ./obj/local/arm64-v8a/objs-debug/hello-jni/hello-jni.o -latomic -Wl,--exclude-libs,libatomic.a  -gcc-toolchain /opt/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -target aarch64-none-linux-android -no-canonical-prefixes   -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings   -lc -lm -o ./obj/local/arm64-v8a/
[arm64-v8a] Install        : => libs/arm64-v8a/
install -p ./obj/local/arm64-v8a/ ./libs/arm64-v8a/
/opt/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip --strip-unneeded  ./libs/arm64-v8a/
[mips64] Compile        : hello-jni <= hello-jni.c
/opt/android-ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -MMD -MP -MF ./obj/local/mips64/objs-debug/hello-jni/hello-jni.o.d -gcc-toolchain /opt/android-ndk-r16b/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64 -target mips64el-none-linux-android -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fmessage-length=0 -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes  -fintegrated-as -g -O0 -UNDEBUG -fno-limit-debug-info  -Ijni   -DANDROID  -D__ANDROID_API__=21 -Wa,--noexecstack -Wformat -Werror=format-security  --sysroot /opt/android-ndk-r16b/sysroot -isystem /opt/android-ndk-r16b/sysroot/usr/include/mips64el-linux-android -c  jni/hello-jni.c -o ./obj/local/mips64/objs-debug/hello-jni/hello-jni.o
[mips64] SharedLibrary  :
/opt/android-ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -Wl,-soname, -shared --sysroot=/opt/android-ndk-r16b/platforms/android-21/arch-mips64 ./obj/local/mips64/objs-debug/hello-jni/hello-jni.o -latomic -Wl,--exclude-libs,libatomic.a  -gcc-toolchain /opt/android-ndk-r16b/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64 -target mips64el-none-linux-android -no-canonical-prefixes   -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings   -lc -lm -o ./obj/local/mips64/
[mips64] Install        : => libs/mips64/
install -p ./obj/local/mips64/ ./libs/mips64/
/opt/android-ndk-r16b/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/bin/mips64el-linux-android-strip --strip-unneeded  ./libs/mips64/
[x86_64] Compile        : hello-jni <= hello-jni.c
/opt/android-ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -MMD -MP -MF ./obj/local/x86_64/objs-debug/hello-jni/hello-jni.o.d -gcc-toolchain /opt/android-ndk-r16b/toolchains/x86_64-4.9/prebuilt/linux-x86_64 -target x86_64-none-linux-android -ffunction-sections -funwind-tables -fstack-protector-strong -fPIC -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes  -g -O0 -UNDEBUG -fno-limit-debug-info  -Ijni   -DANDROID  -D__ANDROID_API__=21 -Wa,--noexecstack -Wformat -Werror=format-security  --sysroot /opt/android-ndk-r16b/sysroot -isystem /opt/android-ndk-r16b/sysroot/usr/include/x86_64-linux-android -c  jni/hello-jni.c -o ./obj/local/x86_64/objs-debug/hello-jni/hello-jni.o
[x86_64] SharedLibrary  :
/opt/android-ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -Wl,-soname, -shared --sysroot=/opt/android-ndk-r16b/platforms/android-21/arch-x86_64 ./obj/local/x86_64/objs-debug/hello-jni/hello-jni.o -latomic -Wl,--exclude-libs,libatomic.a  -gcc-toolchain /opt/android-ndk-r16b/toolchains/x86_64-4.9/prebuilt/linux-x86_64 -target x86_64-none-linux-android -no-canonical-prefixes   -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings   -lc -lm -o ./obj/local/x86_64/
[x86_64] Install        : => libs/x86_64/
install -p ./obj/local/x86_64/ ./libs/x86_64/
/opt/android-ndk-r16b/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/x86_64-linux-android-strip --strip-unneeded  ./libs/x86_64/
[armeabi] Compile thumb  : hello-jni <= hello-jni.c
/opt/android-ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -MMD -MP -MF ./obj/local/armeabi/objs-debug/hello-jni/hello-jni.o.d -gcc-toolchain /opt/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes -fno-integrated-as -g -target armv5te-none-linux-androideabi19 -march=armv5te -mtune=xscale -msoft-float -mthumb -O0 -UNDEBUG -fno-limit-debug-info  -Ijni   -DANDROID  -D__ANDROID_API__=19 -Wa,--noexecstack -Wformat -Werror=format-security  --sysroot /opt/android-ndk-r16b/sysroot -isystem /opt/android-ndk-r16b/sysroot/usr/include/arm-linux-androideabi -c  jni/hello-jni.c -o ./obj/local/armeabi/objs-debug/hello-jni/hello-jni.o
[armeabi] SharedLibrary  :
/opt/android-ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -Wl,-soname, -shared --sysroot=/opt/android-ndk-r16b/platforms/android-19/arch-arm ./obj/local/armeabi/objs-debug/hello-jni/hello-jni.o -latomic -Wl,--exclude-libs,libatomic.a  -gcc-toolchain /opt/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -no-canonical-prefixes -target armv5te-none-linux-androideabi19  -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings    -lc -lm -o ./obj/local/armeabi/
[armeabi] Install        : => libs/armeabi/
install -p ./obj/local/armeabi/ ./libs/armeabi/
/opt/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip --strip-unneeded  ./libs/armeabi/
[armeabi-v7a] Compile thumb  : hello-jni <= hello-jni.c
/opt/android-ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -MMD -MP -MF ./obj/local/armeabi-v7a/objs-debug/hello-jni/hello-jni.o.d -gcc-toolchain /opt/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes -fno-integrated-as -g -target armv7-none-linux-androideabi19 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -O0 -UNDEBUG -fno-limit-debug-info  -Ijni   -DANDROID  -D__ANDROID_API__=19 -Wa,--noexecstack -Wformat -Werror=format-security  --sysroot /opt/android-ndk-r16b/sysroot -isystem /opt/android-ndk-r16b/sysroot/usr/include/arm-linux-androideabi -c  jni/hello-jni.c -o ./obj/local/armeabi-v7a/objs-debug/hello-jni/hello-jni.o
[armeabi-v7a] SharedLibrary  :
/opt/android-ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -Wl,-soname, -shared --sysroot=/opt/android-ndk-r16b/platforms/android-19/arch-arm ./obj/local/armeabi-v7a/objs-debug/hello-jni/hello-jni.o -latomic -Wl,--exclude-libs,libatomic.a  -gcc-toolchain /opt/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -no-canonical-prefixes -target armv7-none-linux-androideabi19 -Wl,--fix-cortex-a8  -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings    -lc -lm -o ./obj/local/armeabi-v7a/
[armeabi-v7a] Install        : => libs/armeabi-v7a/
install -p ./obj/local/armeabi-v7a/ ./libs/armeabi-v7a/
/opt/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip --strip-unneeded  ./libs/armeabi-v7a/
[mips] Compile        : hello-jni <= hello-jni.c
/opt/android-ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -MMD -MP -MF ./obj/local/mips/objs-debug/hello-jni/hello-jni.o.d -gcc-toolchain /opt/android-ndk-r16b/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64 -target mipsel-none-linux-android -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fmessage-length=0 -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes  -g -mips32 -O0 -UNDEBUG -fno-limit-debug-info  -Ijni   -DANDROID  -D__ANDROID_API__=19 -Wa,--noexecstack -Wformat -Werror=format-security  --sysroot /opt/android-ndk-r16b/sysroot -isystem /opt/android-ndk-r16b/sysroot/usr/include/mipsel-linux-android -c  jni/hello-jni.c -o ./obj/local/mips/objs-debug/hello-jni/hello-jni.o
[mips] SharedLibrary  :
/opt/android-ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -Wl,-soname, -shared --sysroot=/opt/android-ndk-r16b/platforms/android-19/arch-mips ./obj/local/mips/objs-debug/hello-jni/hello-jni.o -latomic -Wl,--exclude-libs,libatomic.a  -gcc-toolchain /opt/android-ndk-r16b/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64 -L/opt/android-ndk-r16b/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/mips64el-linux-android/4.9.x/32/mips-r1 -target mipsel-none-linux-android -no-canonical-prefixes  -mips32  -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings   -lc -lm -o ./obj/local/mips/
[mips] Install        : => libs/mips/
install -p ./obj/local/mips/ ./libs/mips/
/opt/android-ndk-r16b/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/bin/mips64el-linux-android-strip --strip-unneeded  ./libs/mips/
[x86] Compile        : hello-jni <= hello-jni.c
/opt/android-ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -MMD -MP -MF ./obj/local/x86/objs-debug/hello-jni/hello-jni.o.d -gcc-toolchain /opt/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64 -target i686-none-linux-android -ffunction-sections -funwind-tables -fstack-protector-strong -fPIC -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes -g -O0 -UNDEBUG -fno-limit-debug-info  -Ijni   -DANDROID  -D__ANDROID_API__=19 -Wa,--noexecstack -Wformat -Werror=format-security -mstackrealign  --sysroot /opt/android-ndk-r16b/sysroot -isystem /opt/android-ndk-r16b/sysroot/usr/include/i686-linux-android -c  jni/hello-jni.c -o ./obj/local/x86/objs-debug/hello-jni/hello-jni.o
[x86] SharedLibrary  :
/opt/android-ndk-r16b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -Wl,-soname, -shared --sysroot=/opt/android-ndk-r16b/platforms/android-19/arch-x86 ./obj/local/x86/objs-debug/hello-jni/hello-jni.o -latomic -Wl,--exclude-libs,libatomic.a  -gcc-toolchain /opt/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64 -target i686-none-linux-android -no-canonical-prefixes  -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings   -lc -lm -o ./obj/local/x86/
[x86] Install        : => libs/x86/
install -p ./obj/local/x86/ ./libs/x86/
/opt/android-ndk-r16b/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-strip --strip-unneeded  ./libs/x86/


None. The files are present in GitHub.