I'm trying to cross compile grpc C++ (https://github.com/grpc/grpc) for Android from Ubuntu using Android NDK CLANG compiler (arm-linux-androideabi-clang++).
I've tried below way to compile it for Android.
export PATH=/root/Android/arm-26-toolchain-clang/bin:$PATH
export SYSROOT=/root/Android/arm-26-toolchain-clang/sysroot
export CC="arm-linux-androideabi-clang --sysroot $SYSROOT"
export CXX="arm-linux-androideabi-clang++ --sysroot $SYSROOT"
make CFLAGS='-std=c11 -march=armv7-a -D__ANDROID_API__=26' CXXFLAGS='- std=c++11 -frtti -fexceptions -march=armv7-a -D__ANDROID_API__=26' LIBS='-llog -lz -lc++_static' -j2
It is throwing error while compiling zlib.c - error: implicit declaration of function 'lseek' is invalid in C99
How to specify to build using C11 using the above CLANG compiler?
When I allowed it to move ahead ignoring this error, it stopped at below -
./src/core/lib/surface/completion_queue.h:92:5: error: unknown type name
'grpc_experimental_completion_queue_functor'
grpc_experimental_completion_queue_functor* shutdown_callback);
I tried to compile the example from https://github.com/grpc/grpc/tree/master/examples/android/helloworld but it throws error in compiling boringssl.
Could you please help cross compiling gRPC for android for toolchain arm-linux-androideabi?
Thanks