mtd-utils交叉編譯

來源:互聯網
上載者:User

在網上參考了很多人的文章,開始就是編譯不過去,提示/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,就不需要安裝!

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.