Hi,
I need to cross compile grpc to be used in BeagleBone black for armv7l architecture.
I tried cross compilation but got an error.
Steps Followed,
1. Installed grpc for linux host system x86_64 architecture - This is successful.
2. Created Cmake Tool chain with the following details
cat > toolchain.cmake <<'EOT'
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_PROCESSOR armv7l)
set(CMAKE_STAGING_PREFIX /opt/grpc)
set(CMAKE_C_COMPILER /home/user/Tool_Chain/arm_cross_compile/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER /home/user/Tool_Chain/arm_cross_compile/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-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)
EOT
3. Gave the Cmake options to build grpc
mkdir -p "cmake/build_arm"
pushd "cmake/build_arm"
cmake -DCMAKE_TOOLCHAIN_FILE=/home/user/workspace/grpc/grpc_armv7l/toolchain.cmake \
-DgRPC_INSTALL=ON \
-DBUILD_SHARED_LIBS=ON \
-DgRPC_BUILD_CSHARP_EXT=OFF \
-DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF \
-DgRPC_BUILD_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX=/opt/grpc_armv7l \
../..
make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
4. It is building some files, when it reaches the systemd_utils.cc, it is throwing <systemd/sd-daemon.h> No such file or directory error.
5.Should this include be in the host machine or in the path of cross-compile tool chain includes path.
6. I am using tool chain from linaro. version - gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.
Need help in resolving the issue.