It can be done...

Michael Felt michael at felt.demon.nl
Thu Aug 3 17:46:46 UTC 2017


On 01/08/2017 21:24, John P Janosik via samba-technical wrote:
>> On 01/08/2017 17:25, Michael Felt via samba-technical wrote:
>>> FYI: the blibpath on the smbd is: EXTENSIVE and inaccurate (relative)
>>>
>>> 0
>>> default/source4/lib/socket:default/source4/lib/http:default/
>> source4/libcli:default/libcli/nbt:default/source4/cluster:default/
>> source4/libcli/ldap:default/source4/auth:default/source4/libcli/
>> wbclient:default/source4/lib/messaging:default/nsswitch:default/
>> source4/lib/events:default/lib/tdb_wrap:default/source4/
>> librpc:default/libcli/smb:default/libcli/cldap:default/lib/
>> addns:default/auth/gensec:default/source4/auth/ntlm:default/
>> third_party/popt:default/libds/common:default/nsswitch/
>> libwbclient:default/auth/credentials:default/lib/ldb-samba:default/
>> lib/param:default/source4/auth/kerberos:default/libcli/ldap:default/
>> lib/ldb:default/libcli/registry:default/lib:default/lib/
>> krb5_wrap:default/lib/dbwrap:default/source3/auth:default/lib/
>> tdb:default/auth:default/lib/socket:default/libcli/auth:default/
>> libcli/named_pipe_auth:default/source4/dsdb:default/libcli/
>> security:default/libcli/util:default/librpc:default/source4/
>> heimdal_build:default/dfs_server:default/lib/tevent:default/lib/
>> replace:default/lib/talloc:default/source3:default/lib/util:/usr/
>> local/lib:/opt/lib:/usr/vac/lib:/usr/lib:/lib
>>> 1                                    libpthread.a shr_xpg5_64.o
>>> 2                                    libsamba-util.so
>>> 3                                    libsmbd-base-samba4.so
>>> ...
>>> 103                                  libcli-nbt-samba4.so
>>> 104                                  libsmbclient-raw-samba4.so
>>> 105                                  libhttp-samba4.so
>>> 106                                  libnetif-samba4.so
>>> 107                                  libnsl.a            shr_64.o
>>> 108                                  libc.a              shr_64.o
>>>
>>> I would hope there is a better way to install shared libraries!
>> Ok, reran config and changed prefix to /opt
>>
>> What I had not noticed before is that not only is the installed LIBPATH
>> (behind the 0) long and relative, the directories do not exist in the
>> installed area.
>>
>> After
>>
>> LIBPATH=/opt/lib:/opt/lib/auth:/opt/lib/bind9:/opt/lib/gensec:/opt/
>> lib/idmap:/opt/lib/ldb:/opt/lib/nss_info:/opt/lib/private:/opt/lib/
>> process_model:/opt/lib/python2.7/site-packages/samba:/opt/lib/
>> security:/opt/lib/service:/opt/lib/vfs
>>
>> export LIBPATH
>>
>> Now I get:
>>
>> root at x069:[/data/prj/samba/samba-4.4.15]ldd /opt/sbin/samba
>> /opt/sbin/samba needs:
>>            /usr/lib/libpthread.a(shr_xpg5_64.o)
>> Cannot find libldb.so
>>            /opt/lib/libsamba-hostconfig.so
>>            /opt/lib/private/libcluster-samba4.so
>>            /opt/lib/libsamba-credentials.so
>> Night Night!
>>
> Hi Michael -
>
> I don't know if is a correct fix, but since Samba switched from autoconf
> to waf I've been patching buildtools/wafsamba/samba_install.py with the
> following changes for building on AIX, line numbers based on the version
> of samba_install.py shipped with Samba 4.4.6, but the patch didn't change
> when I built with newer versions.  I haven't tried building any 4.7
>
> 1.  Modify the following code at line 121 - 128 so that the condition that
> does "dev_link     = bld.make_libname(target_name)" is run for all libs on
> AIX.
>
>                install_name = bld.make_libname(target_name,
> version=self.vnum)
>                install_link = bld.make_libname(target_name,
> version=vnum_base)
>                inst_name    = bld.make_libname(t.target)
>                if not self.private_library:
>                    # only generate the dev link for non-bundled libs
>                    dev_link     = bld.make_libname(target_name)
>            elif getattr(self, 'soname', ''):
>                install_name = bld.make_libname(target_name)
>
>
> 2.  Modify the following code at lines 330 - 336 so that the -bsrv4 option
> is included in the link flags, according the man page of ld on AIX the
> "-R" option is only supported when -bsrv4 is also passed.
>
>   
>        # check which compiler/linker flags are needed for rpath support
>        if not conf.CHECK_LDFLAGS(['-Wl,-rpath,.']) and
> conf.CHECK_LDFLAGS(['-Wl,-R,.']):
>           conf.env['RPATH_ST'] = '-Wl,-R,%s'
>   
>        # check for rpath
>        if conf.CHECK_LIBRARY_SUPPORT(rpath=True):
>
> When I build this way the resulting binaries work without setting LIBPATH,
> dump -H shows:
OK. working through waf code, trying to understand (as I cannot find any 
compareable example (only @classmethod and @staticmethod examples)) how 
to read, e.g.
@conf
def CHECK_LDFLAGS(conf, ldflags):
     '''check if the given ldflags are accepted by the linker
     '''
     return conf.check(fragment='int main(void) { return 0; }\n',
                       execute=0,
                       ldflags=ldflags,
                       mandatory=False,
                       msg="Checking linker accepts %s" % ldflags)


I think this is what is being called as conf.CHECK_LDFLAGS(arguments...)

Is this an additional "class" syntax, or just a way to make a pyhton 
'def' look like a class 'def'?

>
>> dump -H /PREFIX/sbin/smbd
> /PREFIX/sbin/smbd:
>
>                          ***Loader Section***
>                        Loader Header Information
> VERSION#         #SYMtableENT     #RELOCent        LENidSTR
> 0x00000001       0x00000130       0x000001c6       0x0000097d
>
> #IMPfilID        OFFidSTR         LENstrTBL        OFFstrTBL
> 0x00000067       0x000031e8       0x000015d1       0x00003b65
>
>
>                          ***Import File Strings***
> INDEX  PATH                          BASE                MEMBER
> 0      /PREFIX/lib/private:/PREFIX/lib:/usr/lib:/lib
> 1                                    libpthread.a        shr_xpg5.o
> 2                                    libsamba-util.so
> ...
> 100                                  libc.a              shr.o
> 101                                  librtl.a            shr.o
> 102    /                             unix
>
>
> John Janosik
> jpjanosi at us.ibm.com
>
>




More information about the samba-technical mailing list