问题
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 ?
回答1:
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.
来源:https://stackoverflow.com/questions/53885273/cross-compile-zlib-for-arm