I have installed grpc on my host machine and i have taken the source code of grpc and i cross compiled to arm64 architecture.
for the cross compilation i have used the cmake command as follows.
sudo cmake -DCMAKE_TOOLCHAIN_FILE=/home/acer/cross_compile_grpc/grpc_install/grpc/toolchain.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_PREFIX=/home/acer/cross_compile_grpc/grpc_install/grpc/grpc_install_2 \
../..
sudo make -j4 install
toolchain.cmake file contents are
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_PROCESSOR arm64)
#set(devel_root /tmp/raspberrypi_root)
#set(CMAKE_STAGING_PREFIX ${devel_root}/stage)
#set(tool_root ${devel_root}/raspberrypi-tools/arm-bcm2708)
#set(CMAKE_SYSROOT ${tool_root}/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot)
set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER /usr/bin/aarch64-linux-gnu-g++)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
after cross compiling i have a "grpc_cpp_plugin" which is cross compled and the proprties as follows.
grpc_cpp_plugin: ELF 64-bit LSB shared object, ARM aarch64,
version 1 (SYSV), dynamically linked, interpreter
/lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0,
BuildID[sha1]=48ee1bc844c70c0c3aa7691715bdf1236f84b46f, not stripped.
using the above grpc_cpp_plugin i am getting the error like grpc_cpp_plugin: program not found or is not executable
and also the cross compiler i have used is aarch64-linux-gnu-g++.
and
also if i compile in eclipse only two files that is getting generated( i
should get total four files including grpc services) and the files are
as follows.
SimulatorServices.pb.cc and SimulatorServices.pb.h