On 2018-01-25 23:03:50 +0100, Vincent Lefevre wrote: > On 2018-01-25 15:30:02 +0100, to...@tuxteam.de wrote: > > On Thu, Jan 25, 2018 at 02:56:17PM +0100, Vincent Lefevre wrote: > > > To rebuild a Debian package, one can use: > > > > > > debuild -i -us -uc -b > > > > > > But how to rebuild a Debian package for a foreign architecture? > > > In my case for i386 from an amd64 machine. I've tried > > > > > > debuild -i -us -uc -b -a i386 > > > > > > but the build fails at some point: > > > > > > [...] > > > dh_strip -a > > > dh_strip: Compatibility levels before 9 are deprecated (level 7 in use) > > > dh_strip: Compatibility levels before 9 are deprecated (level 7 in use) > > > dh_strip: Compatibility levels before 9 are deprecated (level 7 in use) > > > Can't exec "i686-linux-gnu-strip": No such file or directory at > > > /usr/share/perl5/Debian/Debhelper/Dh_Lib.pm line 358. > > > [...] > > > > It seems that you are missing the '386 (or more precisely the '686) > > executables. Perhaps you need the package dpkg-cross. > > Installing dpkg-cross just installs: cross-config dpkg-cross > libconfig-auto-perl libdebian-dpkgcross-perl. This is not > sufficient.
According to https://wiki.debian.org/CrossCompiling, it should have been crossbuild-essential-i386, and indeed, this installs binutils-i686-linux-gnu (which provides i686-linux-gnu-strip). However, it seems to install more than necessary for the particular case of i386 on an amd64 machine. Now, this was just one of the issues. After installing binutils-i686-linux-gnu, the other issue was that the architecture wasn't taken into account by debuild itself, after running dpkg-buildpackage successfully. I eventually found a bug / limitation in the debuild source: to be taken into account by debuild, one needs to write -ai386 *without a space*. I've reported this bug (real bug or lack of documentation): https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=898706 With "debuild -i -us -uc -b -ai386", I now do not get any error. -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)