On Fri, 2022-05-06 at 11:40 +0300, Michael Tokarev wrote: > On Mon, 28 Sep 2020 06:53:03 +0200 Helmut Grohne <hel...@subdivi.de> > wrote: > > Source: tevent > > Version: 0.10.2-1 > > Tags: patch upstream > > User: debian-cr...@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.
Samba regularly accepts changes to improve cross-compilation. We test a lame cross-compilation mode in our autobuild and would love to have both an improved test (that is more realistic) and any improvements our user community can find. > 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. We regularly accept patches that are correctly signed off and submitted to GitLab per https://wiki.samba.org/index.php/Contribute > 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... This would seem to be the best route forward, per: https://wiki.samba.org/index.php/Waf#Using_--cross-execute Andrew Bartlett -- Andrew Bartlett (he/him) https://samba.org/~abartlet/ Samba Team Member (since 2001) https://samba.org Samba Team Lead, Catalyst IT https://catalyst.net.nz/services/samba Samba Development and Support, Catalyst IT - Expert Open Source Solutions