missing rpath [was: building bundled talloc/tevent/tdb libs out of main samba sources]
Michael Tokarev
mjt at tls.msk.ru
Wed Nov 27 14:24:01 UTC 2024
27.11.2024 09:04, Michael Tokarev via samba-technical wrote:
> 27.11.2024 08:26, Andrew Bartlett via samba-technical wrote:
>> On Wed, 2024-11-27 at 08:12 +0300, Michael Tokarev via samba-technical
> ...>> But my attempt were unsuccessful so far, as it turned out.
>>>
>>> Once I arrange to build all 3 libs out of samba, the build system
>>> suddenly stops embedding rpath-private into all binaries, so the
>>> resulting thing, while having the same set of files, actually does
>>> not work, - not finding samba private libraries in libdir/samba.
>>> I'm investigating it now, - but again, the build system is just too
>>> complex and very difficult to debug, so it might take some time.
>>> It's something I didn't expect at all, as all other changes are
>>> rather simple.
>>
>> That is why I'm suggesting looking at what I did for ldb, and trying to
>> make that more general, because we worked on some of those details.
>
> This issue at hand has nothing to do with the actual way to build
> libtdb &Co. It's just a consequence of too complex build system.
>
> Here's what I've found, using param.cpython as a starting point:
>
> $ fgrep param.cpython build.* | grep rpath
> build.bad:runner [..samba/samba3/param.cpython-312-x86_64-linux-gnu.so..
> build.good:runner [..samba/param.cpython-312-x86_64-linux-gnu.so..
> build.good:runner [..samba/samba3/param.cpython-312-x86_64-linux-gnu.so..
>
> as we can see, param.cpython-312.. is missing in the 'bad' case, -
> it is built without private rpath.
>
> Looking at the definition of param.cpython, in source3/samba/wscript_build:
>
> bld.SAMBA3_SUBSYSTEM(pyparam_util,
> source='pyparam_util.c',
> deps='%s samba-hostconfig %s' % (libpython, pytalloc_util),
> pyext=True,
> enabled=bld.PYTHON_BUILD_IS_ENABLED()
> )
That should've been source4/param/wscript_build ofc.
I found my issue with missing rpath.
It was --disable-rpath --disable-rpath-install configure option which were
here for a very long time, since this commit:
commit 28093211cd7d03eed70958d188ad4aac7d75d30b
Author: Andrew Bartlett <abartlet at samba.org>
Date: Fri May 3 20:48:41 2013 +1200
The remainder of the patch to merge with the samba4 package
which, I guess, just copied these options from samba3 packaging.
As the result, only binaries (shared objects and executables) which
are especially built for installing (for `make install`) received
the extra rpath. While binaries which were built just once - for
either installing or using directly, when they're the same - did
not receive rpath. And by turning off last 'external' library into
bundled one, many internal libs has become the same be it for use
locally or for install. And had lost the rpath thing.
It needed all 3 - tdb, tevent, and talloc - to be built from source
to trigger this one. In my case, talloc happen to be last so it was
talloc which triggered it.
I removed --disable-rpath --disable-rpath-install and now everything
is in order.
It took me quite some time to figure this out.
Again, the build system is just too complex, I think. Usually there's
no need to build two versions of binaries, one set for local use and
another for installing, - I think no other build system does this.
/mjt
More information about the samba-technical
mailing list