This post will tell you how to cross compile gPRC static lib for ARM.
First of all, you should have gRPC source code. git clone it from github. Then update submodules:
libz is one of gRPC dependencies. If you haven’t installed it for your arm compiler yet, you may need to install it. You can get zlib at zlib Home Site. After download and unzip it, set cross compiler and build it:
then install it if build succeed:
make install prefix=/usr/arm-linux-gnueabihf
make plugins first:
Cross compile gRPC:
static is important. I tried to build shared lib but there will be a lot of errors because arm-linux-gnueabihf-ld doesn’t take “-Wl” as a parameter. If build succeed, you can find your static lib at “grpc/libs/opt”.