Q: RUNPATH missing in libsmbldap.so but not other executables/libraries?

Alexander Bokovoy ab at samba.org
Fri May 20 11:20:33 UTC 2022


On pe, 20 touko 2022, Michael Tokarev wrote:
> 19.05.2022 23:15, Michael Tokarev via samba-technical wrote:
> ..
> > ....  Maybe there can
> > be some automated way to detect these things. Again, maybe wafsamba
> > can help there.
> 
> Actually it should stop listing all dependencies of dependencies in
> the link command when using shared libraries. Only static libs needs
> their dependencies in the linker command line, not the shared libs.
> This way the deps will be much more accurate because it will be
> obvious when the dep becomes missing.
> 
> At the same time it should be possible to fix the random order of
> the link-line arguments too.
> 
> Alexander, do you know maybe just a little bit how wafsamba works?
> In particular, where does it expand dependencies recursively, and
> how to tell it to stop the recursion if the given dependency is
> a shared library?

See buildtools/wafsamba/samba_deps.py for build_dependencies(),
expand_subsystem_deps(), build_direct_deps(). They are called in
buildtools/wafsamba/samba_deps.py:check_project_rules() among with other
generators and sets up attributes on the targets to build.

There are enough debug() statements there so that if you'd run waf in
debug mode, you'll see their output:

 MAKEFLAGS=V=3 PYTHONHASHSEED=1 WAF_MAKE=1 python buildtools/bin/waf

I'd recommend redirect this output somewhere and process it separately.

Unfortunately, it is currently broken due to how test for spotlight
integration is implemented: it links directly es_parser which is
autogenerated and is also linked by the mdssvc RPC binary. This means
there are two places which implicitly create es_parser.tab.c file:

* Node /src/samba/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c is created more than once. The task generators are:
  File '/src/samba/./buildtools/bin/waf', line 166, in <module>

Additionally, you should not use configure.developer as that will break
WAF in V=3.

Anyway, you'd get something like this:

$ grep 'target smbldap' samba.log
14:13:03 deps target smbldaphelper.objlist: does not require builtin dependencies...
14:13:03 deps target smbldaphelper: does not require builtin dependencies...
14:13:03 deps target smbldap.objlist: does not require builtin dependencies...
14:13:03 deps target smbldap.objlist: keep SYSLIB dependency ldap
14:13:03 deps target smbldap.objlist: keep SYSLIB dependency lber
14:13:03 deps target smbldap: does not require builtin dependencies...
14:13:03 deps target smbldap: keep SYSLIB dependency ldap
14:13:03 deps target smbldap: keep SYSLIB dependency lber
14:13:03 deps Expanded target smbldaphelper.objlist includes of type SUBSYSTEM from loop ldbsamba by {'ldbsamba.objlist', 'SAMDB_SCHEMA'}
14:13:03 deps Expanded target smbldaphelper includes of type LIBRARY from loop ldbsamba by {'ldbsamba.objlist', 'SAMDB_SCHEMA'}
14:13:03 deps computed dependencies for target smbldaphelper: uselib=['ldap', 'lber'] uselib_local=['smbldap', 'secrets3'] add_objects=['smbldaphelper.objlist']
14:13:03 deps computed dependencies for target smbldap: uselib=['ldap', 'lber', 'cap', 'talloc'] uselib_local=['samba-util', 'smbconf'] add_objects=['smbldap.objlist']
14:13:04 deps includes for target smbldaphelper.objlist: includes=['#source3', '#source3/include', '#source3/lib', '#third_party/heimdal/lib/com_err', '#third_party/heimdal/lib/base', '#third_party/heimdal/lib/krb5', '#third_party/heimdal/lib/gssapi/gssapi', '#third_party/heimdal_build/include', '#bin/default/third_party/heimdal/lib/asn1', '#lib/tevent', '#include/public', '#source4', '#lib', '#source4/lib', '#source4/include', '#include', '#lib/replace', '#', '#librpc', '#libcli/registry', '#third_party/heimdal/lib/asn1', '#third_party/heimdal_build', '#source3/param', '#lib/util/home/abokovoy/src/samba/third_party/gpfs', '#libcli/auth', '#lib/messaging', '#lib/dbwrap', '#source4/auth/kerberos', '#libcli/security', '#third_party/heimdal/lib/wind', '#third_party/heimdal/lib/roken', '#third_party/heimdal/include', '#lib/pthreadpool', '#dynconfig', '#auth/credentials', '#lib/param', '#third_party/heimdal/lib/hx509', '#third_party/heimdal/lib/hcrypto', '#third_party/heimdal/lib', '#libcli/lsarpc', '#source4/lib/socket', '#libcli/util', '#source4/lib/messaging', '#third_party/heimdal/lib/ipc', '#lib/socket', '#lib/crypto', '#source4/dsdb', '#source4/lib/tls', '#libds/common', '#source4/libcli', '#source3/librpc', '#lib/krb5_wrap', '#lib/ldb-samba', '#third_party/heimdal/lib/gssapi/spnego', '#third_party/heimdal/lib/gssapi/krb5', '#third_party/heimdal/lib/gssapi/mech', '#third_party/heimdal/lib/ntlm', '#source4/lib/events', '#libcli/ldap', '#lib/smbconf', '#lib/ldb/include', '#lib/ldb', '#third_party/heimdal/lib/gssapi', '#auth', '#lib/util/charset', '#source4/cluster', '#auth/kerberos', '#source4/lib/stream', '#source4/param', '#lib/tsocket', '#libcli/nbt', '#lib/audit_logging', '#lib/compression', '#lib/async_req', '#third_party/heimdal/lib/hcrypto/libtommath']
14:13:04 deps includes for target smbldaphelper: includes=['#source3', '#source3/include', '#source3/lib', '#third_party/heimdal/lib/com_err', '#third_party/heimdal/lib/base', '#third_party/heimdal/lib/krb5', '#third_party/heimdal/lib/gssapi/gssapi', '#third_party/heimdal_build/include', '#bin/default/third_party/heimdal/lib/asn1', '#lib/tevent', '#include/public', '#source4', '#lib', '#source4/lib', '#source4/include', '#include', '#lib/replace', '#', '#librpc', '#libcli/registry', '#third_party/heimdal/lib/asn1', '#third_party/heimdal_build', '#source3/param', '#lib/util/home/abokovoy/src/samba/third_party/gpfs', '#libcli/auth', '#lib/messaging', '#lib/dbwrap', '#source4/auth/kerberos', '#libcli/security', '#third_party/heimdal/lib/wind', '#third_party/heimdal/lib/roken', '#third_party/heimdal/include', '#lib/pthreadpool', '#dynconfig', '#auth/credentials', '#lib/param', '#third_party/heimdal/lib/hx509', '#third_party/heimdal/lib/hcrypto', '#third_party/heimdal/lib', '#libcli/lsarpc', '#source4/lib/socket', '#libcli/util', '#source4/lib/messaging', '#third_party/heimdal/lib/ipc', '#lib/socket', '#lib/crypto', '#source4/dsdb', '#source4/lib/tls', '#libds/common', '#source4/libcli', '#source3/librpc', '#lib/krb5_wrap', '#lib/ldb-samba', '#third_party/heimdal/lib/gssapi/spnego', '#third_party/heimdal/lib/gssapi/krb5', '#third_party/heimdal/lib/gssapi/mech', '#third_party/heimdal/lib/ntlm', '#source4/lib/events', '#libcli/ldap', '#lib/smbconf', '#lib/ldb/include', '#lib/ldb', '#third_party/heimdal/lib/gssapi', '#auth', '#lib/util/charset', '#source4/cluster', '#auth/kerberos', '#source4/lib/stream', '#source4/param', '#lib/tsocket', '#libcli/nbt', '#lib/audit_logging', '#lib/compression', '#lib/async_req', '#third_party/heimdal/lib/hcrypto/libtommath']
14:13:04 deps includes for target smbldap.objlist: includes=['#source3', '#source3/include', '#source3/lib', '#third_party/heimdal/lib/com_err', '#third_party/heimdal/lib/base', '#third_party/heimdal/lib/krb5', '#third_party/heimdal/lib/gssapi/gssapi', '#third_party/heimdal_build/include', '#bin/default/third_party/heimdal/lib/asn1', '#lib/tevent', '#include/public', '#source4', '#lib', '#source4/lib', '#source4/include', '#include', '#lib/replace', '#', '#librpc', '#libcli/registry', '#source3/param', '#lib/util/home/abokovoy/src/samba/third_party/gpfs', '#lib/messaging', '#lib/dbwrap', '#libcli/security', '#lib/pthreadpool', '#third_party/heimdal/lib/roken', '#third_party/heimdal/include', '#third_party/heimdal_build', '#dynconfig', '#lib/param', '#source4/lib/socket', '#libcli/util', '#lib/socket', '#lib/crypto', '#source4/libcli', '#source4/lib/events', '#lib/smbconf', '#lib/util/charset', '#lib/tsocket', '#libcli/nbt', '#lib/async_req']
14:13:04 deps includes for target smbldap: includes=['#source3', '#source3/include', '#source3/lib', '#third_party/heimdal/lib/com_err', '#third_party/heimdal/lib/base', '#third_party/heimdal/lib/krb5', '#third_party/heimdal/lib/gssapi/gssapi', '#third_party/heimdal_build/include', '#bin/default/third_party/heimdal/lib/asn1', '#lib/tevent', '#include/public', '#source4', '#lib', '#source4/lib', '#source4/include', '#include', '#lib/replace', '#', '#librpc', '#libcli/registry', '#source3/param', '#lib/util/home/abokovoy/src/samba/third_party/gpfs', '#lib/messaging', '#lib/dbwrap', '#libcli/security', '#lib/pthreadpool', '#third_party/heimdal/lib/roken', '#third_party/heimdal/include', '#third_party/heimdal_build', '#dynconfig', '#lib/param', '#source4/lib/socket', '#libcli/util', '#lib/socket', '#lib/crypto', '#source4/libcli', '#source4/lib/events', '#lib/smbconf', '#lib/util/charset', '#lib/tsocket', '#libcli/nbt', '#lib/async_req']
14:13:06 deps final dependencies for target smbldaphelper.objlist: uselib=['LDAP', 'LBER', 'CAP', 'TALLOC', 'TDB'] uselib_local=[] add_objects=[]
14:13:06 deps final dependencies for target smbldaphelper: uselib=['LDAP', 'LBER'] uselib_local=['smbldap', 'secrets3'] add_objects=['smbldaphelper.objlist']
14:13:06 deps final dependencies for target smbldap.objlist: uselib=['CAP', 'TALLOC', 'LDAP', 'LBER', 'ICUI18N', 'LIBUNWIND', 'SYSTEMD', 'ICUDATA', 'GNUTLS', 'ICUUC', 'TDB', 'CUPS', 'Z'] uselib_local=[] add_objects=[]
14:13:06 deps final dependencies for target smbldap: uselib=['LDAP', 'LBER', 'CAP', 'TALLOC'] uselib_local=['samba-util', 'smbconf'] add_objects=['smbldap.objlist']


-- 
/ Alexander Bokovoy



More information about the samba-technical mailing list