[packages/kernel-tools] - fix build on x32 again - updated files

baggins baggins at pld-linux.org
Sat May 18 12:53:03 CEST 2019


commit 388d18e63d616fcf421c3a28c495fa8e63a18329
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sat May 18 12:52:41 2019 +0200

    - fix build on x32 again
    - updated files

 kernel-tools.spec | 30 +++++++++++++++++++++++++-----
 regex.patch       | 19 +++++++++++++++++++
 x32.patch         | 15 ++++++++++++++-
 3 files changed, 58 insertions(+), 6 deletions(-)
---
diff --git a/kernel-tools.spec b/kernel-tools.spec
index f453171..c1b12dc 100644
--- a/kernel-tools.spec
+++ b/kernel-tools.spec
@@ -13,9 +13,6 @@
 %bcond_without	multilib	# multilib perf support
 %bcond_without	usbip		# usbip utils
 
-%ifarch x32
-%undefine	with_libunwind
-%endif
 %ifnarch %{x8664}
 %undefine	with_multilib
 %endif
@@ -38,6 +35,7 @@ Patch0:		https://www.kernel.org/pub/linux/kernel/v5.x/patch-%{version}.xz
 # Patch0-md5:	06ee36333ce2f480ae848320790cebc1
 %endif
 Patch1:		x32.patch
+Patch2:		regex.patch
 Patch3:		%{name}-perf-update.patch
 URL:		http://www.kernel.org/
 BuildRequires:	bison
@@ -144,6 +142,22 @@ Development files for the cpupower library.
 %description cpupower-libs-devel -l pl.UTF-8
 Pliki programistyczne biblioteki cpupower.
 
+%package -n bash-completion-cpupower
+Summary:	Bash completion for cpupower tools
+Summary(pl.UTF-8):	Bashowe uzupełnianie parametrów dla poleceń cpupower
+Group:		Applications/Shells
+Requires:	%{name}-cpupower = %{version}-%{release}
+Requires:	bash-completion
+%if "%{_rpmversion}" >= "5"
+BuildArch:	noarch
+%endif
+
+%description -n bash-completion-cpupower
+Bash completion for cpupower tools.
+
+%description -n bash-completion-cpupower -l pl.UTF-8
+Bashowe uzupełnianie parametrów dla poleceń cpupower.
+
 %package hv
 Summary:	Hyper-V virtualization tools
 Summary(pl.UTF-8):	Narzędzia do wirtualizacji Hyper-V
@@ -376,6 +390,7 @@ cd linux-%{basever}
 %endif
 
 %patch1 -p1
+%patch2 -p1
 %patch3 -p1
 
 %{__sed} -i -e '/^CFLAGS = /s/ -g / $(OPTFLAGS) /' tools/hv/Makefile
@@ -433,7 +448,7 @@ CFLAGS="%{rpmcflags}" \
 
 # perf
 %if %{with perf}
-%{__make} -C tools/perf all man \
+%{__make} -j1 -C tools/perf all man \
 %ifarch %{x8664}
 	IS_X86_64=1 \
 	%{!?with_multilib:NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1} \
@@ -537,7 +552,7 @@ install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_
 %endif
 
 %if %{with perf}
-%{__make} -C tools/perf -j1 install install-man \
+%{__make} -C tools/perf install install-man \
 %ifarch %{x8664}
 	IS_X86_64=1 \
 	%{!?with_multilib:NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1} \
@@ -551,6 +566,7 @@ install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_
 	prefix=%{_prefix} \
 	perfexecdir=%{_datadir}/perf-core \
 	template_dir=%{_datadir}/perf-core/templates \
+	bash_compdir=%{bash_compdir} \
 	lib=%{_lib} \
 	DESTDIR=$RPM_BUILD_ROOT
 
@@ -678,6 +694,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_includedir}/cpufreq.h
 %{_includedir}/cpuidle.h
 
+%files -n bash-completion-cpupower
+%defattr(644,root,root,755)
+%{bash_compdir}/cpupower
+
 %ifarch %{ix86} %{x8664} x32
 %files hv
 %defattr(644,root,root,755)
diff --git a/regex.patch b/regex.patch
new file mode 100644
index 0000000..10fc967
--- /dev/null
+++ b/regex.patch
@@ -0,0 +1,19 @@
+--- linux-5.1/tools/perf/trace/beauty/usbdevfs_ioctl.sh.orig	2019-05-18 12:06:30.000000000 +0200
++++ linux-5.1/tools/perf/trace/beauty/usbdevfs_ioctl.sh	2019-05-18 12:43:40.724851148 +0200
+@@ -4,14 +4,14 @@
+ [ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/
+ 
+ printf "static const char *usbdevfs_ioctl_cmds[] = {\n"
+-regex="^#[[:space:]]*define[[:space:]]+USBDEVFS_(\w+)[[:space:]]+_IO[WR]{0,2}\([[:space:]]*'U'[[:space:]]*,[[:space:]]*([[:digit:]]+).*"
++regex="^#[[:space:]]*define[[:space:]]+USBDEVFS_(\w+)[[:space:]]+_IO[WR]*\([[:space:]]*'U'[[:space:]]*,[[:space:]]*([[:digit:]]+).*"
+ egrep $regex ${header_dir}/usbdevice_fs.h | egrep -v 'USBDEVFS_\w+32[[:space:]]' | \
+ 	sed -r "s/$regex/\2 \1/g"	| \
+ 	sort | xargs printf "\t[%s] = \"%s\",\n"
+ printf "};\n\n"
+ printf "#if 0\n"
+ printf "static const char *usbdevfs_ioctl_32_cmds[] = {\n"
+-regex="^#[[:space:]]*define[[:space:]]+USBDEVFS_(\w+)[[:space:]]+_IO[WR]{0,2}\([[:space:]]*'U'[[:space:]]*,[[:space:]]*([[:digit:]]+).*"
++regex="^#[[:space:]]*define[[:space:]]+USBDEVFS_(\w+)[[:space:]]+_IO[WR]*\([[:space:]]*'U'[[:space:]]*,[[:space:]]*([[:digit:]]+).*"
+ egrep $regex ${header_dir}/usbdevice_fs.h | egrep 'USBDEVFS_\w+32[[:space:]]' | \
+ 	sed -r "s/$regex/\2 \1/g"	| \
+ 	sort | xargs printf "\t[%s] = \"%s\",\n"
diff --git a/x32.patch b/x32.patch
index b8d0199..78f1cac 100644
--- a/x32.patch
+++ b/x32.patch
@@ -18,12 +18,14 @@ FIXME: regs_load.S need complete x32 ABI support; now it will just compile, but
 +endif
 --- linux-4.8/tools/perf/Makefile.config~	2015-04-11 12:12:31.000000000 +0200
 +++ linux-4.8/tools/perf/Makefile.config	2015-04-11 12:19:05.011244885 +0200
-@@ -41,6 +41,9 @@
+@@ -41,6 +41,11 @@
      LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind
    endif
    NO_PERF_REGS := 0
 +  ifeq (${IS_X32_BIT}, 1)
 +    CFLAGS += -DHAVE_ARCH_X32_SUPPORT
++    ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
++    LIBUNWIND_LIBS = -lunwind-x86_64 -llzma -lunwind
 +  endif
  endif
  
@@ -128,3 +130,14 @@ FIXME: regs_load.S need complete x32 ABI support; now it will just compile, but
  	} else
  		pr_info("00:00:00.000000");
  
+--- linux-5.1/tools/perf/arch/x86/util/unwind-libunwind.c.orig	2019-05-06 02:42:58.000000000 +0200
++++ linux-5.1/tools/perf/arch/x86/util/unwind-libunwind.c	2019-05-18 12:32:31.916685600 +0200
+@@ -8,7 +8,7 @@
+ #include "../../util/debug.h"
+ #endif
+ 
+-#ifdef HAVE_ARCH_X86_64_SUPPORT
++#if defined(HAVE_ARCH_X86_64_SUPPORT) || defined(HAVE_ARCH_X32_SUPPORT)
+ int LIBUNWIND__ARCH_REG_ID(int regnum)
+ {
+ 	int id;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/kernel-tools.git/commitdiff/388d18e63d616fcf421c3a28c495fa8e63a18329



More information about the pld-cvs-commit mailing list