【问题标题】:configure dropbear failure: zlib missing配置 dropbear 失败:缺少 zlib
【发布时间】:2021-10-05 18:01:24
【问题描述】:

我已经有一个交叉编译的 zlib:

path/to/zlib/install/
├── include
│   ├── zconf.h
│   └── zlib.h
├── lib
│   ├── libz.a
│   ├── libz.so -> libz.so.1.2.11
│   ├── libz.so.1 -> libz.so.1.2.11
│   ├── libz.so.1.2.11
│   └── pkgconfig
│       └── zlib.pc
└── share
    └── man
        └── man3
            └── zlib.3

但是当我运行 dropbear 的configure 时,控制台显示configure: error: *** zlib missing - install first or check config.log ***

CC=arm-linux-gcc \
./configure \
--host=arm-linux \
--with-zlib=path/to/zlib/install

这是config.log 的一部分,附近有错误:

configure:4845: checking for deflate in -lz
configure:4870: arm-linux-gcc -o conftest -Os -W -Wall -Wno-pointer-sign -fno-strict-overflow -fPIE -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -I/path/to/zlib/install/include  -L/path/to/zlib/install/lib  -Wl,-pie -Wl,-z,now -Wl,-z,relro conftest.c -lz   >&5
/usr/local/arm_linux_4.8/lib/gcc/arm-linux-uclibceabi/4.8.4/../../../../arm-linux-uclibceabi/bin/ld: cannot find -lssp_nonshared
/usr/local/arm_linux_4.8/lib/gcc/arm-linux-uclibceabi/4.8.4/../../../../arm-linux-uclibceabi/bin/ld: cannot find -lssp
collect2: error: ld returned 1 exit status
configure:4870: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define _FILE_OFFSET_BITS 64
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h.  */
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char deflate ();
| int
| main ()
| {
| return deflate ();
|   ;
|   return 0;
| }
configure:4879: result: no
configure:4889: error: *** zlib missing - install first or check config.log ***

【问题讨论】:

  • 缺少-lssp_nonshared and -lssp导致编译失败
  • @nhatnq 感谢您的回复。我不这么认为。因为checking for deflate in -lz之前的其他检查也显示ld: cannot find -lssp_nonshared&ld: cannot find -lssp,但不会导致失败。
  • 你能用deflate上面的代码创建类似的例子并尝试在外面编译吗?只需执行configure 脚本所做的操作即可。想看编译器的输出
  • 相同的结果:ld: cannot find -lssp_nonshared & ld: cannot find -lssp。其他检查是可选的(例如 crypt)。所以他们不会导致失败。但是 zlib 是必需的。我对吗? @nhatnq

标签: linux zlib dropbear


【解决方案1】:

解决了。

我的编译器不支持 SSP。使用--disable-harden禁用 SSP。

非常感谢@nhatnq

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-16
    • 1970-01-01
    • 2023-03-07
    • 1970-01-01
    相关资源
    最近更新 更多