pranav desai
2013-May-31 18:05 UTC
[Samba] Cross Compiling Samba 4.0.6 for ARM increases size of binaries
Hi,
I have cross-compiled just the basic samba 4.0.6 using bitbake recipe
for ARM, which succeeded.
However the resulting binaries are large in size. I used the exact
same configuration options in both the cases.
There is at least a 10 fold increase in the smbd compared to native x86.
--- Native x86 ----
-rwxr-xr-x 1 pranavd users 92979 May 31 10:57 /usr/sbin/smbd
-rwxr-xr-x 1 pranavd users 351196 May 31 10:57 /usr/sbin/nmbd
--- Cross Compiled ----
-rwxr-xr-x 2 pranavd users 9624696 May 30 18:11
/work/armv7a-vfp-neon-oe-linux-gnueabi/samba-4.0.6-r8/packages-split/samba/usr/sbin/smbd
-rwxr-xr-x 2 pranavd users 6020020 May 30 18:11
/work/armv7a-vfp-neon-oe-linux-gnueabi/samba-4.0.6-r8/packages-split/samba/usr/sbin/nmbd
Can someone please suggest me how to reduce the size of the binaries?
I have included the configuration options used.
Regards,
Pranav
Here are the configuration options I used in my bb recipe.
--build=x86_64-linux
--host=arm-oe-linux-gnueabi
--target=arm-oe-linux-gnueabi
--prefix=/usr
--exec_prefix=/usr
--bindir=/usr/bin
--sbindir=/usr/sbin
--libexecdir=/usr/libexec
--datadir=/usr/share
--sysconfdir=/etc
--sharedstatedir=/com
--localstatedir=/var
--libdir=/usr/lib
--includedir=/usr/include
--oldincludedir=/usr/include
--infodir=/usr/share/info
--mandir=/usr/share/man
--disable-silent-rules
--disable-dependency-tracking
--with-libtool-sysroot=/local/mnt/workspace/9x25/AU_753_samba_cfg/oe-core/build/tmp-eglibc/sysroots/mdm9625
--disable-cups
--with-readline=/local/mnt/workspace/9x25/AU_753_samba_cfg/oe-core/build/tmp-eglibc/sysroots/mdm9625/usr/lib/..
--with-libiconv=/local/mnt/workspace/9x25/AU_753_samba_cfg/oe-core/build/tmp-eglibc/sysroots/mdm9625/usr/lib/..
--without-automount
--with-configdir=/etc/samba
--with-privatedir=/etc/samba/private
--with-lockdir=/var/lock
--with-piddir=/var/run
--with-logfilebase=/var/log
--with-libdir=/usr/lib
--with-mandir=/usr/share/man
--with-swatdir=/usr/share/swat
--with-aio-support
--without-libtalloc
--without-acl-support
--disable-avahi
--without-winbind
--without-swat
--without-ads
--without-ldap
--disable-iprint
--without-pam
--without-utmp
--without-acl-support
--without-syslog
--without-dnsupdate
--without-profiling-data
--without-cluster-support
--without-ad-dc
--disable-ntdb
--enable-fhs
samba_cv_struct_timespec=yes
libreplace_cv_HAVE_MMAP=yes
--enable-nss-wrapper
--without-ads
--without-ldap
--without-krb5
ac_cv_path_PYTHON=/not/exist
ac_cv_path_PYTHON_CONFIG=/not/exist
SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes
samba_cv_CC_NEGATIVE_ENUM_VALUES=yes
linux_getgrouplist_ok=no
samba_cv_HAVE_BROKEN_GETGROUPS=no
samba_cv_HAVE_FTRUNCATE_EXTEND=yes
samba_cv_have_setresuid=yes
samba_cv_have_setresgid=yes
samba_cv_linux_getgrouplist_ok=yes
samba_cv_struct_timespec=yes
samba_cv_big_endian=no
samba_cv_little_endian=yes
libreplace_cv_HAVE_GETADDRINFO=no
samba_cv_HAVE_WRFILE_KEYTAB=no
smb_krb5_cv_enctype_to_string_takes_krb5_context_arg=no
smb_krb5_cv_enctype_to_string_takes_size_t_arg=no
ac_cv_file__proc_sys_kernel_core_pattern=yes
samba_cv_SIZEOF_BLKCNT_T_8=yes
Andrew Bartlett
2013-Jun-05 13:42 UTC
[Samba] Cross Compiling Samba 4.0.6 for ARM increases size of binaries
On Fri, 2013-05-31 at 11:05 -0700, pranav desai wrote:> Hi, > > I have cross-compiled just the basic samba 4.0.6 using bitbake recipe > for ARM, which succeeded. > > However the resulting binaries are large in size. I used the exact > same configuration options in both the cases. > There is at least a 10 fold increase in the smbd compared to native x86. > > --- Native x86 ---- > -rwxr-xr-x 1 pranavd users 92979 May 31 10:57 /usr/sbin/smbd > -rwxr-xr-x 1 pranavd users 351196 May 31 10:57 /usr/sbin/nmbd > > > --- Cross Compiled ---- > -rwxr-xr-x 2 pranavd users 9624696 May 30 18:11 > /work/armv7a-vfp-neon-oe-linux-gnueabi/samba-4.0.6-r8/packages-split/samba/usr/sbin/smbd > -rwxr-xr-x 2 pranavd users 6020020 May 30 18:11 > /work/armv7a-vfp-neon-oe-linux-gnueabi/samba-4.0.6-r8/packages-split/samba/usr/sbin/nmbd > > Can someone please suggest me how to reduce the size of the binaries? > I have included the configuration options used.The reason is that your native build uses our waf build, but the cross-compile uses our autoconf build, which statically links all the required code into each binary. Sadly there is still a little work to be done to finish cross-compile support in our waf build - it mostly needs an interested developer to take on injecting the remote python version and flags into the system, rather than these from inside the python that is running the build. Other than that, the build system was built to do this, but it just hasn't been finished, and most cross-compile recipes remain for autoconf, because that is what all the hand-tuning was done for. Note that the autoconf build is fully supported for Samba 4.0, but won't be included in Samba 4.1. Andrew Bartlett -- Andrew Bartlett http://samba.org/~abartlet/ Authentication Developer, Samba Team http://samba.org
Possibly Parallel Threads
- [LLVMdev] how to build eglibc using llvm-gcc without unsupported -fno-toplevel-reorder
- Bug#701445: xcp-vncterm: ftbfs with eglibc-2.17
- [LLVMdev] how to build eglibc using llvm-gcc without unsupported -fno-toplevel-reorder
- [LLVMdev] how to build eglibc using llvm-gcc without unsupported -fno-toplevel-reorder
- [LLVMdev] [lld][PECOFF] assert from lld once in 5 test runs.