日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

cross_compile = arm-linux-,cross compile grpc for arm

發(fā)布時間:2023/12/10 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 cross_compile = arm-linux-,cross compile grpc for arm 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

8種機械鍵盤軸體對比

本人程序員,要買一個寫代碼的鍵盤,請問紅軸和茶軸怎么選?

This post will tell you how to cross compile gPRC static lib for ARM.

前段時間嘗試交叉編譯gRPC遇到了不少的麻煩,寫篇post記錄一下。

gRPC

Preparation

First of all, you should have gRPC source code. git clone it from github. Then update submodules:1

2cd grpc

git submodule update --init

Install zlib for your arm compiler[Optional]

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:1

2

3

4export CC=arm-linux-gnueabihf-gcc

export AR=arm-linux-gnueabihf-ar

./configure

make -j4

then install it if build succeed:1make install prefix=/usr/arm-linux-gnueabihf

Compile and install protobuf & gRPC for HOST

protobuf:1

2

3

4cd grpc/third_party/protobuf

./autogen.sh && ./configure && make -j4

sudo make install -j4

sudo ldconfig

gRPC:1

2cd ..

make -j4 && sudo make install -j4 && sudo ldconfig

Cross compile static lib for ARM

make plugins first:1

2make clean

make plugins CC=arm-linux-gnueabihf-gcc -j4

Cross compile gRPC:1

2

3

4

5

6

7

8

9

10export GRPC_CROSS_COMPILE=true

export GRPC_CROSS_AROPTS="cr --target=elf32-little"

make -j4 HAS_PKG_CONFIG=false

CC=arm-linux-gnueabihf-gcc

CXX=arm-linux-gnueabihf-g++

RANLIB=arm-linux-gnueabihf-ranlib

LD=arm-linux-gnueabihf-ld

LDXX=arm-linux-gnueabihf-g++

AR=arm-linux-gnueabihf-ar

PROTOBUF_CONFIG_OPTS="--host=arm-linux-gnueabihf --with-protoc=/usr/local/bin/protoc" static

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”.

總結

以上是生活随笔為你收集整理的cross_compile = arm-linux-,cross compile grpc for arm的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內容還不錯,歡迎將生活随笔推薦給好友。