On Sun, Aug 02, 2020 at 05:21:33AM +0300, Boian Bonev wrote: > On Sat, 2020-08-01 at 17:17 +0200, Helmut Grohne wrote: > > Source: vfu > > Version: 4.20-1 > > Tags: patch > > User: debian-cr...@lists.debian.org > > Usertags: ftcbfs > > > > vfu fails to cross build from source again. Nothing ever initializes > > CXX to a cross compiler. Please consider applying the attached patch > > to do so. > > That fix somehow implies that all makefile based packages should > include /usr/share/dpkg/buildtools.mk? I am not well aware with the > Debian build system but haven't seen other packages doing that.
No. It only means that all makefile based packages that pass compilers via custom variables need to set these variables up properly. The vast majority of makefile based packages do not fiddle with compiler variables and uses standard variables instead of e.g. CC_1. > Isn't it the job of the outer layer to set CC/CXX/etc? As per my > undestanding debian/rules will default CXX to g++ in case CXX is not > set, but when set, make will use it, and that should be the correct > behaviour. Maybe that is already done for CC but not for CXX, or > another name is used? make does not set up CC/CXX and the like. Unfortunately, we still support building packages via "./debian/rules binary". Thus there is no outer layer that could set up these variables in a reliable way. We have two choices here: * include some other makefile to set up these variables. * Do not use them. For instance, when you build with dh_auto_build, it'll automatically append CC=... and CXX=... assignments to the make invocation. It just doesn't know about CC_1. > I'd appreciate if you give me a pointer on how to setup a cross build, > so I can include that in my test process. I suppose that you either use sbuild or pbuilder. If that is the case, you already do have a cross build environment. Now all you do is pass the --host option for sbuild or the --host-arch option for pbuilder. If that doesn't just work, please contact debian-cr...@lists.debian.org such that we can make it just work. Helmut