为 ARM 交叉编译 zlib [英] Cross Compile zlib for ARM

查看:47
本文介绍了为 ARM 交叉编译 zlib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试为 arm-poky-linux-gnueabi 交叉编译 zlib,但是当我启动 make 时出现错误:

...:~/zlib-1.2.11$ AR=$HOST-ar CC=$HOST-gcc RANLIB=$HOST-ranlib ./configure --prefix=$HOME/zlibARM正在检查共享库支持...使用 arm-poky-linux-gnueabi-gcc 构建共享库 libz.so.1.2.11.检查 size_t ... 是的.检查 off64_t ... 是的.检查 fseeko... 是的.检查 strerror... 是的.检查 unistd.h ... 是的.检查 stdarg.h... 是的.检查是使用 vs[n]printf() 还是 s[n]printf()... 使用 vs[n]printf().在 stdio.h 中检查 vsnprintf() ......是的.检查 vsnprintf() 的返回值...是的.检查属性(可见性)支持...是的....:~/zlib-1.2.11$ 制作arm-poky-linux-gnueabi-gcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -I.-c -o example.o 测试/example.cmake: execvp: arm-poky-linux-gnueabi-gcc : Trop de niveaux de liens symboliquesMakefile:147: 目标example.o"的配方失败制作:*** [example.o] 错误 127

你能帮我吗?

解决方案

我知道这篇文章已经有 7 个月了,但是我能够成功地为 ARM(在 MacOS 上)交叉编译 zlib,使用以下配置命令:

CHOST=arm \CC=\AR=\RANLIB=\./配置 \--prefix=<安装路径>

其中PATH_TO_CROSS_GCCPATH_TO_CROSS_ARPATH_TO_CROSS_GCC 指向交叉编译工具(在我的例子中,我使用crosstool-NG).

最终使它对我有用的是指定 CHOST=arm,这导致它实际使用指定的 ar.

希望这可以帮助某人.

I try cross compile zlib for arm-poky-linux-gnueabi but I've an error when I launch make :

...:~/zlib-1.2.11$ AR=$HOST-ar CC=$HOST-gcc RANLIB=$HOST-ranlib ./configure --prefix=$HOME/zlibARM 
Checking for shared library support... 
Building shared library libz.so.1.2.11 with arm-poky-linux-gnueabi-gcc. 
Checking for size_t... Yes. 
Checking for off64_t... Yes. 
Checking for fseeko... Yes. 
Checking for strerror... Yes. 
Checking for unistd.h... Yes. 
Checking for stdarg.h... Yes. 
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf(). 
Checking for vsnprintf() in stdio.h... Yes. 
Checking for return value of vsnprintf()... Yes. 
Checking for attribute(visibility) support... Yes.

...:~/zlib-1.2.11$ make
arm-poky-linux-gnueabi-gcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -I. -c -o example.o test/example.c
make: execvp: arm-poky-linux-gnueabi-gcc : Trop de niveaux de liens symboliques
Makefile:147: recipe for target 'example.o' failed
make: *** [example.o] Error 127

Can you help me ?

解决方案

I know this post is already 7 months old, but I was able to successfully cross-compile zlib for ARM (on MacOS), with the following configure command:

CHOST=arm \
CC=<PATH_TO_CROSS_GCC> \
AR=<PATH_TO_CROSS_AR> \
RANLIB=<PATH_TO_CROSS_RANLIB> \
./configure \
--prefix=<INSTALL_PATH>

Where PATH_TO_CROSS_GCC, PATH_TO_CROSS_AR and PATH_TO_CROSS_GCC point to the cross compilation tools (In my case, I use crosstool-NG).

What eventually made it work for me was specifying the CHOST=arm, which caused it to actually use the specified ar.

Hopefully this could help someone down the line.

这篇关于为 ARM 交叉编译 zlib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆