Cross compiling samba 4.1

Stefan (metze) Metzmacher metze at
Wed Jan 15 06:12:24 MST 2014

Hi Gustavo,

> Re-hashing an old thread here :)
> I'm, among other things, a buildroot developer.
> Good news is i've managed to get samba 4.1.3/4 cross-compiled and
> running just fine.


> Bad news is that my patchset isn't exactly clean but it's not too
> extensive either.
> So the question (there's always one isn't?) is if i should work on
> getting this integrated into the stable 4.1.x series or should i aim at 4.2?

I think the first target should be 'master' from there we can do
backports to
4.1 if want to.

> Most of the "big" patching regards:
> 1) python_LIBDIR & friends
> As Christophe said in the old thread we can't use the host python for
> basically anything useful as it is. At the moment i'm patching python
> 2.7.x to include a backport of python's 3.4 python-config script that's
> not python-based (shell based, pre-computed results), hence the results
> don't depend on a runtime python being runnable (like when cross-compiling).

Would it be possible to get real answers by calling python with the
emulator or get the result from the --cross-answers file?

> 2) Modify some tests
> Some of the test results aren't fetched from the answers cache.
> A couple of this seem to be doable with Execute=false, another one needs
> to be changed from conf.check to conf.CHECK_CODE to use the cache.

Sounds good.

> 3) Heimdal
> After some twiddling i managed to get a mixed solution for this.
> Since the tools are built for the target and they're needed to build the
> libraries i opted to build a host-variant in buildroot and make the
> samba build system use the external tools.
> It may be possible to avoid this using some CC_FOR_BUILD trickery.

In our old pre waf buildsystem we used to have a HOST_CC, with
we already have use_hostcc=True, but it's unused currently.

> The result is working on ARM & PowerPC at the moment - mostly what i
> generated an answers cache file for and the hardware i've got to test.
> If you think this way is ok i'll start sending cleaned-up patches.

Please do.

> Of course other proposed ways are welcome, i've got all the necessary
> bits to test the results :)

What we need a is a good description of how to reproduce your results,
can you update/extend the wiki articles on cross-compiling if needed?


More information about the samba-technical mailing list