软件环境:
系统:ubuntu 14.04 64位Linux系统
交叉编译工具:gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf,安装路径为/usr/local/oecore-x86_64
使用交叉工具链编译arm-linux版本库:
1、下载
下载libiec61850库源码并解压,当前使用的开源库版本为1.0.0版本,存放路径为:/home/u/libiec61850-1.0.0
2、进入源码目录:
cd /home/u/libiec61850-1.0.0/
3、修改make/target_system.mk文件
(1)修改ARM_TOOLCHAIN_PREFIX为指定的交叉编译工具链前缀
这里修改为:arm-angstrom-linux-gnueabi-,即ARM_TOOLCHAIN_PREFIX=arm-angstrom-linux-gnueabi-
注:确定当前交叉编译工具链方法如下:
a、配置环境:
source /usr/local/oecore-x86_64/environment-setup-armv7at2hf-vfp-neon-angstrom-linux-gnueabi
b、查看当前交叉编译工具链:
echo $CC
输出信息如下:
arm-angstrom-linux-gnueabi-gcc -march=armv7-a -mthumb -mthumb-interwork -mfloat-abi=hard -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-vfp-neon-angstrom-linux-gnueabi
(2)修改make/target_system.mk文件中CFLAGS内容:
修改前:
ifeq ($(TARGET), LINUX-ARM)
TOOLCHAIN_PREFIX=$(ARM_TOOLCHAIN_PREFIX)
CFLAGS += -mno-unaligned-access
修改后:
ifeq ($(TARGET), LINUX-ARM)
TOOLCHAIN_PREFIX=$(ARM_TOOLCHAIN_PREFIX)
CFLAGS += -mno-unaligned-access -march=armv7-a -mthumb -mthumb-interwork -mfloat-abi=hard -mfpu=neon --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-vfp-neon-angstrom-linux-gnueabi
3、编译arm-linux版本库:
http://www.wu0553.com/news/37606.html
http://www.wu0553.com/news/37609.html
http://www.wu0553.com/news/37614.html
http://www.wu0553.com/news/37616.html
http://www.wu0553.com/news/37619.html
http://www.wu0553.com/news/37623.html
http://www.wu0553.com/news/37625.html
http://www.wu0553.com/news/37628.html
http://www.wu0553.com/news/37632.html
http://www.wu0553.com/news/37635.html
http://www.wu0553.com/news/37638.html
http://www.wu0553.com/news/37640.html
http://www.wu0553.com/news/37642.html
http://www.wu0553.com/news/37654.html
http://www.wu0553.com/news/37656.html
http://www.wu0553.com/news/37658.html
http://www.wu0553.com/news/37663.html
http://www.wu0553.com/news/37665.html
http://www.wu0553.com/news/37666.html
http://www.wu0553.com/news/37667.html
http://www.wu0553.com/news/37669.html
http://www.wu0553.com/news/37670.html
http://www.wu0553.com/news/37671.html
http://www.wu0553.com/news/37672.html
http://www.wu0553.com/news/37673.html
http://www.wu0553.com/news/37674.html
http://www.wu0553.com/news/37675.html
http://www.wu0553.com/news/37677.html
http://www.wu0553.com/news/37678.html
http://www.wu0553.com/news/37679.html
http://www.wu0553.com/news/37680.html
http://www.wu0553.com/news/37681.html
http://www.wu0553.com/news/37682.html
http://www.wu0553.com/news/37683.html
http://www.wu0553.com/news/37684.html
http://www.wu0553.com/news/37688.html
http://www.wu0553.com/news/37690.html
http://www.wu0553.com/news/37694.html
http://www.wu0553.com/news/37715.html
http://www.wu0553.com/news/37716.html
http://www.wu0553.com/news/37721.html
http://www.wu0553.com/news/37724.html
http://www.wu0553.com/news/37727.html
http://www.wu0553.com/news/37729.html
http://www.wu0553.com/news/37730.html
http://www.wu0553.com/news/37731.html
http://www.wu0553.com/news/37733.html
编译成功后,编译生成的文件存放在build-arm目录下