python linking hack

Jelmer Vernooij jelmer at samba.org
Wed Oct 7 16:59:39 MDT 2009


Hi Tridge,

On Wed, Oct 07, 2009 at 02:45:30PM +1100, tridge at samba.org wrote:
>  > I've converted the build system to Python, have added tests for it and
>  > have been doing some crazy refactoring. So far I've gotten the size of
>  > bin/ down to 440 Mb and the overhead of the makefile generator is now
>  > less than a second (down from 3 or 4 here locally) but there is still
>  > more to be fixed.
> That's a little more of a radical than I expected :-)
Sorry :-) I've been pondering this for quite a while and your email
was the final drop that flooded the bucket (apologies if that proverb
doesn't translate well).

> In case it helps, I did a little more hackish work in my linking-wip
> branch, and got bin/ down to about 240M, most of which is
> bin/mergedobj/ and bin/shared/, which don't actually have to be
> included in Samba packages.
Thanks! I'll have a look.

> What basic linking approach are you thinking of adopting? I used a
> "one big shared lib" approach for my experiments, which works quite
> well I think, but it means the binaries need re-linking on install. Is
> that what you are looking at using?
I'm trying to avoid using a different approach for the local build as
for the installation as it makes things harder to debug, and it would
just mean I have the same problem to fix, but as Debian packager rather than
as Samba developer. :-)

I'm basically trying to put everything in multiple smaller libraries
rather than one big one. That's more work though, as it means we have
to eliminate cycles in the dependency graph.

> I think we also need to make sure we fix the other symptom of our poor
> linking, which is data being duplicated. The most obvious example of
> this is things like having DEBUGLEVEL appear more than once in a
> binary, so setting the debug level in one bit of C doesn't necessarily
> set it in another bit of C. 
This is covered in my approach - the only instance of DEBUGLEVEL is in
libsamba-util.so.

I've also looked at making the build system stricter, basically
making it impossible (or perhaps just hard) to include the same object file 
in multiple libraries as that's almost always wrong. 

I might just steal your idea for the short term and then gradually
introduce more smaller libs.

Cheers,

Jelmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20091008/44deb02c/attachment.pgp>


More information about the samba-technical mailing list