mtd-utils交叉编译

http://blog.csdn.net/mociml/article/details/6134988


在网上参考了很多人的文章,开始就是编译不过去,提示/sys/acl.h无法找到!

最后终于解决,原因是路径的问题

 

1、源码

http://www.zlib.net/zlib-1.2.5.tar.gz

http://www.oberhumer.com/opensource/lzo/download/lzo-2.03.tar.gz

ftp://ftp.infradead.org/pub/mtd-utils/mtd-utils-1.4.1.tar.bz2

 

说明:zlib和lzo是编译mtd-utils所需库文件,需提前交叉编译完成,以供mtd-utils编译时调用

 

2、编译安装zlib:

root@:/home/# cd zlib-1.2.5

root@:/home/zlib-1.2.5# CC=arm-none-linux-gnueabi-gcc  ./configure --shared --prefix=/opt/armv6/codesourcery/arm-none-linux-gnueabi/

root@:/home/zlib-1.2.5# make

root@:/home/zlib-1.2.5# make install

 

其中-prefix指定zlib的安装路径,需要指定到交叉编译器所在路径!

 

 

3、编译安装lzo:

root@:/home/# cd lzo-2.03/

root@:/home/lzo-2.03# 编译安装lzo:

root@:/home/# cd lzo-2.03/

root@:/home/lzo-2.03# CC=arm-none-linux-gnueabi-gcc ./configure --host=arm-linux --prefix=/opt/armv6/codesourcery/arm-none-linux-gnueabi/

root@:/home/lzo-2.03# make

root@:/home/lzo-2.03# make install

 

 

4、编译mtd-utils

 

make CROSS=/opt/armv6/codesourcery/bin/arm-none-linux-gnueabi- WITHOUT_XATTR=1

 

 

指定WITHOUT_XATTR=1 是由于在编译 mkfs.jffs2使其不调用acl.h而是用zlib的库,否则会报错:

mkfs.jffs2.c:69:21: error: sys/acl.h: No such file or directory
mkfs.jffs2.c: In function ‘formalize_posix_acl’:
mkfs.jffs2.c:1118: error: ‘ACL_USER_OBJ’ undeclared (first use in this function)
mkfs.jffs2.c:1118: error: (Each undeclared identifier is reported only once
mkfs.jffs2.c:1118: error: for each function it appears in.)
mkfs.jffs2.c:1119: error: ‘ACL_GROUP_OBJ’ undeclared (first use in this function)
mkfs.jffs2.c:1120: error: ‘ACL_MASK’ undeclared (first use in this function)
mkfs.jffs2.c:1121: error: ‘ACL_OTHER’ undeclared (first use in this function)
mkfs.jffs2.c:1127: error: ‘ACL_USER’ undeclared (first use in this function)
mkfs.jffs2.c:1128: error: ‘ACL_GROUP’ undeclared (first use in this function)
make: *** [mkfs.jffs2.o] Error 1

 

有人写到出现此错误需要安装libacl-dev,个人觉得如果指定WITHOUT_XATTR=1,就不需要安装!

 


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值