Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Samba] how to build smbtorture using static linked libraries

340 views
Skip to first unread message

Shuo Dong

unread,
Oct 22, 2015, 1:40:03 AM10/22/15
to
Hello all:

I am trying to build smbtorture using static linked libraries.
The samba source code I have is samba-4.1.13

for configure, I did:

waf configure --builtin-libraries=ALL

for build, I did:
waf build --targets=smbtorture (so that it only build target smbtorture)

But, the waf build fails immediately.


Then, I tried to only link with lib talloc and tevent statically, so I did:

waf configure --builtin-libraries=talloc,tevent

and then do:
waf build --targets=smbtorture

But then build fails in the link step with an ld error of undefined reference to some function.

How can I resolve this issue, and build smbtorture with static linked libraries?


Thanks





Shuo Dong
Junior Embedded Developer
Iders Incorporated
27047 Oakwood Road
Oakbank, MB R0E 1J2
Tel: (204) 444-5200 ext
Fax: (204) 444-5900
[http://www.iders.ca/IDERS_logo.jpg]
________________________________
Iders Incorporated Confidential:
________________________________
This message is intended solely for the use of the designated recipient(s) and their appointed delegates, and may contain confidential information. Any unauthorized disclosure, copying or distribution of its contents is strictly prohibited. If you have received this message in error, please destroy it and advise the sender immediately by phone, Email or facsimile.
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba

Shuo Dong

unread,
Oct 22, 2015, 2:00:03 AM10/22/15
to
Hello all:

I am trying to build smbtorture using static linked libraries.
The samba source code I have is samba-4.1.13

for configure, I did:

waf configure --builtin-libraries=ALL

for build, I did:
waf build --targets=smbtorture (so that it only build target smbtorture)

But, the waf build fails immediately.


Then, I tried to only link with lib talloc and tevent statically, so I did:

waf configure --builtin-libraries=talloc,tevent

and then do:
waf build --targets=smbtorture

But then build fails in the link step with an ld error of undefined
reference to some function.

How can I resolve this issue, and build smbtorture with static linked
libraries?


Thanks

Herb Lewis

unread,
Oct 22, 2015, 12:50:05 PM10/22/15
to
This is working for me with the following configure option

--nonshared-binary=smbtorture

You also need to apply the following patch which is not yet in the sources

--- a/source4/torture/rpc/fsrvp.c
+++ b/source4/torture/rpc/fsrvp.c
@@ -41,7 +41,7 @@
#include "torture/torture.h"
#include "torture/smb2/proto.h"
#include "torture/rpc/torture_rpc.h"
-#include "librpc/gen_ndr/ndr_security.c"
+#include "librpc/gen_ndr/ndr_security.h"
#include "librpc/gen_ndr/ndr_srvsvc_c.h"
#include "librpc/gen_ndr/ndr_fsrvp_c.h"

Jeremy Allison

unread,
Oct 22, 2015, 7:10:04 PM10/22/15
to
On Thu, Oct 22, 2015 at 08:03:47AM -0700, Herb Lewis wrote:
> This is working for me with the following configure option
>
> --nonshared-binary=smbtorture
>
> You also need to apply the following patch which is not yet in the sources
>
> --- a/source4/torture/rpc/fsrvp.c
> +++ b/source4/torture/rpc/fsrvp.c
> @@ -41,7 +41,7 @@
> #include "torture/torture.h"
> #include "torture/smb2/proto.h"
> #include "torture/rpc/torture_rpc.h"
> -#include "librpc/gen_ndr/ndr_security.c"
> +#include "librpc/gen_ndr/ndr_security.h"
> #include "librpc/gen_ndr/ndr_srvsvc_c.h"
> #include "librpc/gen_ndr/ndr_fsrvp_c.h"

That got fixed in master here:

commit e8c602dfa2f08a9ea43c84a7e7ae9fe17e007d60
Author: Stefan Metzmacher <me...@samba.org>
Date: Wed Aug 12 09:24:42 2015 +0200

s4:torture/rpc: fix ndr_security.h include in fsrvp.c

We should not include ndr_security.c

This allows ./configure --nonshared-binary=smbtorture again.

Signed-off-by: Stefan Metzmacher <me...@samba.org>
Reviewed-by: Ralph Boehme <sl...@samba.org>

Autobuild-User(master): Ralph Böhme <sl...@samba.org>
Autobuild-Date(master): Mon Aug 17 20:53:10 CEST 2015 on sn-devel-104

Log a bug if you want it back-ported to release
branch.

Andrew Bartlett

unread,
Oct 26, 2015, 3:20:03 AM10/26/15
to
On Thu, 2015-10-22 at 05:21 +0000, Shuo Dong wrote:
> Hello all:
>
> I am trying to build smbtorture using static linked libraries.
> The samba source code I have is samba-4.1.13
>
> for configure, I did:
>
> waf configure --builtin-libraries=ALL
>
> for build, I did:
> waf build --targets=smbtorture (so that it only build target
> smbtorture)
>
> But, the waf build fails immediately.
>
>
> Then, I tried to only link with lib talloc and tevent statically, so
> I did:
>
> waf configure --builtin-libraries=talloc,tevent
>
> and then do:
> waf build --targets=smbtorture
>
> But then build fails in the link step with an ld error of undefined
> reference to some function.
>
> How can I resolve this issue, and build smbtorture with static linked
> libraries?
>

Use Samba 4.3 and see the recipe in script/autobuild.py:

--bundled-libraries=talloc,tdb,pytdb,ldb,pyldb,tevent,pytevent --with
-static-modules=ALL --nonshared-binary=smbtorture,smbd/smbd

Andrew Barteltt

--
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba
0 new messages