使用zlib交叉编译curl:在-lz中检查gzread ...否

时间:2019-04-17 17:44:04

标签: curl zlib

不久前,我问question关于使用openssl构建curl。它已解决,现在我遇到了Zlib的另一个问题。

1。建立Zlib

git clone https://github.com/madler/zlib.git -b v1.2.11 --depth 1 zlib-1.2.11
cd zlib-1.2.11
CC=arm-linux-gnueabihf ./configure --prefix=/usr
make -j$(nproc)
make DESTDIR=../armhf install

2。建立curl

git clone https://github.com/curl/curl.git -b curl-7_64_1 --depth 1 curl-7.64.1
cd curl-7.64.1
./buildconf

然后:

$ /configure --host=arm-linux-gnueabihf --prefix=/usr --with-ssl=(realpath ../armhf/usr) --with-zlib=(realpath ../armhf/usr)
...
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for gzread in -lz... no
configure: WARNING: configure found only the libz header file, not the lib!
...

我检查了:

$ arm-linux-gnueabihf-readelf -Ws ../armhf/usr/lib/libz.so | grep gzread
    53: 0000000000013060   642 FUNC    GLOBAL DEFAULT   13 gzread
    81: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS gzread.c
   186: 0000000000013060   642 FUNC    GLOBAL DEFAULT   13 gzread

$ file ../armhf/usr/lib/libz.so
../armhf/usr/lib/libz.so: symbolic link to libz.so.1.2.11
$ file ../armhf/usr/lib/libz.so.1.2.11 
../armhf/usr/lib/libz.so.1.2.11: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=6ee28b2de2613b77eed48b12ebf9c42286d00d79, not stripped

为什么curl在-lz中找不到gzread?

0 个答案:

没有答案