Public bug reported:

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.

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: Incomplete


** Tags: cross patch

** Patch added: "linux-3.8.0-1.5-toolscrossfix.patch"
   
https://bugs.launchpad.net/bugs/1105251/+attachment/3500244/+files/linux-3.8.0-1.5-toolscrossfix.patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1105251

Title:
  Fix cross- linux-tools build

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to