About · Blog · Projects · Papers · Contact

I said I'd never blog

DeforaOS, NetBSD, reverse-engineering and stuff
Cross-compiling Debian packages for hackable:1, part 2
Blog post by khorben
on Tuesday, August 18 2009, 12:09

Member of

I wrote a while ago about how to cross-compile Debian packages, and within the
hackable:1 Linux distribution in particular. I'm glad to say that I managed to
find a decent work-around for a problem I mentioned last time: dh_shlibdeps
couldn't work.

dh_shlibdeps is in fact a wrapper around the dpkg-shlibdeps command. This
command analyzes every binary and library shipped in a package being generated,
in order to automatically list their dependencies. This can be problematic when
cross-compiling, since the binaries don't match the current architecture, and
may not even match the database of installed packages.

The trick here is to force dh_shlibdeps to:
  • look into the cross-compilation root folder,
  • read the dependency tracking information specially written for the occasion.
This is now done using this syntax in hackable:1:

$ dh_shlibdeps -l/usr/$(DEB_HOST_GNU_TYPE)/lib:/usr/$(DEB_HOST_GNU_TYPE)/usr/lib \
-- -Ldebian/shlibs.cross
where:
  • -l does the former directly,
  • and -L does the latter through dpkg-shlibdeps (escaped with --).
With this fix, the packages cross-compiled are almost as good as native ones,
stripping being the last culprit (only eating space). This will require a
modification to all the packages, but it will then help a lot with automated
images generation.

Come back...

Creative Commons License RSS