It can be done...

Michael Felt michael at felt.demon.nl
Wed Aug 2 07:08:17 UTC 2017


On 01/08/2017 21:24, John P Janosik via samba-technical wrote:
> Hi Michael -
a) Thanks John - will try your patch next.
b) tried:
# project samba configured on Tue Aug  1 18:58:29 2017 by
# waf 1.5.19 (abi 7, python 2070cf0 on aix5)
# using ./buildtools/bin/waf configure --without-ldap --without-ads 
--prefix=/opt/samba --with-static-modules=ALL
#
But do not see any effect by the '--with-static-modules=ALL' as I still 
see nearly 100 shared libraries that need dlopen() calls.

Is this also something different since 'waf'?

>
> 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:
>
>> 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
> 3                                    libsmbd-base-samba4.so




More information about the samba-technical mailing list