0

I already have a cross-compiled 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

but when I run configure of dropbear, console shows configure: error: *** zlib missing - install first or check config.log ***:

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

here's a part of config.log near by error:

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 ***
John Doe
  • 63
  • 4
  • 1
    Missing `-lssp_nonshared and -lssp` caused the compilation failed – nhatnq Jul 30 '21 at 07:57
  • @nhatnq thanks for replying. I don't think so. Because other checks before `checking for deflate in -lz` also show `ld: cannot find -lssp_nonshared` & `ld: cannot find -lssp`, but won't cause failure. – John Doe Jul 30 '21 at 08:18
  • Can you create similar example with the codes above `deflate` and try compiling it outside ? Just do what the `configure` script did. Want to see the output the compiler – nhatnq Jul 30 '21 at 08:24
  • The same result: `ld: cannot find -lssp_nonshared` & `ld: cannot find -lssp`. Other checks are optional (e.g. crypt). So they won't cause failure. But zlib is required. Am I right? @nhatnq – John Doe Jul 30 '21 at 09:41

1 Answers1

0

Solved.

My compiler doesn't support SSP. Using --disable-harden to disable SSP.

Thanks @nhatnq a lot.

John Doe
  • 63
  • 4