Unable to Cross Compile gRPC

579 views
Skip to first unread message

antne...@gmail.com

unread,
Jul 17, 2020, 7:12:18 PM7/17/20
to grpc.io
I am trying to cross compile the gRPC code on my Ubuntu 14-04 Linux system and I am getting the following error:

mitydsp@vagrantup:~/grpc/cmake/build$ make
[  4%] Built target libprotobuf
[  9%] Built target libprotoc
[  9%] Built target grpc_plugin_support
[  9%] Built target grpc_ruby_plugin
[ 10%] Built target grpc_php_plugin
[ 10%] Built target grpc_objective_c_plugin
[ 10%] Built target grpc_node_plugin
[ 10%] Built target grpc_csharp_plugin
[ 11%] Built target zlibstatic
[ 12%] Built target upb
[ 12%] Built target absl_dynamic_annotations
[ 12%] Built target absl_spinlock_wait
[ 12%] Built target absl_log_severity
[ 12%] Built target absl_raw_logging_internal
[ 12%] Built target absl_base
[ 12%] Built target absl_throw_delegate
[ 12%] Built target address_sorting
[ 13%] Built target absl_time_zone
[ 13%] Built target absl_int128
[ 13%] Built target absl_strings_internal
[ 14%] Built target absl_strings
[ 14%] Built target absl_str_format_internal
[ 14%] Built target absl_civil_time
[ 14%] Built target absl_time
[ 17%] Built target gpr
[ 17%] Built target absl_bad_optional_access
[ 20%] Built target c-ares
[ 40%] Built target grpc_unsecure
[ 40%] Building ASM object third_party/boringssl-with-bazel/CMakeFiles/crypto.dir/linux-x86_64/crypto/chacha/chacha-x86_64.S.o
/home/mitydsp/grpc/third_party/boringssl-with-bazel/linux-x86_64/crypto/chacha/chacha-x86_64.S: Assembler messages:
/home/mitydsp/grpc/third_party/boringssl-with-bazel/linux-x86_64/crypto/chacha/chacha-x86_64.S:1633: Error: junk at end of line, first unrecognized character is `,'
make[2]: *** [third_party/boringssl-with-bazel/CMakeFiles/crypto.dir/linux-x86_64/crypto/chacha/chacha-x86_64.S.o] Error 1
make[1]: *** [third_party/boringssl-with-bazel/CMakeFiles/crypto.dir/all] Error 2
make: *** [all] Error 2

The target OS is an embedded system using an ARM Cortex A8 processor.

Any help would be appreciated.

唐雷

unread,
Apr 1, 2021, 5:51:06 AM4/1/21
to grpc.io
oh,I have the same error,and I vim  it's CmakeLists,but it alaways has other error,
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-maes’; did you mean ‘-mapcs’?
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-msse4’

 vim ../third_party/boringssl-with-bazel/CMakeLists.txt +99
 set(ARCH "arm")


Russell Wu

unread,
Apr 1, 2021, 10:43:15 AM4/1/21
to 唐雷, grpc.io
I'm using g++ 6.3.1 and dockcross. The following works for me. I think the CMAKE_TOOLCHAIN_FILE is what matters.
```
cmake ../.. -DCMAKE_BUILD_TYPE=Release -DgRPC_INSTALL=ON -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DBUILD_SHARED_LIBS=ON -DgRPC_SSL_PROVIDER=package
make
```

--
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 grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/c730c2c4-5b1f-4a5e-925a-2fe324dbd2a0n%40googlegroups.com.

唐雷

unread,
Apr 1, 2021, 11:18:25 PM4/1/21
to grpc.io
Thank you very mush,i have make success.
```my toolChain.cmake
vim /tmp/toolChain.cmake
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_PROCESSOR arm)

# specify the cross compiler
set(GCC_COMPILER_PATH /prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf)
set(CMAKE_C_COMPILER ${GCC_COMPILER_PATH}/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER ${GCC_COMPILER_PATH}/bin/arm-linux-gnueabihf-g++)
# where is the target environment 
#SET(CMAKE_FIND_ROOT_PATH  ${GCC_COMPILER_PATH})
# search for programs in the build host directories (not necessary)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
```
```create file and make 
mkdir grpc/build
mkdir /tmp/grpc_arm
cd grpc/build
cmake .. -DCMAKE_BUILD_TYPE=Release -DgRPC_INSTALL=ON       -DCMAKE_INSTALL_PREFIX=/tmp/grpc_arm -DCMAKE_TOOLCHAIN_FILE=/tmp/toolChain.cmak
make -j
sudo make install
```

ZGhiuang Zheng

unread,
Sep 17, 2021, 10:55:48 PM9/17/21
to grpc.io
您好,我也遇到了这个问题,请问您如何解决的呢?
Reply all
Reply to author
Forward
0 new messages