0

我已经有一个交叉编译的 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

但是当我运行configuredropbear 时,控制台显示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 ***
4

1 回答 1

0

解决了。

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

非常感谢@nhatnq

于 2021-07-30T10:13:09.910 回答