jni/jrtplib/include/jrtplib3/rtpsessionsources.h:50: error: non-static reference member 'jrtplib::RTPSession& jrtplib::RTPSessionSources::rtpsession', can't use default assignment operator
link to rtpsessionsource.h
http://research.edm.uhasselt.be/jori/jrtplib/documentation/rtpsessionsources_8h_source.html
anyone, please help me.
All depends on how you wanna to build jrtplib
I see 3 options here
use existing build script from https://github.com/jimjh/JRTPLib-for-Android
because jrtplib based on cmake build system, you can use https://github.com/taka-no-me/android-cmake
write own Android.mk
Personally I used second option and my build script looks like this
#!/bin/bash
LIB=jrtplib-3.9.1
BUILD=$(PWD)/build
CMAKE_TOOLCHAIN=$(PWD)/android-cmake
BUILD_TYPE=Debug
mkdir -p $BUILD/armeabi-v7a
cd $BUILD/armeabi-v7a
cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN/android.toolchain.cmake \
-DANDROID_NDK=$ANDROID_NDK_ROOT -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DANDROID_ABI="armeabi-v7a with NEON" \
-DJRTPLIB_COMPILE_STATIC=ON \
$LIB
cmake --build .
cd $ROOT
mkdir -p build/x86
cd $BUILD/x86
cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN/android.toolchain.cmake \
-DANDROID_NDK=$ANDROID_NDK_ROOT -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DANDROID_ABI="x86" \
-DJRTPLIB_COMPILE_STATIC=ON \
$LIB
cmake --build .
PS I have build without jthread support
Related
I am trying to build an Android Studio project inside docker using gradle.
Gradle goes through a long process of downloading my dependencies. I would like to cache this step inside docker, so that it is not repeated every time I build.
I am unhappy with the underlying snippet from my Dockerfile (full file below). It requires that I copy my resource directory. Everytime I change a string or a resource, all of my dependencies will be downloaded again! (Because docker cache will be invalidated)
COPY my-android-project/app/src/main/res app/src/main/res
This line will trigger alot of redundant dependency downloads by docker. How can I remove it from my dockerfile? I would appreciate a Dockerfile example with even a trivial "empty activity" Android Studio project...
# https://medium.com/#AndreSand/building-android-with-docker-8dbf717f54d4
FROM gradle:5.4.1-jdk8
USER root
ENV SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip" \
ANDROID_HOME="/usr/local/android-sdk" \
ANDROID_VERSION=29 \
ANDROID_BUILD_TOOLS_VERSION=29.0.2
# Download Android SDK
RUN mkdir "$ANDROID_HOME" .android \
&& cd "$ANDROID_HOME" \
&& curl -o sdk.zip $SDK_URL \
&& unzip sdk.zip \
&& rm sdk.zip \
&& mkdir "$ANDROID_HOME/licenses" || true \
&& echo "24333f8a63b6825ea9c5514f83c2829b004d1fee" > "$ANDROID_HOME/licenses/android-sdk-license"
# && yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses
# Install Android Build Tool and Libraries
RUN $ANDROID_HOME/tools/bin/sdkmanager --update
RUN $ANDROID_HOME/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" \
"platforms;android-${ANDROID_VERSION}" \
"platform-tools"
# Install Build Essentials
RUN apt-get update && apt-get install build-essential -y && apt-get install file -y && apt-get install apt-utils -y
RUN mkdir my-android-project
WORKDIR my-android-project
# Fix gradle cache directory to work outside of profile (required for docker)
RUN mkdir -p /opt/gradle/.gradle
ENV GRADLE_USER_HOME=/opt/gradle/.gradle
# Cache dependencies so that they are not downloaded every time the code changes
COPY my-android-project/gradle* ./
COPY my-android-project/build.gradle .
COPY my-android-project/settings.gradle .
COPY my-android-project/gradle/ ./gradle/
COPY my-android-project/gradle/ ./gradle/
COPY my-android-project/app/build.gradle app/build.gradle
COPY my-android-project/app/src/main/AndroidManifest.xml app/src/main/AndroidManifest.xml
#
####
# I am unhappy with this, as the dependencies will be downloaded again
# If I change any strings, icons, or IDs inside this folder
# How do I prevent having to copy this folder?
###
#
COPY my-android-project/app/src/main/res app/src/main/res
RUN find
# Running gradle instead of gradlew to prevent redundant update of gradle version
# to save time: if you need another version of gradle, please install it in the docker image prioir to running this line
RUN gradle --no-daemon build
# Build the actual files
COPY my-android-project .
# Running gradle instead of gradlew to prevent redundant update of gradle version
# to save time: if you need another version of gradle, please install it in the docker image prioir to running this line
# --offline to make sure no further dependenies are being downloaded
RUN gradle --no-daemon --offline build
I've created a docker container in order to run my gradle tasks on it.
I'm downloading the sdk inside it, but when I run a task from outside it says that the sdk folder can not be found because it's getting the path I have in the local.properties file of the project. Which is pointing to my machine sdk folder. How can I specify the sdk folder inside the docker image? Thanks.
Docker image build file:
FROM openjdk:8
ENV SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip" \
ANDROID_HOME="/usr/local/android-sdk" \
ANDROID_NDK_HOME="/usr/local/android-sdk/ndk-bundle" \
ANDROID_VERSION=26 \
ANDROID_BUILD_TOOLS_VERSION=26.0.2
# Download Android SDK
RUN mkdir "$ANDROID_HOME" .android \
&& cd "$ANDROID_HOME" \
&& curl -o sdk.zip $SDK_URL \
&& unzip sdk.zip \
&& rm sdk.zip \
&& yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses
# add to PATH
ENV PATH ${PATH}:${ANDROID_HOME}
ENV ANDROID_NDK_HOME /usr/local/android-ndk
ENV ANDROID_NDK_VERSION r19
ENV NDK_URL="https://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip"
# Download Android NDK
RUN mkdir "$ANDROID_NDK_HOME" \
&& cd "$ANDROID_NDK_HOME" \
&& curl -o ndk.zip $NDK_URL \
&& unzip ndk.zip \
&& rm ndk.zip
# add to PATH
ENV PATH ${PATH}:${ANDROID_NDK_HOME}
# Install Android Build Tool and Libraries
RUN $ANDROID_HOME/tools/bin/sdkmanager --update
RUN $ANDROID_HOME/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" \
"platforms;android-${ANDROID_VERSION}" \
"platform-tools"
RUN mkdir /application
WORKDIR /application
This is how I run the task:
docker run -it --rm -v "$PWD":/application packsdkandroiddocker.image sh -c "$#" ./gradlew clean
And this is the error I get:
NDK is missing a "platforms" directory. If you are using NDK, verify
the ndk.dir is set to a valid NDK directory. It is currently set to
/Users/adalpari/Library/Android/sdk/ndk-bundle. If you are not using
NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties
to remove this warning.
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring project ':app'.
The SDK directory '/Users/adalpari/Library/Android/sdk' does not exist.
I think you need to remove local.properties file from your root folder as SDK is then searched locally which container cannot access.
I am trying for over one week to compile OpenCV 3.1.0 for Android with NDK r18 on Ubuntu 18.04.
I have used the following command:
cmake -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DANDROID_NDK="/home/qamaruddin/Downloads/android-ndk-r18-linux-x86_64/android-ndk-r18/" \
-DCMAKE_TOOLCHAIN_FILE="/home/qamaruddin/Downloads/android-ndk-r18-linux-x86_64/android-ndk-r18/build/cmake/android.toolchain.cmake" \
-DANDROID_NATIVE_API_LEVEL=19 \
-DANDROID_ABI="armeabi-v7a" \
-DWITH_CUDA=OFF \
-DWITH_MATLAB=OFF \
-DBUILD_ANDROID_EXAMPLES=OFF \
-DBUILD_DOCS=OFF \
-DBUILD_PERF_TESTS=OFF \
-DBUILD_TESTS=OFF \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DOPENCV_EXTRA_MODULES_PATH="/opt/opencv_contrib/modules/" \
-DCMAKE_INSTALL_PREFIX:PATH="/home/mig-ocv/ocv-android-310/" \
-DEXECUTABLE_OUTPUT_PATH:PATH="/home/mig-ocv/ocv-android-310/" \
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH="/home/mig-ocv/ocv-android-310/" \
-DCMAKE_BUILD_TYPE=Release \
/opt/opencv
Follwed by make & make install/strip.
I have tried different versions of OpenCV 3 such as 3.1.0, 3.4.3, and 3.4.0. I have also tried NDKr15c, NDKr17c, and NDKr18c.
I have tried the following variations:
Change NDK version
Change OpenCV 3 version
Install using python script located at opencv/platforms/androind/setup.py
Build using CMAKE
Use Ninja for CMAKE, but this gives the error: "ninja: error: loading 'build/build.global.ninja': No such file or directory"
Install without Ninja with CMAKE
At the moment, using the above-posted command for CMAKE builds successfully, but I can't change the target install dir since it always builds into /usr/local/ and when I inspect the target directory it does not have the familiar OpenCV for Android structure which is:
1- etc
2- java
3- native --> jni --> include
I wonder what is wrong in my process that makes it so difficult to build OpenCV 3 from source for Android with OpenCV Contrib.
Note that $ANDROID_HOME is set to the android SDKs directory on my system and $ANDROID_NDK is also set.
I have seen all duplicate questions on StackOverflow and other forums, but none seems to work in my case.
When I try to build with Ninja with this command:
cmake -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DANDROID_NDK="$HOME/Downloads/android-ndk-r17b/" \
-DCMAKE_TOOLCHAIN_FILE="$HOME/Downloads/android-ndk-r17b/build/cmake/android.toolchain.cmake" \
-DANDROID_NATIVE_API_LEVEL=21 \
-DANDROID_ABI="armeabi-v7a" \
-DWITH_CUDA=OFF \
-DWITH_MATLAB=OFF \
-DBUILD_ANDROID_EXAMPLES=OFF \
-DBUILD_DOCS=OFF \
-DBUILD_PERF_TESTS=OFF \
-DBUILD_TESTS=OFF \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DOPENCV_EXTRA_MODULES_PATH="$HOME/ocv/opencv_contrib/modules/" \
-DCMAKE_INSTALL_PREFIX:PATH="$HOME/agusta/ocv-android-310/" \
-DEXECUTABLE_OUTPUT_PATH:PATH="$HOME/agusta/ocv-android-310/" \
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH="$HOME/agusta/ocv-android-310/" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_MAKE_PROGRAM=/usr/bin/ninja \
$HOME/ocv/opencv
I get:
CMake Deprecation Warning at CMakeLists.txt:72 (cmake_policy):
The OLD behavior for policy CMP0022 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
CMake Deprecation Warning at CMakeLists.txt:77 (cmake_policy):
The OLD behavior for policy CMP0026 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
CMake Deprecation Warning at CMakeLists.txt:82 (cmake_policy):
The OLD behavior for policy CMP0042 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
-- Check for working CXX compiler: /home/qamaruddin/Downloads/android-ndk-r17b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
CMake Error: Generator: execution of make failed. Make command was: "/usr/bin/ninja" "cmTC_c4cee/fast"
-- Check for working CXX compiler: /home/qamaruddin/Downloads/android-ndk-r17b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -- broken
CMake Error at /usr/local/share/cmake-3.12/Modules/CMakeTestCXXCompiler.cmake:45 (message):
The C++ compiler
"/home/qamaruddin/Downloads/android-ndk-r17b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/qamaruddin/agusta/temp/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_c4cee/fast"
No such file or directory
Generator: execution of make failed. Make command was: "/usr/bin/ninja" "cmTC_c4cee/fast"
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:93 (project)
-- Configuring incomplete, errors occurred!
See also "/home/qamaruddin/agusta/temp/CMakeFiles/CMakeOutput.log".
See also "/home/qamaruddin/agusta/temp/CMakeFiles/CMakeError.log".
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_CXX_COMPILER= /usr/bin/clang++
CMAKE_C_COMPILER= /usr/bin/clang
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
BUILD_ANDROID_EXAMPLES
BUILD_DOCS
BUILD_PERF_TESTS
BUILD_TESTS
EXECUTABLE_OUTPUT_PATH
OPENCV_EXTRA_MODULES_PATH
WITH_CUDA
WITH_MATLAB
-- Build files have been written to: /home/qamaruddin/agusta/temp
I have managed to get it to work, basically, OCV didn't support NDKr18, and I also had to install ninja from source. I have also used python3 instead of python2 to run the opencv/platforms/android/build_sdk.py . One more thing is that I use Eclipse Android ADT which Google has for no reason deprecated ;(, but I find it super fast compared to the heavy Android Studio.
# export ANDROID_ABI=armeabi-v7a
# export ANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.8
# export ANDROID_NDK=$HOME/Downloads/android-ndk-r17c-linux-x86_64/android-ndk-r17c/
# export ANDROID_SDK=$HOME/android-sdks/
./../opencv/platforms/android/build_sdk.py --extra_modules_path=/opt/opencv_contrib/modules --config ../opencv/platforms/android/ndk-17.config.py
I am trying to compile tensorflow-lite for Android running the building script, but the building process stops with this error:
/system/bin/linker: No such file or directory
I can understand how the building process works (compilation + linking) but I can not figure out why this '/system/bin/linker' is needed. This linker is not present in the SDK or NDK folder, and it is not present in the folder tree of the host computer (I am using Linux for the building process).
It looks like part of the Android file structure, but the building process should not depend on the final system structure.
The element I am trying to build is 'schema_fbs', which compiles part of the code using flatbuffers (a 3rd party dependency). The complete sentence I am using is:
bazel build \
--cxxopt='--std=c++11' \
--crosstool_top=//external:android/crosstool \
--host_crosstool_top=#bazel_tools//tools/cpp:toolchain \
--cpu=armeabi-v7a \
--verbose_failures \
--subcommands \
//tensorflow/contrib/lite/schema:schema_fbs
It could be caused by a testing case inside the Bazel building script (I have commented all the tests I found), but why is the linker needed? Is there something I have to do to define this 'system' folder in the compilation process?
Notes:
Target OS: Android
Host OS: Ubuntu 16.04
Used NDK: v16b (tested with v17 but it is not compatible)
Full error messages:
INFO: Analysed target //tensorflow/contrib/lite/schema:schema_fbs_srcs (0 packages loaded).
INFO: Found 1 target...
SUBCOMMAND: # //tensorflow/contrib/lite/schema:schema_fbs_srcs [action 'Generating flatbuffer files for schema_fbs_srcs: //tensorflow/contrib/lite/schema:schema_fbs_srcs']
(cd /home/user/.cache/bazel/_bazel_user/73606864f5ec4cce18dd83a6cbcd2bc2/execroot/org_tensorflow && \
exec env - \
LD_LIBRARY_PATH=/usr/local/lib:/home/user/Libraries/llvm-4.0.0.src/build/lib: \
PATH=/home/user/Software/git-sizer:/home/user/Android/Sdk/platform-tools:/home/user/anaconda3/bin:/home/user/Libraries/llvm-4.0.0.src/build/bin:/home/user/bin:/home/user/repo/caffe/build/install/lib:/home/user/Software/cmake-3.10.3-Linux-x86_64/bin:::::/home/user/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \
/bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; for f in tensorflow/contrib/lite/schema/schema.fbs; do bazel-out/armeabi-v7a-opt/bin/external/flatbuffers/flatc --no-union-value-namespacing --gen-object-api -c -o bazel-out/armeabi-v7a-opt/genfiles/tensorflow/contrib/lite/schema $f; done')
ERROR: /home/user/Repositories/git/tensorflow/tensorflow/contrib/lite/schema/BUILD:57:1: Generating flatbuffer files for schema_fbs_srcs: //tensorflow/contrib/lite/schema:schema_fbs_srcs failed (Exit 255): bash failed: error executing command
(cd /home/user/.cache/bazel/_bazel_user/73606864f5ec4cce18dd83a6cbcd2bc2/execroot/org_tensorflow && \
exec env - \
LD_LIBRARY_PATH=/usr/local/lib:/home/user/Libraries/llvm-4.0.0.src/build/lib: \
PATH=/home/user/Software/git-sizer:/home/user/Android/Sdk/platform-tools:/home/user/anaconda3/bin:/home/user/Libraries/llvm-4.0.0.src/build/bin:/home/user/bin:/home/user/repo/caffe/build/install/lib:/home/user/Software/cmake-3.10.3-Linux-x86_64/bin:::::/home/user/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \
/bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; for f in tensorflow/contrib/lite/schema/schema.fbs; do bazel-out/armeabi-v7a-opt/bin/external/flatbuffers/flatc --no-union-value-namespacing --gen-object-api -c -o bazel-out/armeabi-v7a-opt/genfiles/tensorflow/contrib/lite/schema $f; done')
/system/bin/linker: No such file or directory
Target //tensorflow/contrib/lite/schema:schema_fbs_srcs failed to build
INFO: Elapsed time: 0.572s, Critical Path: 0.02s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
The TensorFlow Lite AAR can also be built using:
bazel build --cxxopt='--std=c++11' -c opt --fat_apk_cpu=x86,x86_64,arm64-v8a,armeabi-v7a tensorflow/contrib/lite/java:tensorflow-lite
And you must make sure you ran ./configure and let it configure SDK and NDK for your.
I'm stuck trying to cross-compile libevent to Android and I'd like to know what I'm doing wrong and get some assistance.
The version I'm trying to build is libevent-2.0.19-stable
I started following the steps described at http://warpedtimes.wordpress.com/2010/02/03/building-open-source-libraries-with-android-ndk/ and how to rewrite the Makefile into android.mk?
The Target Device is a Samsung Galaxy S2 running cyanogenMod 7
After several attempts, the best I did was by running the following steps:
1) Install android NDK and download libevent source code
2) Android NDK downloaded and running in ~/android-ndk/android-ndk-r8b
3) Execute:
export ANDROID_ROOT=~/android-ndk/android-ndk-r8b
export PATH=$PATH:$ANDROID_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/
You need to export the ABI for your device. armeabi-v7a is for devices with ARMv7 or above, any other device uses armeabi.
4) Execute ./configure with the appropriate parameters:
./configure \
--host=arm-linux-androideabi \
CC=arm-linux-androideabi-gcc \
LD=arm-linux-androideabi-ld \
CPPFLAGS="-I$ANDROID_ROOT/platforms/android-8/arch-arm/usr/include/" \
CFLAGS="-nostdlib" \
LDFLAGS="-Wl,-rpath-link=$ANDROID_ROOT/platforms/android-8/arch-arm/usr/lib/ -L$ANDROID_ROOT/platforms/android-8/arch-arm/usr/lib/" \
LIBS="-lc"
There was a warning in the meantime:
configure: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used
(I assume it's fine)
As it didn't recognise arm-linux-androideabi as a host, I got a new config.guess and config.sub from http://git.savannah.gnu.org/gitweb/?p=config.git;a=tree (indicated in the previous thread in Stack Overflow)
At this point, when building the source code running "make", it still crashes:
/home/narseo/android-ndk/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: crtbegin_so.o: No such file: No such file or directory
collect2: ld returned 1 exit status
make[2]: *** [libevent.la] Error 1
make[2]: se sale del directorio «/home/narseo/libevent-source/libevent-2.0.19-stable»
make[1]: *** [all-recursive] Error 1
make[1]: se sale del directorio «/home/narseo/libevent-source/libevent-2.0.19-stable»
make: *** [all] Error 2
However, the file seems to be there:
~/android-ndk$ ls $ANDROID_ROOT/platforms/android-8/arch-arm/usr/lib
crtbegin_dynamic.o libc.a libjnigraphics.so libstdc++.so
crtbegin_so.o libc.so liblog.so libthread_db.so
crtbegin_static.o libdl.so libm.a libz.so
crtend_android.o libGLESv1_CM.so libm.so
crtend_so.o libGLESv2.so libstdc++.a
Is there anything I'm doing wrong when running ./configure? Something else I didn't understand even looking at Android's NDK documentation was whether it was mandatory to create an Android.mk or if Makefile was sufficient
Any help will be very welcome!
Cheers
N
Note
This is how I managed to solve it in the end:
Initial PATH:
export ANDROID_ROOT=~/android-ndk/android-ndk-r8b
export PATH=$PATH:$ANDROID_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/
export PATH=$PATH:$ANDROID_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/include/
The errors seem to occur in the linking phase so as it cannot find crtend_so.o and crtbegin_so.o. Following crtbegin_so.o missing for android toolchain (custom build), we add a sym link to them in the source folder
cd source && ln -s $ANDROID_ROOT/platforms/android-8/arch-arm/usr/lib/crtbegin_so.o
ln -s $ANDROID_ROOT/platforms/android-8/arch-arm/usr/lib/crtend_so.o
The ./configure command:
./configure \
--host=arm-linux-androideabi \
CC=arm-linux-androideabi-gcc \
LD=arm-linux-androideabi-ld \
CPPFLAGS="-I$ANDROID_ROOT/platforms/android-8/arch-arm/usr/include/" \
CFLAGS="-nostdlib" \
LDFLAGS="-Wl,-rpath-link=$ANDROID_ROOT/platforms/android-8/arch-arm/usr/lib/ -L$ANDROID_ROOT/platforms/android-8/arch-arm/usr/lib/" \
LIBS="-lc"
If it fails as it does not recognize system androideabi, try to get newer versions of config.sub and config.guess
It used to crash in the linking phase. Including -lgcc on the CFLAGS solved the issue.
This project builds libevent as a static library on Android here: https://github.com/ventureresearch/libevent
It includes the Android.mk and generated config files to build it cleanly.
Note that we are building it for inclusion into an Android device image, and NOT building through the NDK. It would probably still be a good place to start.
Try this
./configure --host=arm-linux-androideabi CC="$NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc --sysroot=$SYSROOT" CFLAGS='-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
It works for me.
Try with below configurations:
ANDROID_SYSROOT=$ANDROID_ROOT/platforms/android-8/arch-arm/
./configure --host=arm-linux-androideabi CFLAGS=--sysroot=$ANDROID_SYSROOT LDFLAGS=--sysroot=$ANDROID_SYSROOT