linking libnss_winbind.so on Solaris needs -lsocket *and* -lnsl
On my Solaris 9 box, the libs are set to LIBS= -lsendfile -lresolv -lsocket -lnsl -liconv Hmmm...I think this check in configure.in is bogus though. No idea why we are checking for printf in -lnsl[_s]. I'll fix that up and test some more. ===================== AC_CHECK_FUNCS(connect) if test x"$ac_cv_func_connect" = x"no"; then case "$LIBS" in *-lnsl*) ;; *) AC_CHECK_LIB(nsl_s, printf) ;; esac case "$LIBS" in *-lnsl*) ;; *) AC_CHECK_LIB(nsl, printf) ;; esac case "$LIBS" in *-lsocket*) ;; *) AC_CHECK_LIB(socket, connect) ;; esac case "$LIBS" in *-linet*) ;; *) AC_CHECK_LIB(inet, connect) ;; esac dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value dnl has been cached. if test x"$ac_cv_lib_socket_connect" = x"yes" || test x"$ac_cv_lib_inet_connect" = x"yes"; then # ac_cv_func_connect=yes # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run AC_DEFINE(HAVE_CONNECT,1,[Whether the system has connect()]) fi fi =====================
Even with the corrected checks for connect() and "LIBS= -lsendfile -lresolv -lsocket -liconv" in the Makefile, libnss_winbind.so still builds correctly. ldd nsswitch/libnss_winbind.so libthread.so.1 => /usr/lib/libthread.so.1 libsocket.so.1 => /usr/lib/libsocket.so.1 libc.so.1 => /usr/lib/libc.so.1 libdl.so.1 => /usr/lib/libdl.so.1 libnsl.so.1 => /usr/lib/libnsl.so.1 libmp.so.2 => /usr/lib/libmp.so.2 /usr/platform/SUNW,Ultra-60/lib/libc_psr.so.1 Closing this as works for me.
Try to link statically and add '-Wl,--no-undefined' to the linker flags for the targets - @WINBIND_NSS@ and - nsswitch/pam_winbind.@SHLIBEXT@ It probably only happens in case of a static link.
I forgot to say that I configured with --enable-static --disable-shared and I'm using gcc 3.4.4 & GNU ld 2.16.1 to build.
i think this is not an issue with recent samba releases. If you still see this issue, please reopen and describe how to reproduce. Thanks!