Hi, I have cross compiled samba 3.3.8 for arm, which succeeded. However, the size of the resulting binaries is large (few MB's per binary) so the total installation of samba sums to over 50 megabytes, after stripping the binaries. For example, with samba 2.0.10, the size of smbd was 281 KB. With samba 3.3.8 that is 5.2 MB. Same goes for the other binaries. It looks as if there is a chunk of code included in every binary instead of using shared libs. How can I get the size of the binaries down? I included the configure options that I used below and some statistics. Thanks. ----------------------------------------- Options passed to configure ------------------------------------------- --localstatedir=/tmp --with-lockdir=/tmp --with-piddir=/tmp --with-logfilebase=/tmp --with-privatedir=/etc/samba --with-configdir=/etc/samba --disable-swat --disable-cups --disable-static --enable-shared --disable-pie --disable-relro --disable-fam --enable-shared-libs --disable-dnssd --disable-avahi --without-ldap --without-ads --without-cifsmount --without-cifsupcall --without-cluster-support --without-winbind --with-readline=$(STAGING_DIR) --with-libiconv=$(STAGING_DIR) --with-included-popt --with-included-iniparser ----------------------------------------- Size of binaries in usr/sbin: 7.6 MB ----------------------------------------- Wodan:[toolchain]:/tmp/root/usr/sbin$ ls -alh total 7.6M drwxr-xr-x 2 mmnet mmnet 4.0K 2009-10-10 19:14 . drwxr-xr-x 7 mmnet mmnet 4.0K 2009-10-10 19:14 .. -rwxr-xr-x 1 mmnet mmnet 2.1M 2009-10-10 19:14 nmbd -rwxr-xr-x 1 mmnet mmnet 5.5M 2009-10-10 19:14 smbd Wodan:[toolchain]:/tmp/root/usr/sbin$ arm-linux-ldd smbd checking sub-depends for '/home/mmnet/broot/buildroot/project_build_arm/mmnet/root/lib/libcrypt.so.0' checking sub-depends for '/home/mmnet/broot/buildroot/project_build_arm/mmnet/root/lib/libresolv.so.0' checking sub-depends for '/home/mmnet/broot/buildroot/project_build_arm/mmnet/root/lib/libdl.so.0' checking sub-depends for '/home/mmnet/broot/buildroot/project_build_arm/mmnet/root/usr/lib/libiconv.so.2' checking sub-depends for '/usr/lib/libtalloc.so.1' checking sub-depends for '/usr/lib/libtdb.so.1' checking sub-depends for '/home/mmnet/broot/buildroot/project_build_arm/mmnet/root/lib/libgcc_s.so.1' checking sub-depends for '/home/mmnet/broot/buildroot/project_build_arm/mmnet/root/lib/libc.so.0' checking sub-depends for '/lib/libc.so.6' libcrypt.so.0 => /home/mmnet/broot/buildroot/project_build_arm/mmnet/root/lib/libcrypt.so.0 (0x00000000) libresolv.so.0 => /home/mmnet/broot/buildroot/project_build_arm/mmnet/root/lib/libresolv.so.0 (0x00000000) libdl.so.0 => /home/mmnet/broot/buildroot/project_build_arm/mmnet/root/lib/libdl.so.0 (0x00000000) libiconv.so.2 => /home/mmnet/broot/buildroot/project_build_arm/mmnet/root/usr/lib/libiconv.so.2 (0x00000000) libtalloc.so.1 => /usr/lib/libtalloc.so.1 (0x00000000) libtdb.so.1 => /usr/lib/libtdb.so.1 (0x00000000) libgcc_s.so.1 => /home/mmnet/broot/buildroot/project_build_arm/mmnet/root/lib/libgcc_s.so.1 (0x00000000) libc.so.0 => /home/mmnet/broot/buildroot/project_build_arm/mmnet/root/lib/libc.so.0 (0x00000000) ----------------------------------------- Size of binaries in usr/bin: 46 MB ----------------------------------------- Wodan:[toolchain]:/tmp/root/usr/bin$ ls -alh total 46M drwxr-xr-x 2 mmnet mmnet 4.0K 2009-10-10 19:14 . drwxr-xr-x 7 mmnet mmnet 4.0K 2009-10-10 19:14 .. -rwxr-xr-x 1 mmnet mmnet 798K 2009-10-10 19:14 eventlogadm -rwxr-xr-x 1 mmnet mmnet 4.5K 2009-10-10 19:14 findsmb -rwxr-xr-x 1 mmnet mmnet 860K 2009-10-10 19:14 ldbadd -rwxr-xr-x 1 mmnet mmnet 860K 2009-10-10 19:14 ldbdel -rwxr-xr-x 1 mmnet mmnet 862K 2009-10-10 19:14 ldbedit -rwxr-xr-x 1 mmnet mmnet 860K 2009-10-10 19:14 ldbmodify -rwxr-xr-x 1 mmnet mmnet 860K 2009-10-10 19:14 ldbrename -rwxr-xr-x 1 mmnet mmnet 862K 2009-10-10 19:14 ldbsearch -rwxr-xr-x 1 mmnet mmnet 4.3M 2009-10-10 19:14 net -rwxr-xr-x 1 mmnet mmnet 845K 2009-10-10 19:14 nmblookup -rwxr-xr-x 1 mmnet mmnet 1.9M 2009-10-10 19:14 ntlm_auth -rwxr-xr-x 1 mmnet mmnet 1.1M 2009-10-10 19:14 pdbedit -rwxr-xr-x 1 mmnet mmnet 790K 2009-10-10 19:14 profiles -rwxr-xr-x 1 mmnet mmnet 3.9M 2009-10-10 19:14 rpcclient -rwxr-xr-x 1 mmnet mmnet 792K 2009-10-10 19:14 sharesec -rwxr-xr-x 1 mmnet mmnet 3.8M 2009-10-10 19:14 smbcacls -rwxr-xr-x 1 mmnet mmnet 3.7M 2009-10-10 19:14 smbclient -rwxr-xr-x 1 mmnet mmnet 860K 2009-10-10 19:14 smbcontrol -rwxr-xr-x 1 mmnet mmnet 3.7M 2009-10-10 19:14 smbcquotas -rwxr-xr-x 1 mmnet mmnet 3.8M 2009-10-10 19:14 smbget -rwxr-xr-x 1 mmnet mmnet 3.7M 2009-10-10 19:14 smbpasswd -rwxr-xr-x 1 mmnet mmnet 2.0M 2009-10-10 19:14 smbspool -rwxr-xr-x 1 mmnet mmnet 843K 2009-10-10 19:14 smbstatus -rwxr-xr-x 1 mmnet mmnet 4.8K 2009-10-10 19:14 smbtar -rwxr-xr-x 1 mmnet mmnet 3.6M 2009-10-10 19:14 smbtree -rwxr-xr-x 1 mmnet mmnet 30K 2009-10-10 19:14 tdbbackup -rwxr-xr-x 1 mmnet mmnet 29K 2009-10-10 19:14 tdbdump -rwxr-xr-x 1 mmnet mmnet 38K 2009-10-10 19:14 tdbtool -rwxr-xr-x 1 mmnet mmnet 793K 2009-10-10 19:14 testparm
On Saturday 10 October 2009 19:22:19 theHog wrote:> Hi, > > I have cross compiled samba 3.3.8 for arm, which succeeded. > > However, the size of the resulting binaries is large (few MB's per binary) > so the total installation of samba sums to over 50 megabytes, after > stripping the binaries.I've just started looking into Samba on ARM myself, and I can confirm that binaries are a bit large.> For example, with samba 2.0.10, the size of smbd was 281 KB. With samba > 3.3.8 that is 5.2 MB. Same goes for the other binaries. It looks as if > there is a chunk of code included in every binary instead of using shared > libs.Ouch, that's quite a drastic change. This might be due to linking objects into the binary multiple times, I think we had a similar problem in the Samba4 build. Unfortunately, tracking this is non-trivial. Right now I don't have any way to do that apart from looking at the Makefile for a long time. Thus, I don't have a solution for this right now. Sorry. If you happen to find a way to reduce the binary size, I'd be glad to hear about it. Cheers, Kai -- Kai Blin WorldForge developer http://www.worldforge.org/ Wine developer http://wiki.winehq.org/KaiBlin Samba team member http://www.samba.org/samba/team/ -- Will code for cotton. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part. URL: <http://lists.samba.org/pipermail/samba/attachments/20091010/85b6ce31/attachment.pgp>
On Sat, Oct 10, 2009 at 07:22:19PM +0200, theHog wrote:> I have cross compiled samba 3.3.8 for arm, which succeeded. > > However, the size of the resulting binaries is large (few MB's per binary) so > the total installation of samba sums to over 50 megabytes, after stripping the > binaries. > > For example, with samba 2.0.10, the size of smbd was 281 KB. With samba 3.3.8 > that is 5.2 MB. Same goes for the other binaries. It looks as if there is a > chunk of code included in every binary instead of using shared libs. > > How can I get the size of the binaries down? I included the configure options > that I used below and some statistics.Right now you can't. I've spent a good share of my weekend trying to trim that down. In particular the (much better and much more complete) auto-generated RPC marshalling hurts. It adds 3-4 MB to many binaries, which could be put into shared libs. It requires some heavy Makefile re-shuffling though, and this is always tedious work. Sorry for that, this problem is known but not exactly trivial to fix the way our code is structured right now. My current idea is to have .so's per RPC interface for the marshalling and the client/server stubs. This way you would be able to drop in new RPC interfaces without recompiling smbd. It would also be much simpler to add new RPC client routines as a .so. But as I always have to fight with our build system a bit, this is an effort of some (few) days. Volker -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: <http://lists.samba.org/pipermail/samba/attachments/20091011/17e12f26/attachment.pgp>