Bug 3209 - nsswitch/libnss_winbind.so needs -nsl
nsswitch/libnss_winbind.so needs -nsl
Status: RESOLVED WORKSFORME
Product: Samba 3.0
Classification: Unclassified
Component: Build environment
3.0.21
Sparc Solaris
: P3 normal
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-25 04:19 UTC by Maximilian Kolmhuber
Modified: 2012-04-17 09:51 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maximilian Kolmhuber 2005-10-25 04:19:36 UTC
linking libnss_winbind.so on Solaris needs -lsocket *and* -lnsl
Comment 1 Gerald (Jerry) Carter 2005-10-26 05:59:16 UTC
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
=====================
Comment 2 Gerald (Jerry) Carter 2005-10-26 06:40:44 UTC
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.
Comment 3 Maximilian Kolmhuber 2005-10-26 15:39:18 UTC
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.
Comment 4 Maximilian Kolmhuber 2005-10-26 15:47:00 UTC
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.
Comment 5 Björn Jacke 2012-04-17 09:51:34 UTC
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!