[Pkg-samba-maint] Bug#971249: waf: CHECK_VALUEOF does not work during cross compilation

Michael Tokarev mjt at tls.msk.ru
Fri May 6 09:40:01 BST 2022


On Mon, 28 Sep 2020 06:53:03 +0200 Helmut Grohne <helmut at subdivi.de> wrote:
> Source: tevent
> Version: 0.10.2-1
> Tags: patch upstream
> User: debian-cross at lists.debian.org
> Usertags: ftcbfs
> 
> Thank you for applying my previous cross build patches. My previous
> installment ended with:
> 
> > 5. waf has a mandatory run test for determining whether mkstemp works.
> > 6. probably more
> 
> I've now looked into this and think that there are two bigger steps to
> solve these. In the "probably more" department, there is a recurring
> scheme of using a "CHECK_VALUEOF". It is used to determine the value of
> an integer. If that value happens to be a compile time constant, it can
> be determined using bisection. waf already does something similar in
> CHECK_SIZEOF. I've implemented it for CHECK_VALUEOF and it now works
> similar to autoconf's AC_COMPUTE_INT. In particular, it only does the
> expensive bisection during cross compilation. In a native build, it
> continues to use the quick run test it did before. I've attached a patch
> for this.

Umm. waf in samba is doing many "bad" things which can be done in a more
efficient way not requiring to run compiled binaries. Yes, sizeof(foo) is
a good example, valueof is another example.

I think it is too much work to patch all these things out in debian.
It might be a good idea to try to ping upstream about this, maybe they'll
include similar change(s) to make cross-compilations easier.  But probably
not in Debian.

I'd not spend more time on trying to make waf-based samba builds to be
cross-compilable, unless upstream is actually willing to accept the
work somehow. So far, it seems like upstream isn't willing even to
accept simple spelling fixes.

FWIW, Helmut, what do you think about using qemu-user[-static] to help
cross-compiling stuff? It should significantly help in situations like
this one, to be able to run the small test binaries in an emulated mode,
provided you do have the foreign libs installed on the system.  Yes it
is not the fastest, but for sizeof/valueof tests like this it will
Just Work, hopefully...

Thanks,

/mjt



More information about the Pkg-samba-maint mailing list