[Samba] Cross Compiling Samba 4.0.6 for ARM increases size of binaries

pranav desai pndesai2 at gmail.com
Mon Jun 10 11:42:28 MDT 2013


Thanks Andrew for the reply.

Do we have a TODO list need to support cross compilation using the waf
build system?
I can try and hack around the build system.

The WAF build system generates a cache file (default.cache.py) which
has all the variables needed to configure
 the waf system.
Is it possible to modify or inject our own variables by modifying the
file and ensuring the waf uses the cached values?
Also can we expose more variables need for cross-compilation via a
'cross-answers' file?
What would be a good approach to resolve this; I can perform some
experiments and upload the code to be reviewed if all works well.

-Pranav


On Wed, Jun 5, 2013 at 6:42 AM, Andrew Bartlett <abartlet at samba.org> wrote:
> 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
>
>


More information about the samba mailing list