交叉编译--


uuid

配置

#! /bin/sh
echo "build ..."
PWD=`pwd`
./configure --prefix=${
    
    PWD}/../arm --host=arm-linux CC=../../gcc/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc CFLAGS=-fPIC
#make && make install
echo "done"

leveldb

源码地址
版本1.20
直接修改Makefile交叉编译,指定CC和CXX
在这里插入图片描述
leveld api


交叉编译问题总结

问题:
出现 a local symbol’ can not be used when making a shared object
说明:
1、这个问题只有在64位系统中编译的时候才会出现;
2、共享库要求生成的代码无绝对地址,只有相对地址,才能在内存的任何地址正确执行;
3、-fPIC 作用于编译阶段,告诉编译器产生与位置无关代码;
解决:
编译的时候添加 -fPIC 选项
参考博文:
交叉编译出现a local symbol’ can not be used when making a shared object的解决方法


猜你喜欢

转载自blog.csdn.net/GeiGe123/article/details/114576652