The Samba-Bugzilla – Bug 11540
standalone ldb build still links against system libraries
Last modified: 2015-10-07 08:05:40 UTC
I'd like to build standalone LDB with everything in-tree, but this is not possible with only using the configure script from lib/ldb.
I can reproduce with a clean samba checkout with:
* git clone samba
* cd lib/ldb
* ./configure --bundled-libraries=all
* make test
I would expect the tests to run and pass, then. Instead, I get:
WAF_MAKE=1 PATH=buildtools/bin:../../buildtools/bin:$PATH waf test
ldbadd: error while loading shared libraries: libldb-cmdline.so: cannot open shared object file: No such file or directory
testsuite returned 1
Makefile:15: recipe for target 'test' failed
make: *** [test] Error 1
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f8ab362b000)
libldb.so.1 => /lib64/libldb.so.1 (0x00007f8ab33fd000)
libldb-cmdline.so => not found
libtdb.so.1 => /lib64/libtdb.so.1 (0x00007f8ab31e7000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f8ab2fb1000)
libattr.so.1 => /lib64/libattr.so.1 (0x00007f8ab2dab000)
libtevent.so.0 => /lib64/libtevent.so.0 (0x00007f8ab2b9d000)
libtalloc.so.2 => /lib64/libtalloc.so.2 (0x00007f8ab2989000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f8ab2784000)
libpopt.so.0 => /lib64/libpopt.so.0 (0x00007f8ab2577000)
libc.so.6 => /lib64/libc.so.6 (0x00007f8ab21b7000)
libfreebl3.so => /lib64/libfreebl3.so (0x00007f8ab1f39000)
So some dependencies are not found, others are found, but they are system libraries. I'd expect bundled libraries to be used instead since I specified --bundled-libraries=all.
btw everything seems to work OK if I do ./configure.developer --bundled-libraries=all from the Samba root..
(In reply to Jakub Hrozek from comment #0)
Can you try:
It seems that 'make test' doesn't imply building for some reason.
Created attachment 11475 [details]
Patches (talloc, tevent and ldb) for master
The patches look OK to me and should be accepted IMO, but they don't address the issue for me, sorry. Even after applying them and running:
I still see ./bin/ldbadd linked against the system libldb, not the in-tree one. ldd still shows the same as in the opening comment..
btw this only happens if I run ./configure from $samba_git/lib/ldb, when I run configure from $samba_git, then everything works fine...it's just then running make and make test gets a bit annoying as sometimes too much is executed..
Metze, the difference to the Samba build is, that Samba build with rpath set so you can execute the binaries in the source directory. We do not do that in the ldb standalone build, this also shows the ldd from the initial description.
(In reply to Andreas Schneider from comment #5)
Try ./configure --bundled-libraries=ALL instead of
./configure --bundled-libraries=ALL && make clean && TDB_NO_FSYNC=1 make test
linux-vdso.so.1 => (0x00007fff1a174000)
libldb.so.1 => /build/samba/lib/ldb/bin/shared/libldb.so.1 (0x00007fa7a6fd1000)
libldb-cmdline.so => /build/samba/lib/ldb/bin/shared/private/libldb-cmdline.so (0x00007fa7a6fc9000)
libtalloc.so.2 => /build/samba/lib/ldb/bin/shared/private/libtalloc.so.2 (0x00007fa7a6fbe000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa7a6a25000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa7a6807000)
libtevent.so.0 => /build/samba/lib/ldb/bin/shared/private/libtevent.so.0 (0x00007fa7a6f83000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa7a6603000)
libpopt-ldb.so => /build/samba/lib/ldb/bin/shared/private/libpopt-ldb.so (0x00007fa7a6f77000)
Also fix it? It builds internal talloc and tevent ...