[英]Unable to cross-compile dropbear for uclibc
I am trying to cross-compile Dropbear for an x86 machine where glibc is missing and instead, uclibc is being used.我正在尝试为缺少 glibc 而使用uclibc的 x86 机器交叉编译Dropbear 。 For that aim, I have cross-compiled zlib for this same instruction set using a custom crosstool-ng toolchain and installed it to a custom location.
为此,我使用自定义 crosstool-ng 工具链为同一指令集交叉编译了 zlib,并将其安装到自定义位置。
msainz@ubuntu:~$ ls Projects/zlib_install/lib
libz.a libz.so libz.so.1 libz.so.1.2.11 pkgconfig
I have copied Projects/zlib_install/include/zlib.h
and Projects/zlib/include/zconf.h
to Projects/dropbear/zlibincludes/
.我已将
Projects/zlib_install/include/zlib.h
和Projects/zlib/include/zconf.h
到Projects/dropbear/zlibincludes/
。
I've set my env variables this way:我以这种方式设置了我的 env 变量:
msainz@ubuntu:~$ echo $PATH
usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:
/usr/local/games:/snap/bin:/home/msainz/x-tools/x86_64-multilib-linux-uclibc/bin
msainz@ubuntu:~/Projects/dropbear$ echo $LDFLAGS
/home/msainz/Projects/zlib_install/lib/libz.a
msainz@ubuntu:~/Projects/dropbear$ echo $CFLAGS
-Izlibincludes -I../zlibincludes
I launch the configure script this way: ./configure --prefix=/home/msainz/Projects/tmp_top_dir --host=x86
我以这种方式启动配置脚本:
./configure --prefix=/home/msainz/Projects/tmp_top_dir --host=x86
The execution terminates with the following error:执行终止并出现以下错误:
configure:4851: x86_64-multilib-linux-uclibc-gcc -o conftest -Izlibincludes -I../zlibincludes -Wno-
pointer-sign -fno-strict-overflow -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -mfunction-
return=thunk -mindirect-branch=thunk /home/msainz/Projects/zlib_install/lib/libz.a -pie -Wl,-z,now -
Wl,-z,relro conftest.c -lz >&5
/home/msainz/x-tools/x86_64-multilib-linux-uclibc/bin/../lib/gcc/x86_64-multilib-linux-
uclibc/8.3.0/../../../../x86_64-multilib-linux-uclibc/bin/ld.bfd: cannot find -lz
collect2: error: ld returned 1 exit status
Any ideas to solve this?有什么想法可以解决这个问题吗? Thanks in advance.
提前致谢。
解决了将--with-zlib=/home/msainz/Projects/zlib_install/
到./configure
调用的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.