[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#778588: linux-tools: build fails with linux-3.19 sources



Package: src:linux-tools
Version: 3.18.5-1~exp1
Severity: important
Tags: patch

Dear Maintainer,

As linux-image-3.19.0-* packages are available in experimental but
linux-kbuild-3.19 is not yet in the repositories, I tried to build it manually
following the guide at https://wiki.debian.org/HowToRebuildAnOfficialDebianKernelPackage
but I encountered a couple of problems that break the build.

Hoping that it can be useful, I am attaching the patch I diff'ed against the
latest version of the repo: svn://svn.debian.org/kernel/dists/trunk/linux-tools

The problems encountered are:

- The patch tools-perf-version.patch does not apply cleanly due to upstream
changes
- lib/hweight.c must be copied by debian/bin/genorig.py as it is needed to build
- x86_64 specific: perf does not build, fix taken from lkml (has not been
committed as of now) and used to create a new Quilt patch, link to the upstream
mail: https://lkml.org/lkml/2015/2/13/55

Kind regards,
Luca Boccassi

Index: debian/bin/genorig.py
===================================================================
--- debian/bin/genorig.py	(revision 22391)
+++ debian/bin/genorig.py	(working copy)
@@ -146,6 +146,7 @@
                 'arch/x86/lib/memset_64.S',
                 'include/',
                 'lib/rbtree.c',
+                'lib/hweight.c',
                 'scripts/',
                 'tools/',
         )
Index: debian/patches/perf-fix-building-error-in-x86_64.patch
===================================================================
--- debian/patches/perf-fix-building-error-in-x86_64.patch	(revision 0)
+++ debian/patches/perf-fix-building-error-in-x86_64.patch	(working copy)
@@ -0,0 +1,27 @@
+From: He Kuang <hekuang@huawei.com>
+Date: Fri, 13 Feb 2015 15:11:14 +0800
+Subject: [PATCH v2] perf: fix building error in x86_64
+
+When build with ARCH=x86_64, perf failed to compile with following error:
+
+tests/builtin-test.o:(.data+0x158): undefined reference to `test__perf_time_to_tsc'
+collect2: error: ld returned 1 exit status
+Makefile.perf:632: recipe for target 'perf' failed
+...
+
+Which is caused commit c6e5e9fbc3ea1 ("perf tools: Fix building error
+in x86_64 when dwarf unwind is on"), ARCH test in Makefile.perf
+conflicts with tests/builtin-test.c's __x86_64__.
+To x86/x86_64 platform, ARCH should always override to x86 while
+IS_64_BIT stands for the actual architecture.
+
+--- a/tools/perf/config/Makefile.arch
++++ b/tools/perf/config/Makefile.arch
+@@ -29,3 +29,7 @@
+ else
+   IS_64_BIT := 0
+ endif
++
++ifeq ($(ARCH), x86_64)
++  override ARCH := x86
++endif
Index: debian/patches/series
===================================================================
--- debian/patches/series	(revision 22391)
+++ debian/patches/series	(working copy)
@@ -4,3 +4,4 @@
 usbip-document-tcp-wrappers.patch
 kbuild-fix-recordmcount-dependency.patch
 usbip-include-uninstalled-linux-usbip-h.patch
+perf-fix-building-error-in-x86_64.patch
Index: debian/patches/tools-perf-version.patch
===================================================================
--- debian/patches/tools-perf-version.patch	(revision 22391)
+++ debian/patches/tools-perf-version.patch	(working copy)
@@ -9,7 +9,7 @@
 
 --- a/tools/perf/Makefile.perf
 +++ b/tools/perf/Makefile.perf
-@@ -833,8 +833,8 @@ install-gtk:
+@@ -923,8 +923,8 @@ install-gtk:
  install-bin: all install-gtk
  	$(call QUIET_INSTALL, binaries) \
  		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'; \
@@ -17,10 +17,10 @@
 -		$(LN) '$(DESTDIR_SQ)$(bindir_SQ)/perf' '$(DESTDIR_SQ)$(bindir_SQ)/trace'
 +		$(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)/perf_$(VERSION)'; \
 +		$(LN) '$(DESTDIR_SQ)$(bindir_SQ)/perf_$(VERSION)' '$(DESTDIR_SQ)$(bindir_SQ)/trace_$(VERSION)'
- 	$(call QUIET_INSTALL, libexec) \
- 		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
- 	$(call QUIET_INSTALL, perf-archive) \
-@@ -857,7 +857,7 @@ ifndef NO_LIBPYTHON
+ ifndef NO_PERF_READ_VDSO32
+ 	$(call QUIET_INSTALL, perf-read-vdso32) \
+ 		$(INSTALL) $(OUTPUT)perf-read-vdso32 '$(DESTDIR_SQ)$(bindir_SQ)';
+@@ -957,7 +957,7 @@ ifndef NO_LIBPYTHON
  endif
  	$(call QUIET_INSTALL, perf_completion-script) \
  		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'; \
@@ -29,7 +29,7 @@
  	$(call QUIET_INSTALL, tests) \
  		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \
  		$(INSTALL) tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \
-@@ -871,7 +871,7 @@ install-python_ext:
+@@ -971,7 +971,7 @@ install-python_ext:
  
  # 'make install-doc' should call 'make -C Documentation install'
  $(INSTALL_DOC_TARGETS):

Attachment: signature.asc
Description: Digital signature


Reply to: