iputils fails to cross-build

Bug #872370 reported by Wookey
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
iputils (Ubuntu)
Fix Released
Undecided
Unassigned

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

Tags: patch cross natty

Related branches

Revision history for this message
Wookey (wookey) wrote :
Revision history for this message
Wookey (wookey) wrote :

This failure can be fixed with the attached patch to make sure the host arch compiler is used and the system library search path, not the 'Make' search path is used.

Changed in iputils (Ubuntu):
status: New → Confirmed
Revision history for this message
Wookey (wookey) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Cross-fix patch" of this bug report has been identified as being a patch in the form of a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Colin Watson (cjwatson) wrote :

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!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package iputils - 3:20101006-1ubuntu1

---------------
iputils (3:20101006-1ubuntu1) precise; urgency=low

  * Support cross-building (thanks to Wookey <email address hidden> and Harry
    Liebel; LP: #872370).
 -- Colin Watson <email address hidden> Tue, 08 Nov 2011 13:17:14 +0000

Changed in iputils (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.