FIx basic tools cross-build

Bug #1104017 reported by Wookey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro Linux Baseline
Fix Released
Undecided
Wookey
Linaro Ubuntu
Undecided
Wookey

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. In the meantime we can install build-deps manually and proceed.
apt-get install

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.

This patch also includes a rename from 'build_arch' to 'kernel_arch' in the debian.linaro 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.

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

Some noise in that patch. This should be a bit better.

Revision history for this message
John Rigby (jcrigby) wrote :

committed Wookey's fine patch to the two linaro packaging template branches linaro-ubuntu-packaging-3.7-arm64 linaro-ubuntu-packaging-3.7

Changed in linaro-ubuntu:
assignee: nobody → Wookey (wookey)
status: New → Fix Committed
Revision history for this message
Wookey (wookey) wrote :

OK. There is an extra bit in the mailine patch:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1105251

which I've not ported back to this bug:

these bits: (for "Fix cross- optional library detection")

--- origs/linux-3.8.0/tools/perf/config/utilities.mak 2013-01-03 13:01:59.000000000 +0000
+++ linux-3.8.0/tools/perf/config/utilities.mak 2013-01-24 18:07:41.000000000 +0000
@@ -190,5 +190,5 @@
  'TMP="$(OUTPUT)$(TMPOUT).$$$$"; \
   $(TRY_CC_MSG) \
   echo "$(1)" | \
- $(CC) -x c - $(2) -o "$$TMP" $(TRY_CC_OUTPUT) && echo y; \
+ $(CROSS-COMPILE)$(CC) -x c - $(2) -o "$$TMP" $(TRY_CC_OUTPUT) && echo y; \
   rm -f "$$TMP"')
diff -ur origs/linux-3.8.0/tools/perf/Makefile linux-3.8.0/tools/perf/Makefile
--- origs/linux-3.8.0/tools/perf/Makefile 2013-01-03 13:01:59.000000000 +0000
+++ linux-3.8.0/tools/perf/Makefile 2013-01-24 18:00:56.000000000 +0000
@@ -64,7 +64,12 @@
 CC = $(CROSS_COMPILE)gcc
 AR = $(CROSS_COMPILE)ar

-# Additional ARCH settings for x86
+# Additional ARCH settings
+ifeq ($(ARCH),arm)
+ override ARCH := arm
+ NO_PERF_REGS := 0
+ LIBUNWIND_LIBS = -lunwind -lunwind-arm
+endif

Oh and add 'armhf' to the arches for which the libunwind8-dev and libaudit-dev build-deps apply.

Sorry for the low-quality patch, but thought I should record it before it gets forgotten.

Add those too and you'll get the libunwind, dwarf, and curses support in perf.

Fathi Boudra (fboudra)
Changed in linaro-linux-baseline:
assignee: nobody → John Rigby (jcrigby)
Changed in linaro-ubuntu:
milestone: none → 13.02
Changed in linaro-linux-baseline:
milestone: none → 13.02
status: New → Fix Committed
Revision history for this message
Fathi Boudra (fboudra) wrote :

I had to revert the patch. It breaks vexpress64 build (axf file aren't installed anymore).
The full patch should be properly rebased on top of the tree:
http://git.linaro.org/gitweb?p=ubuntu/linux-linaro-raring.git

Changed in linaro-linux-baseline:
status: Fix Committed → In Progress
Changed in linaro-ubuntu:
status: Fix Committed → In Progress
Fathi Boudra (fboudra)
Changed in linaro-ubuntu:
milestone: 13.02 → 13.03
Changed in linaro-linux-baseline:
milestone: 13.02 → 13.03
Fathi Boudra (fboudra)
Changed in linaro-linux-baseline:
assignee: John Rigby (jcrigby) → Wookey (wookey)
Fathi Boudra (fboudra)
Changed in linaro-linux-baseline:
milestone: 13.03 → 13.04
Changed in linaro-ubuntu:
milestone: 13.03 → 13.04
Fathi Boudra (fboudra)
Changed in linaro-ubuntu:
milestone: 13.04 → 13.05
Changed in linaro-linux-baseline:
milestone: 13.04 → 13.05
Revision history for this message
Wookey (wookey) wrote :

In 3.10 kernels the tools cross-build had an extra kernel internal library added: tools/lib/lk which is needed by perf.

It was not cross-build ready.

The below pair of patches fixes that. One needs to be applied to the ssh://git.linaro.org/srv/git.linaro.org/git/ubuntu/linux-linaro-raring.git tree (for the debian rules change), the other in the main ssh://git.linaro.org/srv/git.linaro.org/git/kernel/linux-linaro-tracking.git tree.

Revision history for this message
Wookey (wookey) wrote :

This is the corresponding packaging patch (which is already applied) for the above tools/ dir patch

Wookey (wookey)
Changed in linaro-linux-baseline:
status: In Progress → Fix Committed
Fathi Boudra (fboudra)
Changed in linaro-ubuntu:
milestone: 13.05 → 13.06
Changed in linaro-linux-baseline:
milestone: 13.05 → 13.06
Fathi Boudra (fboudra)
Changed in linaro-linux-baseline:
status: Fix Committed → Fix Released
Changed in linaro-ubuntu:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers