Bug 8000 - smbd and nmbd fail to link against libwbclient.so.0 on solaris 10
Summary: smbd and nmbd fail to link against libwbclient.so.0 on solaris 10
Status: RESOLVED INVALID
Alias: None
Product: Samba 3.5
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.5.8
Hardware: Sparc Solaris
: P5 normal
Target Milestone: ---
Assignee: Björn Jacke
QA Contact: Samba QA Contact
URL:
Keywords:
: 8540 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-03-09 23:10 UTC by Greg Robinson
Modified: 2011-10-26 00:43 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Robinson 2011-03-09 23:10:50 UTC
Hi,

running ldd on nmbd (and others) fails to find libwbclient.so.0.  All other libraries are found ok.

Adding -R/usr/local/samba/lib to LDFLAGS and recompiling solves the problem (for me) but this is a recursive solution:  Samba needs to be installed, before it can be linked.  I can't add -R./bin as that (source) directory wont be there forever.

I have since re-compiled and re-installed, so all lib dependancies should be right now.  Adding a global LD_LIBRARY_PATH is not an option for me unfortunatley.
Comment 1 Björn Jacke 2011-04-20 13:38:51 UTC
but that is one of the ways you should handle that. If you don't want to extend 
your library search path, you would have to install the libs in one of your
global lib dirs, for example you might use --libdir=/usr/lib or so. That's a decision which is up to you, from samba point of view this is absolutely intended behaviour.
Comment 2 Greg Robinson 2011-04-27 00:40:59 UTC
Hi,

there is no global LD_LIBRARY_PATH in solaris.  How does samba cope with that situation?
Comment 3 Björn Jacke 2011-10-21 17:38:05 UTC
*** Bug 8540 has been marked as a duplicate of this bug. ***
Comment 4 Michael Pelletier 2011-10-21 18:47:26 UTC
It seems reasonable to me that Samba should include its own $(LIBDIR) in its runtime library search path. Is there some reason this is not done?
Comment 5 Michael Pelletier 2011-10-21 19:56:03 UTC
With the tweaks from bug 8531, bug 8532, and bug 8534, with SunFreeware.com SMClintl and libgcc_s.so, with --prefix=/usr/local/samba and...

... export LD_RUN_PATH="/usr/local/samba/lib:/usr/local/lib"

I was able to get a clean Solaris 8 build with just a few warnings. The first path would need to match up with the --prefix, of course. The tests ran through just fine except for the known Solaris POSIX symlink issue.

The ClamAV build has a mechanism to somehow reset the libraries from the build directory to the install directory during the "make install," perhaps that could serve as a model.
Comment 6 Greg Robinson 2011-10-24 05:50:04 UTC
Hi again,

Thankx for looking into this.  I just compiled 3.6.1 on my Solaris 10 box and still have the same issue.  I also tried the same 3.6.1 compile on Red Hat Enterprise 5.5 (2.6.18-194.26.1.el5) and got the same missing libraries:

Solaris 10:

ldd /usr/local/test/sbin/nmbd 
        libthread.so.1 =>        /lib/libthread.so.1
        libsendfile.so.1 =>      /lib/libsendfile.so.1
        libresolv.so.2 =>        /lib/libresolv.so.2
        librt.so.1 =>    /lib/librt.so.1
        libnsl.so.1 =>   /lib/libnsl.so.1
        libsocket.so.1 =>        /lib/libsocket.so.1
        libwbclient.so.0 =>      (file not found)
        libtalloc.so.2 =>        (file not found)
        libtdb.so.1 =>   (file not found)
        libpopt.so.0 =>  /usr/lib/libpopt.so.0
        libldap.so.5 =>  /usr/lib/libldap.so.5

[...]

RHEL 5.5:

ldd /var/tmp/samba/test/sbin/nmbd 
        libcap.so.1 => /lib64/libcap.so.1 (0x00002aceea094000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00002aceea298000)
        libnsl.so.1 => /lib64/libnsl.so.1 (0x00002aceea4ad000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00002aceea6c6000)
        librt.so.1 => /lib64/librt.so.1 (0x00002aceea8ca000)
        libwbclient.so.0 => not found
        libtalloc.so.2 => not found
        libtdb.so.1 => not found
        libpopt.so.0 => /usr/lib64/libpopt.so.0 (0x00002aceeaad4000)
[...]

I should note about this in the configure for Solaris 10:

checking for pkg-config... /bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LIBTALLOC... Package talloc was not found in the pkg-config search path.
Perhaps you should add the directory containing `talloc.pc'
to the PKG_CONFIG_PATH environment variable
No package 'talloc' found
no
checking size of size_t... (cached) 4
checking size of void *... 4
checking whether to build the libtalloc shared library... yes
checking for LIBTDB... Package tdb was not found in the pkg-config search path.
Perhaps you should add the directory containing `tdb.pc'
to the PKG_CONFIG_PATH environment variable
No package 'tdb' found
no

.. and on RHEL 5.5:

checking pkg-config is at least version 0.9.0... yes
checking for LIBTALLOC... no
checking size of size_t... (cached) 8
checking size of void *... 8
checking whether to build the libtalloc shared library... yes
checking for LIBTDB... no
checking for mmap... yes

Which would explain my missing (system) libraries, but samba compiles these libraries for me, it just does not link against them during install.
Comment 7 Michael Pelletier 2011-10-24 13:43:39 UTC
I think if you set your LD_LIBRARY_PATH to include /usr/local/test/lib, or include that path in LD_RUN_PATH prior to the build, your ldd should come out normal on Solaris 10.
Comment 8 Greg Robinson 2011-10-24 23:09:50 UTC
Hi,

I just compiled 3.6.1 on the latest Ubuntu (11.10 - 3.0.0-12-generic #20-Ubuntu SMP) and it works, however:

ldd nmbd
        linux-vdso.so.1 =>  (0x00007fff98bff000)
        libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f959d570000)
        libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f959d356000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f959d151000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f959cf49000)
        libwbclient.so.0 => /usr/lib/libwbclient.so.0 (0x00007f959cd2e000)
        libtalloc.so.2 => /usr/lib/x86_64-linux-gnu/libtalloc.so.2 (0x00007f959cb22000)
        libtdb.so.1 => /usr/lib/x86_64-linux-gnu/libtdb.so.1 (0x00007f959c911000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f959c6f9000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f959c359000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f959dcfb000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f959c13c000)

As you can see, samba is using the system wbclient, talloc and tdb libraries.  You have to ask yourself: Why does samba compile these libraries itself, when it will never use them?

Shouldn't samba be using ${PREFIX}/lib for this instead?
Comment 9 Greg Robinson 2011-10-26 00:43:53 UTC
Another confusing point, I note that in the configure script output for Ubuntu 11.10 is says:

checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LIBTALLOC... no
checking size of size_t... (cached) 8
checking size of void *... 8
checking whether to build the libtalloc shared library... yes
checking for LIBTDB... no

checking for LIBTALLOC... no - yet, according to the ldd output above, it did find the system talloc library and has linked against it.

Now I'm very confused...