I found this file a useful reference for arm cross-compilation:
https://github.com/grpc/grpc/blob/master/test/distrib/cpp/run_distrib_test_raspberry_pi.sh

I think you are running into this problem because first you need to
build/install gRPC for the host architecture, to be able to run protoc and
grpc_cpp_plugin. At least that's what the comment says:

...
# Build and install gRPC for the host architecture.
# We do this because we need to be able to run protoc and grpc_cpp_plugin
# while cross-compiling.
...

Gustavo

On Sun, 7 Jun 2020 at 08:42, <[email protected]> wrote:

>
> 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 <http://SimulatorServices.pb.cc> and *
> *SimulatorServices.pb.h*
>
> --
> You received this message because you are subscribed to the Google Groups "
> grpc.io" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/grpc-io/463b512e-87db-4b04-bb6d-d885838e9d6fo%40googlegroups.com
> <https://groups.google.com/d/msgid/grpc-io/463b512e-87db-4b04-bb6d-d885838e9d6fo%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CAPaU2Hg2OrP9Ev4qCpSUwNiyypcx634XynGWLJme8xEVXTWsLA%40mail.gmail.com.

Reply via email to