From 12995931efeb56e17db279311096e30763d74b73 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 16 May 2023 06:07:18 +0000 Subject: [PATCH] import crash-trace-command-3.0-1.el8 --- .crash-trace-command.metadata | 1 + .gitignore | 1 + ...1-Makefile-set-DT_SONAME-to-trace.so.patch | 36 +++++ ...build-failure-on-aarch64-and-ppc64le.patch | 50 ++++++ SPECS/crash-trace-command.spec | 152 ++++++++++++++++++ 5 files changed, 240 insertions(+) create mode 100644 .crash-trace-command.metadata create mode 100644 .gitignore create mode 100644 SOURCES/0001-Makefile-set-DT_SONAME-to-trace.so.patch create mode 100644 SOURCES/0002-Makefile-fix-build-failure-on-aarch64-and-ppc64le.patch create mode 100644 SPECS/crash-trace-command.spec diff --git a/.crash-trace-command.metadata b/.crash-trace-command.metadata new file mode 100644 index 0000000..8f7b9ce --- /dev/null +++ b/.crash-trace-command.metadata @@ -0,0 +1 @@ +b9636e856f96e77b2047e12c3d87991ec88b067c SOURCES/crash-trace-command-3.0.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..340279d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/crash-trace-command-3.0.tar.gz diff --git a/SOURCES/0001-Makefile-set-DT_SONAME-to-trace.so.patch b/SOURCES/0001-Makefile-set-DT_SONAME-to-trace.so.patch new file mode 100644 index 0000000..208e4d7 --- /dev/null +++ b/SOURCES/0001-Makefile-set-DT_SONAME-to-trace.so.patch @@ -0,0 +1,36 @@ +From 153629a96b07a8ae96b0b28cce100fde9ea1398d Mon Sep 17 00:00:00 2001 +From: HATAYAMA Daisuke +Date: Thu, 28 Jan 2021 00:08:35 -0500 +Subject: [PATCH 1/2] Makefile: set DT_SONAME to trace.so + +Fedora never requires SONAME versioning for plugins according to the +Packaging Guidelines: + + https://docs.fedoraproject.org/en-US/packaging-guidelines/#_downstream_so_name_versioning + + In cases where upstream ships unversioned .so library (so this is + not needed for plugins, drivers, etc.), the packager MUST try to + convince upstream to start versioning it. + +On the other hand, fedpkg lint still prints warning if the shared +library doesn't have DT_SONAME. To surpress this, we set DT_SONAME +field to trace.so for in case. + +Signed-off-by: HATAYAMA Daisuke +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index a9e0a21..b4573b4 100755 +--- a/Makefile ++++ b/Makefile +@@ -28,4 +28,4 @@ INCDIR=/usr/include/crash + all: trace.so + + trace.so: $(INCDIR)/defs.h trace.c +- gcc $(RPM_OPT_FLAGS) -Wall -I$(INCDIR) -nostartfiles -shared -rdynamic -o trace.so trace.c -fPIC -D$(TARGET) $(TARGET_CFLAGS) ++ gcc $(RPM_OPT_FLAGS) -Wall -I$(INCDIR) -nostartfiles -shared -rdynamic -Wl,-z,now -Wl,-soname,trace.so -o trace.so trace.c -fPIC -D$(TARGET) $(TARGET_CFLAGS) +-- +2.29.2 + diff --git a/SOURCES/0002-Makefile-fix-build-failure-on-aarch64-and-ppc64le.patch b/SOURCES/0002-Makefile-fix-build-failure-on-aarch64-and-ppc64le.patch new file mode 100644 index 0000000..14d4767 --- /dev/null +++ b/SOURCES/0002-Makefile-fix-build-failure-on-aarch64-and-ppc64le.patch @@ -0,0 +1,50 @@ +From 17c35d075f067d80fee112ae18365b8defa2ca5a Mon Sep 17 00:00:00 2001 +From: HATAYAMA Daisuke +Date: Fri, 19 Feb 2021 11:38:59 +0900 +Subject: [PATCH 2/2] Makefile: fix build failure on aarch64 and ppc64le + +Currently, there is build failure on aarch64 and ppc64le as follows: + + gcc -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -Wall -I/usr/include/crash -nostartfiles -shared -rdynamic -o trace.so trace.c -fPIC -D + gcc: error: macro name missing after '-D' + +The failure is caused by missing arguments for -D option because +TARGET variable is empty. + +This commit fixes the issue by defining TARGET variable properly +according to aarch64 and ppc64le. + +Signed-off-by: HATAYAMA Daisuke +--- + Makefile | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/Makefile b/Makefile +index b4573b4..0d35d4f 100755 +--- a/Makefile ++++ b/Makefile +@@ -6,6 +6,10 @@ ifeq ($(shell arch), ppc64) + TARGET=PPC64 + TARGET_CFLAGS=-m64 + endif ++ifeq ($(shell arch), ppc64le) ++ TARGET=PPC64 ++ TARGET_CFLAGS=-m64 ++endif + ifeq ($(shell arch), ia64) + TARGET=IA64 + TARGET_CFLAGS= +@@ -22,6 +26,10 @@ ifeq ($(shell arch), s390) + TARGET=S390 + TARGET_CFLAGS= + endif ++ifeq ($(shell arch), aarch64) ++ TARGET=ARM64 ++ TARGET_CFLAGS= ++endif + + INCDIR=/usr/include/crash + +-- +2.29.2 + diff --git a/SPECS/crash-trace-command.spec b/SPECS/crash-trace-command.spec new file mode 100644 index 0000000..d0a951d --- /dev/null +++ b/SPECS/crash-trace-command.spec @@ -0,0 +1,152 @@ +# +# crash core analysis suite +# +%global reponame crash-trace + +Summary: Trace extension module for the crash utility +Name: crash-trace-command +Version: 3.0 +Release: 1%{?dist} +License: GPLv2 +Group: Development/Debuggers +Source: https://github.com/fujitsu/crash-trace/archive/v%{version}/%{name}-%{version}.tar.gz +URL: https://github.com/fujitsu/crash-trace +# Vendor: Fujitsu Limited +# Packager: Qiao Nuohan +ExclusiveOS: Linux +ExclusiveArch: x86_64 %{ix86} ppc64 ia64 s390 s390x aarch64 ppc64le +Buildroot: %{_tmppath}/%{name}-root +BuildRequires: zlib-devel lzo-devel snappy-devel +BuildRequires: crash-devel >= 7.2.0-2 +Requires: trace-cmd +Requires: crash >= 7.2.0-2 + +Patch0: 0001-Makefile-set-DT_SONAME-to-trace.so.patch +Patch1: 0002-Makefile-fix-build-failure-on-aarch64-and-ppc64le.patch + +%description +Command for reading ftrace data from a dumpfile. + +%prep +%setup -q -n %{reponame}-%{version} +%patch0 -p1 -b 0001-Makefile-set-DT_SONAME-to-trace.so.patch +%patch1 -p1 -b 0002-Makefile-fix-build-failure-on-aarch64-and-ppc64le.patch + +%build +make + +%install +mkdir -p %{buildroot}%{_libdir}/crash/extensions/ +cp %{_builddir}/%{reponame}-%{version}/trace.so %{buildroot}%{_libdir}/crash/extensions/ + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root) +%{_libdir}/crash/extensions/trace.so +%doc COPYING + +%changelog +* Fri Nov 18 2022 Lianbo Jiang - 3.0-1 +- Rebase to upstream v3.0 +- Update to the latest upstream commit + Resolves: rhbz#2119709 + +* Mon Feb 08 2021 Lianbo Jiang - 2.0-18 +- Rename trace_buffer to array_buffer +- Rename ring_buffer to trace_buffer + Resolves: rhbz#1925907 + +* Mon Jul 27 2020 Bhupesh Sharma - 2.0-17 +- Chnage Source/URL to point to the latest github location + Resolves: rhbz#1851746 + +* Tue Apr 28 2019 Dave Anderson - 2.0-16 +- Fix for RHEL7 ftrace_event_call data structure change + Resolves: rhbz#1827734 + +* Wed Sep 19 2018 Dave Anderson - 2.0-15 +- annocheck: link with -Wl,-z,now + Resolves: rhbz#1630558 + +* Mon Aug 13 2018 Dave Anderson - 2.0-14 +- Bump release for mass rebuild + Resolves: rhbz#1615511 + +* Wed Dec 6 2017 Dave Anderson - 2.0.13 +- Build requires crash-devel-7.2.0-2 and usage requires crash-7.2.0-2 + because of load_module structure change. + Resolves: rhbz#1520825 + +* Sun Apr 16 2017 Dave Anderson - 2.0.12 +- Differentiate ppc64 .ring_buffer_read text symbol from ring_buffer_read data symbol +- Fix for ring_buffer_per_cpu.nr_pages size change on big-endian systems +- Fix for Linux 4.7 change to the TRACE_EVENT_FL_TRACEPOINT flag + Resolves: rhbz#1441914 + Resolves: rhbz#1440726 + +* Thu Feb 25 2016 Dave Anderson - 2.0-10 +- Fix for ftrace symbol name changes in Linux 4.2 + Resolves: rhbz#1265553 + +* Tue Sep 02 2014 Dave Anderson - 2.0-9 +- Add ppc64le support. + Resolves: rhbz#1123995 + +* Fri Jan 24 2014 Daniel Mach - 2.0-8 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 2.0-7 +- Mass rebuild 2013-12-27 + +* Thu Dec 5 2013 Dave Anderson - 2.0-6 +- Add Linux 3.10 support. + Resolves: rhbz#863833 + +* Tue Nov 12 2013 Dave Anderson - 2.0-5 +- Add ARM64 support. + Resolves: rhbz#1028580 + +* Tue Aug 20 2013 Dave Anderson - 2.0-4 +- crash utility has added LZO and snappy compression in addition to zlib + +* Wed May 29 2013 Dave Anderson - 2.0-3 +- Replace obsolete _init() and _fini() functions. +- Fix possible segmentation violation on calloc() failure. +- Initialize trace_dat to avoid compiler warning. + +* Mon Nov 26 2012 Dave Anderson - 2.0-2 +- trace-cmd package required +- rpmlint cleanups to this file +- fix compiler warnings for trace.c + +* Wed Nov 21 2012 Qiao Nuohan - 2.0-1 +- update code + Resolves: rhbz#863833 + +* Wed Feb 8 2012 Dave Anderson - 1.0-4 +- Build with RPM_OPT_FLAGS. + Resolves: rhbz#729018 + +* Wed Jun 9 2010 Dave Anderson - 1.0-3 +- Remove trace_dump.patch, which requires a kernel later than + the RHEL6 base of 2.6.32. + Resolves: rbhz#601536 + +* Mon May 24 2010 Dave Anderson - 1.0-2 +- Fix for segmentation violation with "trace show -c cpu" command, + and add "trace dump -t" command. + Resolves: rbhz#592887 + +* Wed Dec 09 2009 Dave Anderson - 1.0-1.2 +- fix Makefile to account for s390 build +- change exclusive arch entry from i386 to {ix86} +- Resolves: rbhz#545564 + +* Tue Dec 08 2009 Dennis Gregorovic - 1.0-1.1 +- Rebuilt for RHEL 6 + +* Fri Sep 25 2009 Dave Anderson +- Initial crash-trace-command package +