executable footprint reduction

David Wuertele dave-gnus at bfnet.com
Wed Feb 4 02:13:26 GMT 2004


Ken> FWIW, I've been doing in for about a year, but linking to dynamic
Ken> libraries is somewhat system-dependent (I'm on NetBSD).  For
Ken> instance, I've added this at the top of Makefile.in:

Ken>  LIBS=@LIBS@ -L bin -R $(DESTDIR)${prefix}/lib -lsmbclient

OK, I went ahead and tried this.  I'm not sure what the -R is for... I
replaced it with -L because that's what it looks like you are using it
as...

Things don't build in the right order with just this change, because
the executable targets don't depend on building
bin/libsmbclient.so... I'm not sure how you got around that, but what
I did was make everything that uses $(LIBS) depend explicitly on
bin/libsmbclient.so.  Then I had to replace the $(LIBS) on the
libsmbclient.so target action to get rid of the recursive reference.

Once all that was done and it all built, I compared sizes between the
stock build, your build, and my build:

  # wc -c */source/bin/smbclient
  1193648 samba-3.0.0-stock-Makefile/source/bin/smbclient
  1193624 samba-3.0.0-kencross-Makefile/source/bin/smbclient
   199814 samba-3.0.0-dave-Makefile/source/bin/smbclient

So it looks to me like your patch (or at least my mangling of your
patch) is insufficient with gcc-3.3.1, glibc-2.3.2, and linux.

If somebody knows a better way to patch the Makefile.in than the way I
posted earlier, please let me know.

Thanks,
Dave



More information about the samba-technical mailing list