[Bug 872370] Re: iputils fails to cross-build

Colin Watson cjwatson at canonical.com
Tue Nov 8 13:22:26 UTC 2011


Thanks for the patch.  I had to merge this up with the current version
in precise anyway, and along the way, there are a few things I think
could be improved:

 * The $(origin CC) stuff is overcomplicated.  We don't need to patch the upstream Makefile to support overriding debian/rules, as the ordinary semantics of make already allow us to do so; all we need to do is pass CC=$(DEB_HOST_GNU_TYPE)-gcc on make's command line, rather than as an environment variable.  (I'd rather we established patterns that involved minimal need to patch upstream files wherever possible; 'CC = gcc' is extremely common and it would be good not to have to patch that all over the place.)
 * Using -lfoo as a prerequisite indeed won't work with cross-building, so I agree that we need to patch the upstream Makefile for that.  I'm not comfortable with doing so by adding unnecessary linkage to all output executables, though.  A neater way is to use target-specific variables, e.g. 'arping: LDLIBS = -lsysfs'.
 * We should have a DEP-3 patch header for the remaining upstream patch.

I've gone ahead and done this, tested it in my cross-building
environment, and uploaded to precise; patch attached.  I'll forward this
to Debian shortly.  Let me know if you think something still needs to be
revised, of course!

** Patch added: "iputils_20101006-1ubuntu1.debdiff"
   https://bugs.launchpad.net/ubuntu/+source/iputils/+bug/872370/+attachment/2589352/+files/iputils_20101006-1ubuntu1.debdiff

-- 
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/872370

Title:
  iputils fails to cross-build

Status in “iputils” package in Ubuntu:
  Fix Released

Bug description:
  
  The build command is:
  xdeb --only-explicit -a armel --prefer-apt --apt-source --debug --force-rebuild iputils

  The actual build command xdeb issues is:
  debuild --no-lintian -eUSER -eCONFIG_SITE=/etc/dpkg-cross/cross-config.armel -eDEB_BUILD_OPTIONS=nocheck -eGTEST_INCLUDEDIR=/usr/arm-linux-gnueabi/include -eGTEST_LIBDIR=/usr/arm-linux-gnueabi/lib -ePKG_CONFIG_LIBDIR=/usr/arm-linux-gnueabi/lib/pkgconfig:/usr/arm-linux-gnueabi/share/pkgconfig:/usr/share/pkgconfig -eDH_VERBOSE=1 -aarmel -b -uc -us -tc

  To easily reproduce the build environment in which this bug was discovered follow the HOWTO here:
  https://wiki.linaro.org/Platform/DevPlatform/CrossCompile/CrossBuildNano

  Setting 'buildlist' to just be the one line:
  iputils
  would mean it only builds this package and not lots of others too.

  The error is:
  dh_strip
          arm-linux-gnueabi-strip --remove-section=.comment --remove-section=.note debian/iputils-ping/bin/ping6
  arm-linux-gnueabi-strip:debian/iputils-ping/bin/ping6: File format not recognized

  The problem is that the build-arch compiler is used, not the target-arch compiler:
  gcc -Wl,-Bsymbolic-functions  ping.o ping_common.o   -o ping

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/iputils/+bug/872370/+subscriptions



More information about the Ubuntu-sponsors mailing list