[PATCH] Just another round of random cleanups
martin at meltin.net
Thu Sep 18 03:51:13 MDT 2014
On Thu, 18 Sep 2014 17:21:07 +1000, Martin Schwenke <martin at meltin.net>
> On Thu, 18 Sep 2014 07:04:33 +0200, Volker Lendecke
> <Volker.Lendecke at SerNet.DE> wrote:
> > On Thu, Sep 18, 2014 at 01:58:34PM +1000, Martin Schwenke wrote:
> > > On Thu, 18 Sep 2014 13:51:18 +1000, Martin Schwenke <martin at meltin.net>
> > > wrote:
> > >
> > > > I think that when a library depends on a subsystem, then the library
> > > > ends up including the objects for that subsystem. So, I suppose
> > > > that tdb-wrap, samba-util and errors all contain samba-debug.
> > >
> > > martins at rover:~/samba/samba (merge)$ nm bin/default/lib/util/libsamba-util.so | grep check_log_size
> > > 000105f4 T check_log_size
> > > 0001056b T force_check_log_size
> > > 0001059c T need_to_check_log_size
> > > martins at rover:~/samba/samba (merge)$ nm bin/default/lib/tdb_wrap/libtdb-wrap.so | grep check_log_size
> > > 00002836 T check_log_size
> > > 000027ad T force_check_log_size
> > > 000027de T need_to_check_log_size
> > > martins at rover:~/samba/samba (merge)$ nm bin/default/libcli/util/liberrors.so | grep check_log_size
> > > 00019afa T check_log_size
> > > 00019a71 T force_check_log_size
> > > 00019aa2 T need_to_check_log_size
> > >
> > > There it is! So, either there is a way around this or it isn't a
> > > problem... ;-)
> > They way around it might be making samba-debug a library.
> > But that sounds weird to me.
> Yeah, I think we're going to have to do that. Hopefully if samba-util
> is a public library and samba-debug is a private library, then the
> correct waf-fu will happen so that users like OpenChange won't have any
> issues. However, Alexander said this one IRC:
> <schwenke> ab: if one of the libraries is a public library then the
> dep library needs to be public too?
> <ab> schwenke: not really, at least from technical perspective --
> you can have rpath hardcoded to point to private
> library. I'm not sure whether waf handles that though
> I guess we can try it...
OK, if you configure like this:
./configure --enable-developer --dup-symbol-check
and build, then
looks like it does the symbol checking. I wish I could figure out how
it does that and whether there is a more direct way of invoking the
check. Sadly, I can't seem to figure out how "make test" works... :-(
If I make samba-debug a private library then we hit the next hurdle:
[4071/4194] symbol duplicate checking:
Waf: Leaving directory `/home/martins/samba/samba/bin'
Build failed: default/source3/lib/netapi/examples/localgroup/localgroup_setinfo: Symbol set_blocking linked in multiple libraries ['samba-util', 'smb_transport']
So, it looks like we need to create a new (private) library every time
we try to break something out so that it can be used as a fine-grained
dependency for more than one thing.
We probably need to check if all the right linker magic happens so that
binaries linked to the public samba-util can find the private libraries
too. It looks like at least some of that magic is there:
$ ldd bin/default/lib/util/libsamba-util.so
libpthread.so.0 => /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 (0xf7756000)
libsamba-debug.so => /home/martins/samba/samba/bin/shared/private/libsamba-debug.so (0xf7750000)
I'm happy to do convert subsystems into private libraries... but I'd
like to hear opinions from people with a better understanding of the
build system before I start down this road.
peace & happiness,
More information about the samba-technical