https://bugs.openldap.org/show_bug.cgi?id=9228
Bug ID: 9228 Summary: libldap depends on liblutil (lutil_memcmp) when cross compiling Product: OpenLDAP Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: --- Component: build Assignee: bugs@openldap.org Reporter: ryan@openldap.org Target Milestone: ---
cross-compiling for Unix:
./configure --host=arm-linux-gnueabihf CC=arm-linux-gnueabihf-gcc --with-yielding-select && make
...
libtool: link: arm-linux-gnueabihf-gcc -g -O2 -o ldapurl ldapurl.o lduversion.o ../../libraries/liblutil/liblutil.a ../../libraries/libldap/.libs/libldap.a /home/ryan/tmp/openldap/libraries/liblber/.libs/liblber.a ../../libraries/liblber/.libs/liblber.a -lresolv /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: ../../libraries/libldap/.libs/libldap.a(os-ip.o): in function `ldap_pvt_is_socket_ready': /home/ryan/tmp/openldap/libraries/libldap/os-ip.c:248: warning: `sys_errlist' is deprecated; use `strerror' or `strerror_r' instead /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: /home/ryan/tmp/openldap/libraries/libldap/os-ip.c:248: warning: `sys_nerr' is deprecated; use `strerror' or `strerror_r' instead /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: ../../libraries/libldap/.libs/libldap.a(result.o): in function `try_read1msg': /home/ryan/tmp/openldap/libraries/libldap/result.c:935: undefined reference to `lutil_memcmp'
cross-compiling for Windows:
./configure --host=x86_64-w64-mingw32 CC=x86_64-w64-mingw32-gcc && make
...
libtool: link: x86_64-w64-mingw32-gcc -shared .libs/bind.o .libs/open.o .libs/result.o .libs/error.o .libs/compare.o .libs/search.o .libs/controls.o .libs/messages.o .libs/references.o .libs/extended.o .libs/cyrus.o .libs/modify.o .libs/add.o .libs/modrdn.o .libs/delete.o .libs/abandon.o .libs/sasl.o .libs/sbind.o .libs/unbind.o .libs/cancel.o .libs/filter.o .libs/free.o .libs/sort.o .libs/passwd.o .libs/whoami.o .libs/vc.o .libs/getdn.o .libs/getentry.o .libs/getattr.o .libs/getvalues.o .libs/addentry.o .libs/request.o .libs/os-ip.o .libs/url.o .libs/pagectrl.o .libs/sortctrl.o .libs/vlvctrl.o .libs/init.o .libs/options.o .libs/print.o .libs/string.o .libs/util-int.o .libs/schema.o .libs/charray.o .libs/os-local.o .libs/dnssrv.o .libs/utf-8.o .libs/utf-8-conv.o .libs/tls2.o .libs/tls_o.o .libs/tls_g.o .libs/tls_m.o .libs/turn.o .libs/ppolicy.o .libs/dds.o .libs/txn.o .libs/ldap_sync.o .libs/stctrl.o .libs/assertion.o .libs/deref.o .libs/ldifutil.o .libs/ldif.o .libs/fetch.o .libs/lbase64.o .libs/msctrl.o .libs/psearchctrl.o .libs/version.o ../../libraries/liblber/.libs/liblber.dll.a -lregex -lws2_32 -g -O2 -o .libs/libldap.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libldap.dll.a /usr/bin/x86_64-w64-mingw32-ld: .libs/result.o: in function `try_read1msg': /home/ryan/tmp/openldap/libraries/libldap/result.c:935: undefined reference to `lutil_memcmp' /usr/bin/x86_64-w64-mingw32-ld: .libs/dnssrv.o: in function `ldap_dn2domain': /home/ryan/tmp/openldap/libraries/libldap/dnssrv.c:72: undefined reference to `lutil_memcmp' /usr/bin/x86_64-w64-mingw32-ld: .libs/ldif.o: in function `ldif_must_b64_encode': /home/ryan/tmp/openldap/libraries/libldap/ldif.c:426: undefined reference to `lutil_memcmp' collect2: error: ld returned 1 exit status
More similar issues occur with --enable-dynamic.
Workaround: configure with ac_cv_func_memcmp_working=yes