code duplication in ccan (was: Re: snprintf on SunOS)

Jelmer Vernooij jelmer at
Thu Jun 21 06:22:37 MDT 2012

On Mon, Jun 18, 2012 at 11:04:48AM +0930, Rusty Russell wrote:
> On Sat, 16 Jun 2012 10:28:46 +0200, Jelmer Vernooij <jelmer at> wrote:
> > Hi Rusty!

> Hi Jelmer!

> > > Because you'd have to maintain an ABI.  And that would stop us from
> > > fixing bugs or removing functions; you really don't want a bag of utils
> > > to be a shared library!

> > > Or we could keep changing the ABI, making it useless for anyone outside
> > > Samba anyway.
> > The problem is that in its current form, we already rely on the ccan
> > ABI not changing.

> > If you have an older version of tdb installed on your system which includes a
> > copy of ccan and you build a newer version of Samba, then you end up
> > with ABI incompatibilities.
> ?????!! WTF?

> No, this is *completely* wrong!

> Why do you think this?  How would that work?
ntdb ships a copy of ccan, which gets built as a shared library.

Samba also ships a copy of ccan, which also gets built as a
(different) shared library.

These don't necessarily have to from the same git commit; in fact,
they probably won't be. Since there is no stable ABI, there could be
differences in the ABIs for these two versions of the library.

ldb and samba will be loaded into the same process. If there have been
ABI changes in ccan you'll end up using the symbols from the wrong
ccan copy, which might expect different arguments, for example.

Of course, symbol versioning will help you on Linux, but not all
platforms support symbol versioning.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <>

More information about the samba-technical mailing list