交叉编译e2fsprogs for arm

时间:2011-11-22 08:04:54

标签: android compilation arm libraries

我正在尝试交叉编译extundelete linux包for arm。我想在我的Android设备上运行它。

当我尝试运行./configure时,它会显示Can't find ext2fs library。我发现问题是extundelete需要ext2fs库。该库位于e2fsprogs包中。

所以我试图交叉编译e2fsprogs。静态编译是不可能的,因为似乎e2fsprogrs需要--enable-elf-shlibs才能正确运行make命令。我用命令构建了e2fsprogrs:

"./configure --host=arm-none-linux-gnueabi" CC=arm-none-linux-gnueabi-gcc --enable-elf-shlibs && make && make install && make install-libs.

它运行正常,我得到交叉编译的e2fsprogs。问题是这是通过dinamically编译库,我不知道如何将它传递给extundelete交叉编译,然后我需要将哪些档案复制到我的Android设备。

我认为需要链接我在e2fsprogs交叉编译中获得的.so .a文件是可行的,但我不明白如何制作它。

在我的一次冒险中,交叉编译extundelete我得到了二进制arm extundelete文件,但这是动态链接编译并使用共享库。我试图将来自e2fsprogs的extundelete binary和.so文件复制到我的Android设备,但它没有正常运行。

任何人都可以帮助我理解动态交叉编译的精彩世界吗?

2 个答案:

答案 0 :(得分:1)

../ configure --host = arm-none-linux-gnueabi --with-cc = arm-none-linux-gnueabi-gcc --with-linker = arm-none-linux-gnueabi-ld - with-ldopts = - static --prefix = / tmp / target

答案 1 :(得分:0)

请注意,较新版本(例如1.43)不再使用--with-cc或--with-ldopts。 --with-linker也不再使用了。

使用CC =和LDFLAGS =代替。 例如:

./configure --host=arm-none-linux-gnueabi CC=arm-none-linux-gnueabi-gcc LDFLAGS=--static --prefox=/target/dirctory

干杯!