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
```

在2021年4月1日星期四 UTC+8 下午10:43:15<[email protected]> 写道:

> 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
> ```
>
> On Thu, Apr 1, 2021 at 5:51 PM 唐雷 <[email protected]> wrote:
>
>> 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")
>>
>>
>> 在2020年7月18日星期六 UTC+8 上午7:12:18<[email protected]> 写道:
>>
>>> 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.
>>>
>> -- 
>> 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/c730c2c4-5b1f-4a5e-925a-2fe324dbd2a0n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/grpc-io/c730c2c4-5b1f-4a5e-925a-2fe324dbd2a0n%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/7f3448d5-4427-42eb-88a6-c5fc2a409299n%40googlegroups.com.

Reply via email to