building smbtorture nonshared

Uri Simchoni urisimchoni at gmail.com
Sat Aug 1 17:53:06 UTC 2015


I have no experience with static build but may offer some pointers to
ease working with the shared build.
The problem of using shared libs can be split into two parts:
1. Enumerating all of them - with samba this can be tedious as the
samba4 process splits the binaries into LOTS of shared libs.
2. Putting them on a remote machine in some non-standard isolated
location and causing the executable to find them

For the first problem, I came up with the attached script to print all
the samba shared libraries needed by a set of samba executables
(repeatedly scanning found shared libs until a closed set is reached).
I then use the output to copy the shared libs. I suppose that for the
second problem you can use either the configure --prefix, along with
rpath, or use LD_LIBRARY_PATH.

A typical way I copy the files using this script is: (built with
prefix = /, copying smbd, winbindd, and net along with their shared
libs)
DESTDIR=/my/samba/staging/dir make install
find_samba_libs.py /my/samba/staging/dir sbin/smbd sbin/winbindd
bin/net | rsync -lt --files-from - /my/samba/staging/dir/
/my/real/dest/dir

The staging dir does not contain other binaries, so for example
libc.so is not listed by the script because it is not found in the
staging dir.

I hope you find this useful,
Uri.

On Sat, Aug 1, 2015 at 12:53 AM, Jeremy Allison <jra at samba.org> wrote:
> On Fri, Jul 31, 2015 at 01:56:14PM -0700, Herb Lewis wrote:
>> Using samba-4.2.3 sources:
>>
>> I'm trying to build a version of smbtorture that is non-shared so I don't
>> have to copy a bunch of libraries to the machine that is going to be
>> running it. I saw the --nonshared-binary option for configure but when
>> I added that to my configure command and then run "make smbtorture"
>> it fails with a bunch of "multiple definition" errors for example:
>>
>> default/librpc/gen_ndr/ndr_security_49.o: In function
>> `ndr_print_se_privilege':
>> ndr_security.c:(.text+0x97): multiple definition of `ndr_print_se_privilege'
>> default/source4/torture/rpc/fsrvp_8.o:fsrvp.c:(.text+0x97): first
>> defined here
>> default/librpc/gen_ndr/ndr_security_49.o: In function
>> `ndr_print_lsa_SystemAccessModeFlags':
>> ndr_security.c:(.text+0x52f): multiple definition of
>> `ndr_print_lsa_SystemAccessModeFlags'
>> default/source4/torture/rpc/fsrvp_8.o:fsrvp.c:(.text+0x52f): first
>> defined here
>>
>> Is this supposed to work? Has anyone ever tried it before?
>
> My guess is this is a not commonly tested build option.
>
> You might be the first to get to fix it :-).
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: find_samba_libs.py
Type: application/octet-stream
Size: 1855 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150801/43539492/find_samba_libs.obj>


More information about the samba-technical mailing list