Fix cross- linux-tools build

Bug #1105251 reported by Wookey
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
In Progress
Medium
Andy Whitcroft

Bug Description

cross-building the kernel with sbuild --host or apt-get build-dep -aarmhf && dpkg-buildpackage -aarmhf does not work. The kernel part is OK but the tools package build falls over.

There were various reasons for this.

First the cross-build-deps do not install because binutils-dev:armhf is a) not multiarch and b) not installable if it was due to binutils not being multiarched. This is being worked on (see http://lists.debian.org/debian-embedded/2013/01/msg00011.html). In the meantime we can install build-deps manually and proceed.
apt-get install debhelper cpio module-init-tools kernel-wedge rsync dpkg util-linux flex bison openssl libelf-dev:armhf libnewt-dev:armhf libdw-dev:armhf libunwind8-dev:armhf libaudit-dev:armhf
(and crossbuild-essential-armhf, or otherwise get a cross-toolchain)

The kernel cross build failed due to no arch being specified for the tools build so the wrong headers were found.

Also install -s is used, which uses the wrong strip. It might be better to refactor this to use dh_install which would DTRT, but for now I added --strip-program $(STRIP) and set $(STRIP) correctly for each call.
These fixes are in the first patch

This gives a working build, but none of the optional libraries are detected and used (libdw, libunwind, libaudit, libnewt). This is fixed by using the crosscompiler to run the tests when crossing, and adding config for arm for libunwind.
This fix is included in the -3 patch

C++ demangling support (via libiberty) won't work untilt there is a way to install bintuils-dev:armhf or equivalent.

Attached is also a version of the patch (-2) which includes a rename from 'build_arch' to 'kernel_arch' in the debian* arch-specific rules config, as 'build_arch' (reffering to the HOST_ARCH) is hopelessly confusing in a cross-build context. Agreed with Ubuntu upstream to use 'kernel_arch' instead.

Sorry this isn't a nice quilt set, but you get the idea.

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

Patch incorporating initial cross-fixes and build_arch->kernel-arch rename

Revision history for this message
Wookey (wookey) wrote :

Patch including all the fixes

Revision history for this message
Wookey (wookey) wrote :

This is the same issue as https://bugs.launchpad.net/linaro-ubuntu/+bug/1104017 but a different patch (for current raring kernel), and including the optional-library fix. I couldn't work out the right launchpad button for linking these two reports, but I assume it is possible.

Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1105251

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Wookey (wookey)
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Changed in linux (Ubuntu):
importance: Undecided → Medium
Andy Whitcroft (apw)
tags: added: bot-stop-nagging
Changed in linux (Ubuntu):
assignee: nobody → Andy Whitcroft (apw)
status: Confirmed → In Progress
Revision history for this message
Colin Watson (cjwatson) wrote :

The build-dependency on libunwind8-dev should also be limited to only the architectures where it's used: either [amd64 i386] in the current package, or [amd64 armhf i386] with Wookey's patch.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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