Issue in cross compiling grpc for armv7l architecture

170 views
Skip to first unread message

Pragadeesh nagaraj

unread,
Apr 4, 2024, 12:26:07 PM4/4/24
to grpc.io
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.

Pragadeesh nagaraj

unread,
Apr 10, 2024, 10:00:30 AM4/10/24
to grpc.io
Need help on this issue, still not resolved.

AJ Heller

unread,
Apr 15, 2024, 1:00:41 PM4/15/24
to grpc.io
I don't use CMake, but I believe you can pass `-DgRPC_USE_SYSTEMD=OFF` (based on https://github.com/grpc/grpc/blob/84ee28e6956ed7cd51462aad52e64782dd5ca34b/cmake/systemd.cmake#L17)

Hope this helps,
-aj

Mladen Božić

unread,
Mar 10, 2025, 12:35:51 PM3/10/25
to grpc.io
A bit of late replay...

I have the same issue currently, cross compiling for arm64 for Toradex SoM.
For me,  -DgRPC_USE_SYSTEMD=OFF does nothing.

Also, I'm not sure if systemd is necessary or not.

Reply all
Reply to author
Forward
0 new messages