Here is a new source3/Makefile.in that creates a large libsmbclient.so that is then shared by all tools and test programs. This reduces the binary sizes by 90% and removes several the hacks like libballofmud. It also improves build times considerably The goal is to get samba 3.6.1 working well on NAS devices and is a critical first step. I contributed this patch to openwrt.org and which allows it to run on 32MB systems. More work is required to chop it down to smaller routers, but this Makefile is useful for large Linux distros as well that want to ship more client programs libnetapi must be static after this, but its files are only used by net and smbd so it is not very useful
Created attachment 7148 [details] cleaned up Makefile.in for shared library and consistent formatting Significant diffs for code formatting consistency and library dependencies
Thanks a lot! Looking.... Volker
How exactly do you compile this? A normal ./autogen.sh; ./configure; make leaves undefined symbols for me. This is on a SLES11.
Please skip the 1st Makefile.in and use the 2nd. It had a few issues when I went back to build on Ubuntu. I also did quite a bit more cleanup and size reduction Also, there needs to be 2 changes to both configure and configure.in 1) comment out or remove the static linkage for libsmbclient # WORKAROUND: # until we have organized other internal subsystems (as util, registry # and smbconf) into shared libraries, we CAN NOT link libnetapi # dynamically to samba programs. # LINK_LIBNETAPI=STATIC # LINK_LIBSMBCLIENT=STATIC 2) remove POPTLIBS objects when using included popt so they can be shared if test x"$INCLUDED_POPT" = x"yes"; then AC_MSG_RESULT(yes) BUILD_POPT='$(POPT_OBJ)' POPTLIBS="" FLAGS1="-I\$(srcdir)/../lib/popt" else AC_MSG_RESULT(no) BUILD_POPT="" POPTLIBS="-lpopt" fi
Created attachment 7150 [details] smaller patch with build fix for Linux
Looks like we noticed the problem at the same time. The second patch and change to configure/configure.in should resolve the linkage problems
libsmbclient.so should probably also have its revision bumped to 1 in configure.in since this is such a big change The only cleaner solution to having everything in libsmbclient.so would be to create a new libsamba.so that everything, including the other .so files depend on, but that is another big set of changes and forces changes to packaging scripts in various distributions oustide samba.org control
no smbd is crashing - I'll have to look into which change before the two Makefiles broke things - some symbol override issue is most likely
Created attachment 7151 [details] Fix for Linux link errors and further size reduction false alarm - I needed to do a completely clean build. This Makefile.in along with the configure.in change should be enough. Please include the top lines of any link failures if it does not work for you
Created attachment 7152 [details] Link failures. Here are the link failures I get. It's very close though - please keep working on it !
Created attachment 7153 [details] fixes for smbd crash and incorrect LDFLAGS A few different issues 1) are you sure you commented out "LINK_LIBSMBCLIENT=STATIC" in configure.in (and configure if you don't re-run autogen.sh). Your link errors are caused by linking with libsmbclient.a which should only happen if that line (and the one to remove POPTLIBS) are still there - otherwise everything would link with libsmbclient.so 2) I found that LDFLAGS is incorrectly including @PIE_LDFLAGS@ in original source. This prevents gdb from debugging correctly (prints an error on Debian) because an executable (non library) should not be linked with -pic 3) my crash was caused by having a few more duplicate .o files in both libsmbclient.so and smbd which caused duplicate static data to remain unitialized in one or the other This Makefile.in should fix the remaining dups as well as a couple errors linking test programs