What determines RUNPATH in installed libs?

Andrew Bartlett abartlet at samba.org
Wed Apr 6 00:51:46 UTC 2022


On Tue, 2022-04-05 at 17:41 -0700, Tim Rice via samba-technical wrote:
> Hi Andrew,
> 
> On Wed, 6 Apr 2022, Andrew Bartlett via samba-technical wrote:
> 
> > On Tue, 2022-04-05 at 16:43 -0700, Tim Rice via samba-technical
> wrote:
> > > If I configure samba-4.10.16 with these options,
> > 
> > I realise your question is generic, but before someone else says
> it,
> > please don't configure Samba 4.10, it is long out of support ;-)
> 
> Totally understood. Unfortunatly my 4.15.3 build stopped at
> [2378/4098]
> and I discovered XXat syscalls were required. Not on UnixWare yet.
> (and centos7 does have security patches)

To be clear, the things that made us require XXat syscalls are not in
those patches, because you can't patch for them without the XXat
syscalls.  This is the whole share escape mess. 

> > >         --libdir=/opt/lib/samba
> > >         --with-modulesdir=/opt/lib/samba
> > >         --with-privatelibdir=/opt/lib/samba/private
> > > most libs will get installed with the correct RUNPATH but these
> > >     bin/default/lib/util/libsamba-modules-samba4.inst.so
> > >     bin/default/libcli/registry/libutil-reg-samba4.inst.so
> > >     bin/default/libcli/util/python-ntstatus.inst.cpython-39.so
> > >     bin/default/libcli/util/python-werror.inst.cpython-39.so
> > >     bin/default/source3/libmessages-util-samba4.inst.so
> > >     bin/default/source3/libsmbldap.inst.so
> > >     bin/default/source4/lib/samba3/libsmbpasswdparser-
> samba4.inst.so
> > >     bin/default/nsswitch/stress-nss-libwbclient.inst
> > >     bin/default/source3/smbd/notifyd/notifyd-tests.inst
> > >     bin/default/source3/versiontest.inst
> > > will get installed with RUNPATH /opt/lib/samba and yet they all
> > > need libs from /opt/lib/samba/private.
> > 
> > Yes, this is expected.  Bits of samba require other bits of Samba
> that
> > are not public interfaces, but are built as shared libraries to
> avoid
> > duplication of compiled code (with all the problems that creates).
> 
> Expected to have a RUNPATH /opt/lib/samba when it needs
> RUNPATH /opt/lib/samba/private:/opt/lib/samba ?
> As I said, most of the samba libs have the correct RUNPATH

>From my experiences with RPATH and RUNPATH for Google's oss-fuzz, I can
only warn:

You’re in a maze of twisty little passages, all alike.

> > > Are the dependencies listed somewhere in one of the files in the
> > > source tree?
> > 
> > The deps= lines in the wscript
> > 
> > > Are they calculated at configure time?
> > > Are they calculated at build time?
> > 
> > waf, our build system, calculates this.  
> 
> OK, thanks. I'll dig in and see what's missing.

You are likely to be eaten by a grue.

;-)

("git grep -i rpath" would be a start). 

Andrew Bartlett

-- 
Andrew Bartlett (he/him)       https://samba.org/~abartlet/
Samba Team Member (since 2001) https://samba.org
Samba Team Lead, Catalyst IT   https://catalyst.net.nz/services/samba

Samba Development and Support, Catalyst IT - Expert Open Source
Solutions




More information about the samba-technical mailing list