diff -ur origs/linux-3.8.0/debian/changelog linux-3.8.0/debian/changelog
--- origs/linux-3.8.0/debian/changelog	2013-01-18 15:12:38.000000000 +0000
+++ linux-3.8.0/debian/changelog	2013-01-24 16:39:07.000000000 +0000
@@ -1,3 +1,9 @@
+linux (3.8.0-1.5ubuntu1) raring; urgency=low
+
+  * Fix tools cross-build
+
+ -- Wookey <wookey@wookware.org>  Thu, 24 Jan 2013 15:54:52 +0000
+
 linux (3.8.0-1.5) raring; urgency=low
 
   [Tim Gardner]
diff -ur origs/linux-3.8.0/debian/rules.d/2-binary-arch.mk linux-3.8.0/debian/rules.d/2-binary-arch.mk
--- origs/linux-3.8.0/debian/rules.d/2-binary-arch.mk	2013-01-10 20:05:37.000000000 +0000
+++ linux-3.8.0/debian/rules.d/2-binary-arch.mk	2013-01-24 16:32:43.000000000 +0000
@@ -9,6 +9,7 @@
 build_cd =
 build_O  = O=$(builddir)/build-$*
 endif
+STRIP = $(CROSS_COMPILE)strip
 
 $(stampdir)/stamp-prepare-%: config-prepare-check-%
 	@echo Debug: $@
@@ -442,8 +443,12 @@
 	@echo Debug: $@
 ifeq ($(do_tools),true)
 ifeq ($(do_tools_perf),true)
+	# we don't have cross-libiberty yet so avoid it by leaving out C++ demangling when crossbuilding
+ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+	perf_features=HAVE_CPLUS_DEMANGLE=1
+endif
 	cd $(builddirpa)/tools/perf && \
-		make HAVE_CPLUS_DEMANGLE=1 CROSS_COMPILE=$(CROSS_COMPILE)
+		make $(perf_features)  ARCH=$(header_arch) CROSS_COMPILE=$(CROSS_COMPILE)
 endif
 	if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then \
 		cd $(builddirpa)/tools/power/x86/x86_energy_perf_policy && make CROSS_COMPILE=$(CROSS_COMPILE); \
@@ -462,17 +467,17 @@
 ifeq ($(do_tools),true)
 	install -d $(toolspkgdir)/usr/bin
 ifeq ($(do_tools_perf),true)
-	install -s -m755 $(builddirpa)/tools/perf/perf \
+	install -s --strip-program=$(STRIP) -m755 $(builddirpa)/tools/perf/perf \
 		$(toolspkgdir)/usr/bin/perf_$(abi_release)
 endif
 	if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then \
-		install -s -m755 $(builddirpa)/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy \
+		install -s --strip-program=$(STRIP) -m755 $(builddirpa)/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy \
 			$(toolspkgdir)/usr/bin/x86_energy_perf_policy_$(abi_release); \
-		install -s -m755 $(builddirpa)/tools/power/x86/turbostat/turbostat \
+		install -s --strip-program=$(STRIP) -m755 $(builddirpa)/tools/power/x86/turbostat/turbostat \
 			$(toolspkgdir)/usr/bin/turbostat_$(abi_release); \
 		if [ "$(do_hyperv)" = "true" ]; then \
 			install -d $(toolspkgdir)/usr/sbin; \
-			install -s -m755 $(builddirpa)/tools/hv/hv_kvp_daemon \
+			install -s --strip-program=$(STRIP) -m755 $(builddirpa)/tools/hv/hv_kvp_daemon \
 				$(toolspkgdir)/usr/sbin/hv_kvp_daemon_$(abi_release); \
 		fi; \
 	fi
Only in origs/linux-3.8.0/firmware/bnx2x: bnx2x-e1-7.8.2.0.fw
Only in origs/linux-3.8.0/firmware/bnx2x: bnx2x-e1h-7.8.2.0.fw
Only in origs/linux-3.8.0/firmware/bnx2x: bnx2x-e2-7.8.2.0.fw
diff -ur origs/linux-3.8.0/tools/perf/config/utilities.mak linux-3.8.0/tools/perf/config/utilities.mak
--- 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
 ifeq ($(ARCH),i386)
 	override ARCH := x86
 	NO_PERF_REGS := 0
Only in linux-3.8.0/tools/perf: Makefile~
Only in linux-3.8.0/tools/perf: PERF-VERSION-FILE
