[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Cross-building Debian packages with --sysroot

I'm experimenting with various ways to build armhf packages on Travis CI x86 build hosts. Qemulation has worked for a year, but requires splitting the build to stay under the 50 minute time limit. The standard Multi-Arch: method works for Jessie, but only with violent force installation of build deps, and the method probably wouldn't extend to Wheezy.

It hit on me to use multistrap and pass `--sysroot` through `CPPFLAGS` and `LDFLAGS`. This seems to be similar to what Debian does when bootstrapping a new architecture. Am I reinventing something here?

This seems to be working, except for `dpkg-shlibdeps`. That script can take an `--admindir=$SYSROOT/var/lib/dpkg` argument to find the needed `*.shlibs` and `*.symbols` files. There's no way to tell it where the libraries are, though, AFAICT. With no additional arguments, it looks in standard places in the rootfs, but of course only finds libs of the wrong arch, if at all. It finds libs if arguments like `-l$SYSROOT/usr/lib/${DEB_HOST_MULTIARCH}` are added, but then the file paths don't match those in the dpkg database.

I'm thinking about adding a `dpkg-shlibdeps --sysroot` argument. If this method could work, I hope to use it for building packages for Jessie, Wheezy and Raspbian. Is this at all a realistic hope? Is there another way to do what I'm trying to do? If not, what are the chances a `dpkg-shlibdeps --sysroot` argument might actually work?


Reply to: