From fbd0f48232803a84838efe969c9d43cf09f151b01f528766f598d7bbd61bec56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Tesa=C5=99=C3=ADk?= Date: Thu, 13 Apr 2023 14:25:31 +0000 Subject: [PATCH 1/5] Accepting request 1079222 from home:ptesarik:branches:Kernel:kdump - Build the crash extension. - Package the eppic code. - eppic-crash-INCDIR.patch: Use make variable INCDIR to find crash include files. - eppic-Fix-eppic_getnxtfct.patch: Fix name length condition in eppic_getnxtfct(). - Switch upstream branch to v5.0. - Update to commit e0a3b03 o Assorted bug fixes. OBS-URL: https://build.opensuse.org/request/show/1079222 OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/eppic?expand=0&rev=28 --- _service | 9 +-- eppic-4.99.git.1675952960.e0a3b03.tar.xz | 3 + eppic-Fix-eppic_getnxtfct.patch | 25 ++++++ eppic-crash-INCDIR.patch | 34 ++++++++ eppic-rpmlintrc | 2 + eppic.changes | 21 +++++ eppic.spec | 81 ++++++++++++++++++-- libeppic-3.99.git.1612358888.e8844d3.tar.bz2 | 3 - 8 files changed, 162 insertions(+), 16 deletions(-) create mode 100644 eppic-4.99.git.1675952960.e0a3b03.tar.xz create mode 100644 eppic-Fix-eppic_getnxtfct.patch create mode 100644 eppic-crash-INCDIR.patch create mode 100644 eppic-rpmlintrc delete mode 100644 libeppic-3.99.git.1612358888.e8844d3.tar.bz2 diff --git a/_service b/_service index 1e855c0..c70c360 100644 --- a/_service +++ b/_service @@ -2,13 +2,12 @@ git https://github.com/lucchouina/eppic.git - libeppic - libeppic - 3.99.git + refs/heads/v5.0 + 4.99.git - libeppic-*.tar - bz2 + eppic-*.tar + xz diff --git a/eppic-4.99.git.1675952960.e0a3b03.tar.xz b/eppic-4.99.git.1675952960.e0a3b03.tar.xz new file mode 100644 index 0000000..4946ffb --- /dev/null +++ b/eppic-4.99.git.1675952960.e0a3b03.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6bbe3d834c7307617bb7d90da7e3a1bedc395e99dff7f3859d4407c2aaaa0a6c +size 90596 diff --git a/eppic-Fix-eppic_getnxtfct.patch b/eppic-Fix-eppic_getnxtfct.patch new file mode 100644 index 0000000..d797072 --- /dev/null +++ b/eppic-Fix-eppic_getnxtfct.patch @@ -0,0 +1,25 @@ +From: Petr Tesarik +Date: Thu, 13 Apr 2023 11:54:25 +0200 +Subject: Fix name length condition in eppic_getnxtfct() +Upstream: sent, https://github.com/lucchouina/eppic/pull/9 + +Comparisons like 'A > B > C' do not have their mathematical meaning. +Instead, 'MAX_SYMNAMELEN-5 > l' evaluates to 0 or 1, which is never +greater than 5, and the condition is always false. +--- + libeppic/eppic_func.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libeppic/eppic_func.c b/libeppic/eppic_func.c +index 7912b34..b0a73c7 100644 +--- a/libeppic/eppic_func.c ++++ b/libeppic/eppic_func.c +@@ -776,7 +776,7 @@ eppic_getnxtfct(void) + + int l=strlen(nxtfunc->name); + +- if(MAX_SYMNAMELEN-5 > l > 5 ) { ++ if(MAX_SYMNAMELEN-5 > l && l > 5 ) { + + if(!strcmp(nxtfunc->name+l-5, "_help")) { + diff --git a/eppic-crash-INCDIR.patch b/eppic-crash-INCDIR.patch new file mode 100644 index 0000000..a52397f --- /dev/null +++ b/eppic-crash-INCDIR.patch @@ -0,0 +1,34 @@ +From: Petr Tesarik +Date: Thu, 13 Apr 2023 14:25:40 +0200 +Subject: Use make variable INCDIR to find crash include files +Upstream: sent, https://github.com/lucchouina/eppic/pull/10 + +This makes no difference when built from within the crash source +tree, but it allows to override the directory from the make command +line when building the extension separately. +--- + applications/crash/eppic.mk | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/applications/crash/eppic.mk ++++ b/applications/crash/eppic.mk +@@ -9,6 +9,8 @@ + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + ++INCDIR=.. ++ + ifeq ($(TARGET), PPC64) + TARGET_FLAGS = -D$(TARGET) -m64 + else +@@ -26,8 +28,8 @@ all: + lib-eppic: + cd libeppic && make + +-eppic.so: ../defs.h eppic.c lib-eppic +- gcc -g -Ilibeppic -I.. -nostartfiles -shared -rdynamic -o eppic.so eppic.c -fPIC $(TARGET_FLAGS) $(GDB_FLAGS) -Llibeppic -leppic ++eppic.so: $(INCDIR)/defs.h eppic.c lib-eppic ++ gcc -g -Ilibeppic -I$(INCDIR) -nostartfiles -shared -rdynamic -o eppic.so eppic.c -fPIC $(TARGET_FLAGS) $(GDB_FLAGS) -Llibeppic -leppic + + clean: + cd libeppic && make clean diff --git a/eppic-rpmlintrc b/eppic-rpmlintrc new file mode 100644 index 0000000..d9877a3 --- /dev/null +++ b/eppic-rpmlintrc @@ -0,0 +1,2 @@ +# These files are interpreted by the eppic extension at run-time +addFilter("devel-file-in-non-devel-package .*/usr/share/eppic/crash.*") diff --git a/eppic.changes b/eppic.changes index 0c5e822..ce5a0a1 100644 --- a/eppic.changes +++ b/eppic.changes @@ -1,3 +1,24 @@ +------------------------------------------------------------------- +Thu Apr 13 14:03:26 UTC 2023 - Petr Tesařík + +- Build the crash extension. +- Package the eppic code. +- eppic-crash-INCDIR.patch: Use make variable INCDIR to find crash + include files. + +------------------------------------------------------------------- +Thu Apr 13 09:59:44 UTC 2023 - Petr Tesařík + +- eppic-Fix-eppic_getnxtfct.patch: Fix name length condition in + eppic_getnxtfct(). + +------------------------------------------------------------------- +Thu Apr 13 09:35:52 UTC 2023 - Petr Tesařík + +- Switch upstream branch to v5.0. +- Update to commit e0a3b03 + o Assorted bug fixes. + ------------------------------------------------------------------- Wed Feb 3 13:57:25 UTC 2021 - Petr Tesařík diff --git a/eppic.spec b/eppic.spec index 0045f7a..3ee1968 100644 --- a/eppic.spec +++ b/eppic.spec @@ -1,7 +1,7 @@ # # spec file for package eppic # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,14 +17,18 @@ Name: eppic -Version: 3.99.git.1612358888.e8844d3 +Version: 4.99.git.1675952960.e0a3b03 Release: 0 Summary: Embeddable Pre-Processor and Interpreter for C License: GPL-2.0-or-later Group: Development/Libraries/C and C++ -Source: lib%{name}-%{version}.tar.bz2 +Source: %{name}-%{version}.tar.xz +Source99: %{name}-rpmlintrc Patch1: %{name}-fix-install.patch +Patch2: %{name}-Fix-eppic_getnxtfct.patch +Patch3: %{name}-crash-INCDIR.patch BuildRequires: bison +BuildRequires: crash-devel BuildRequires: flex BuildRequires: ncurses-devel URL: https://github.com/lucchouina/eppic @@ -41,6 +45,10 @@ embedded in any tools that is C friendly. Summary: EPPIC include files and libraries Group: Development/Languages/C and C++ +%package -n crash-eppic +Summary: The eppic extension for crash +Group: Development/Tools/Debuggers + %description -n libeppic-devel EPPIC is a C interpreter that permits easy access to the symbol and type information stored in a executable image like a coredump or live memory @@ -50,24 +58,81 @@ embedded in any tools that is C friendly. This package provides the include files and libraries needed for development. +%description -n crash-eppic +EPPIC is a C interpreter that permits easy access to the symbol and type +information stored in a executable image like a coredump or live memory +interfaces (e.g. /dev/kmem, /dev/mem). Although it has a strong association +with live or postmortem kernel analysis, it is not constraint to it and can be +embedded in any tools that is C friendly. + +This package provides the extension for the crash utility. + %prep -%setup -n lib%{name}-%{version} -%patch1 -p2 +%setup +%autopatch -p1 %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects -make CFLAGS="%{optflags} -fPIC" %{?_smp_mflags} +make -C libeppic CFLAGS="%{optflags} -fPIC" %{?_smp_mflags} + +case `uname -m` in + aarch64) + TARGET=ARM64 + TARGET_CFLAGS= + ;; + arm*) + TARGET=ARM + TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64 + ;; + i?86) + TARGET=X86 + TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64 + ;; + ia64) + TARGET=IA64 + TARGET_CFLAGS= + ;; + ppc64|ppc64le) + TARGET=PPC64 + TARGET_CFLAGS=-m64 + ;; + s390x) + TARGET=S390X + TARGET_CFLAGS= + ;; + s390) + TARGET=S390 + TARGET_CFLAGS= + ;; + x86_64) + TARGET=X86_64 + TARGET_CFLAGS= + ;; +esac +export TARGET TARGET_CFLAGS +ln -snf ../../libeppic applications/crash/ +make -C applications/crash -f eppic.mk INCDIR=/usr/include/crash eppic.so %install mkdir -p %{buildroot}%{_libdir} mkdir -p %{buildroot}%{_includedir} -make ROOT="%{buildroot}" LIBDIR=%{_libdir} install +make -C libeppic ROOT="%{buildroot}" LIBDIR=%{_libdir} install + +mkdir -p %{buildroot}%{_libdir}/crash/extensions +install -m 0644 applications/crash/eppic.so %{buildroot}%{_libdir}/crash/extensions +install -d -m 0755 %{buildroot}%{_datadir}/eppic +cp -r applications/crash/code %{buildroot}%{_datadir}/eppic/crash %files -n libeppic-devel %defattr(-,root,root) -%doc README +%doc libeppic/README.md %{_includedir}/eppic.h %{_includedir}/eppic_api.h %attr(644,root,root) %{_libdir}/libeppic.a +%files -n crash-eppic +%doc applications/crash/README.code +%{_libdir}/crash/extensions/eppic.so +%{_datadir}/eppic + %changelog diff --git a/libeppic-3.99.git.1612358888.e8844d3.tar.bz2 b/libeppic-3.99.git.1612358888.e8844d3.tar.bz2 deleted file mode 100644 index c6957e3..0000000 --- a/libeppic-3.99.git.1612358888.e8844d3.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:02211c62e9d9e72a35571ace192d6b6d06be6f67c5e666130d9b9299ee7e3dcb -size 71203 From 0d5f5dc470a8511cf7a17f0a3524eeb177549d24c2e5dc6495f95b21bc52e61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Tesa=C5=99=C3=ADk?= Date: Mon, 24 Apr 2023 08:50:21 +0000 Subject: [PATCH 2/5] Accepting request 1082392 from home:ptesarik:branches:Kernel:kdump - Update to c294e5bf89cab01f3c5316474cfc5104af7e6a60 o Build on RISC-V 64 and 32-bit Arm and IBM POWER. - Drop upstreamed patches: o eppic-Fix-eppic_getnxtfct.patch o eppic-crash-INCDIR.patch OBS-URL: https://build.opensuse.org/request/show/1082392 OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/eppic?expand=0&rev=29 --- eppic-4.99.git.1675952960.e0a3b03.tar.xz | 3 --- eppic-4.99.git.1682279748.c294e5b.tar.xz | 3 +++ eppic-Fix-eppic_getnxtfct.patch | 25 ----------------- eppic-crash-INCDIR.patch | 34 ------------------------ eppic.changes | 9 +++++++ eppic.spec | 4 +-- 6 files changed, 13 insertions(+), 65 deletions(-) delete mode 100644 eppic-4.99.git.1675952960.e0a3b03.tar.xz create mode 100644 eppic-4.99.git.1682279748.c294e5b.tar.xz delete mode 100644 eppic-Fix-eppic_getnxtfct.patch delete mode 100644 eppic-crash-INCDIR.patch diff --git a/eppic-4.99.git.1675952960.e0a3b03.tar.xz b/eppic-4.99.git.1675952960.e0a3b03.tar.xz deleted file mode 100644 index 4946ffb..0000000 --- a/eppic-4.99.git.1675952960.e0a3b03.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6bbe3d834c7307617bb7d90da7e3a1bedc395e99dff7f3859d4407c2aaaa0a6c -size 90596 diff --git a/eppic-4.99.git.1682279748.c294e5b.tar.xz b/eppic-4.99.git.1682279748.c294e5b.tar.xz new file mode 100644 index 0000000..f61d90d --- /dev/null +++ b/eppic-4.99.git.1682279748.c294e5b.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4d86e6abce78f905a755229fc2644d9e33a1b511931ec1b04d45b7ef45af8d4 +size 90812 diff --git a/eppic-Fix-eppic_getnxtfct.patch b/eppic-Fix-eppic_getnxtfct.patch deleted file mode 100644 index d797072..0000000 --- a/eppic-Fix-eppic_getnxtfct.patch +++ /dev/null @@ -1,25 +0,0 @@ -From: Petr Tesarik -Date: Thu, 13 Apr 2023 11:54:25 +0200 -Subject: Fix name length condition in eppic_getnxtfct() -Upstream: sent, https://github.com/lucchouina/eppic/pull/9 - -Comparisons like 'A > B > C' do not have their mathematical meaning. -Instead, 'MAX_SYMNAMELEN-5 > l' evaluates to 0 or 1, which is never -greater than 5, and the condition is always false. ---- - libeppic/eppic_func.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libeppic/eppic_func.c b/libeppic/eppic_func.c -index 7912b34..b0a73c7 100644 ---- a/libeppic/eppic_func.c -+++ b/libeppic/eppic_func.c -@@ -776,7 +776,7 @@ eppic_getnxtfct(void) - - int l=strlen(nxtfunc->name); - -- if(MAX_SYMNAMELEN-5 > l > 5 ) { -+ if(MAX_SYMNAMELEN-5 > l && l > 5 ) { - - if(!strcmp(nxtfunc->name+l-5, "_help")) { - diff --git a/eppic-crash-INCDIR.patch b/eppic-crash-INCDIR.patch deleted file mode 100644 index a52397f..0000000 --- a/eppic-crash-INCDIR.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Petr Tesarik -Date: Thu, 13 Apr 2023 14:25:40 +0200 -Subject: Use make variable INCDIR to find crash include files -Upstream: sent, https://github.com/lucchouina/eppic/pull/10 - -This makes no difference when built from within the crash source -tree, but it allows to override the directory from the make command -line when building the extension separately. ---- - applications/crash/eppic.mk | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - ---- a/applications/crash/eppic.mk -+++ b/applications/crash/eppic.mk -@@ -9,6 +9,8 @@ - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - # GNU General Public License for more details. - -+INCDIR=.. -+ - ifeq ($(TARGET), PPC64) - TARGET_FLAGS = -D$(TARGET) -m64 - else -@@ -26,8 +28,8 @@ all: - lib-eppic: - cd libeppic && make - --eppic.so: ../defs.h eppic.c lib-eppic -- gcc -g -Ilibeppic -I.. -nostartfiles -shared -rdynamic -o eppic.so eppic.c -fPIC $(TARGET_FLAGS) $(GDB_FLAGS) -Llibeppic -leppic -+eppic.so: $(INCDIR)/defs.h eppic.c lib-eppic -+ gcc -g -Ilibeppic -I$(INCDIR) -nostartfiles -shared -rdynamic -o eppic.so eppic.c -fPIC $(TARGET_FLAGS) $(GDB_FLAGS) -Llibeppic -leppic - - clean: - cd libeppic && make clean diff --git a/eppic.changes b/eppic.changes index ce5a0a1..628e2f2 100644 --- a/eppic.changes +++ b/eppic.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Apr 24 08:26:22 UTC 2023 - Petr Tesařík + +- Update to c294e5bf89cab01f3c5316474cfc5104af7e6a60 + o Build on 32-bit Arm and RISC-V. +- Drop upstreamed patches: + o eppic-Fix-eppic_getnxtfct.patch + o eppic-crash-INCDIR.patch + ------------------------------------------------------------------- Thu Apr 13 14:03:26 UTC 2023 - Petr Tesařík diff --git a/eppic.spec b/eppic.spec index 3ee1968..a80c43c 100644 --- a/eppic.spec +++ b/eppic.spec @@ -17,7 +17,7 @@ Name: eppic -Version: 4.99.git.1675952960.e0a3b03 +Version: 4.99.git.1682279748.c294e5b Release: 0 Summary: Embeddable Pre-Processor and Interpreter for C License: GPL-2.0-or-later @@ -25,8 +25,6 @@ Group: Development/Libraries/C and C++ Source: %{name}-%{version}.tar.xz Source99: %{name}-rpmlintrc Patch1: %{name}-fix-install.patch -Patch2: %{name}-Fix-eppic_getnxtfct.patch -Patch3: %{name}-crash-INCDIR.patch BuildRequires: bison BuildRequires: crash-devel BuildRequires: flex From 879efeb49776d36be93baad6ae75f955bfef53a4e71772763173fa12dc25fb7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Tesa=C5=99=C3=ADk?= Date: Mon, 24 Apr 2023 09:18:25 +0000 Subject: [PATCH 3/5] Fix build on 32-bit POWER OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/eppic?expand=0&rev=30 --- eppic.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eppic.spec b/eppic.spec index a80c43c..9d79c30 100644 --- a/eppic.spec +++ b/eppic.spec @@ -90,6 +90,10 @@ case `uname -m` in TARGET=IA64 TARGET_CFLAGS= ;; + powerpc) + TARGET=PPC + TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64 + ;; ppc64|ppc64le) TARGET=PPC64 TARGET_CFLAGS=-m64 From ff06e9473feebef62c58f0f1712ce1bdb3b1d072cf14dca7f7c597853d93ef6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Tesa=C5=99=C3=ADk?= Date: Mon, 24 Apr 2023 09:20:25 +0000 Subject: [PATCH 4/5] o Build on RISC-V64 and 32-bit Arm and IBM POWER. OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/eppic?expand=0&rev=31 --- eppic.changes | 2 +- eppic.spec | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/eppic.changes b/eppic.changes index 628e2f2..a9b108b 100644 --- a/eppic.changes +++ b/eppic.changes @@ -2,7 +2,7 @@ Mon Apr 24 08:26:22 UTC 2023 - Petr Tesařík - Update to c294e5bf89cab01f3c5316474cfc5104af7e6a60 - o Build on 32-bit Arm and RISC-V. + o Build on RISC-V64 and 32-bit Arm and IBM POWER. - Drop upstreamed patches: o eppic-Fix-eppic_getnxtfct.patch o eppic-crash-INCDIR.patch diff --git a/eppic.spec b/eppic.spec index 9d79c30..34a9b7b 100644 --- a/eppic.spec +++ b/eppic.spec @@ -98,12 +98,16 @@ case `uname -m` in TARGET=PPC64 TARGET_CFLAGS=-m64 ;; - s390x) - TARGET=S390X + riscv64) + TARGET=RISCV64 TARGET_CFLAGS= ;; s390) TARGET=S390 + TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64 + ;; + s390x) + TARGET=S390X TARGET_CFLAGS= ;; x86_64) From 34ad8965ff54f6ba943acc5833771e3a2c7c85a38f0848fbbab71620130ca9bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Tesa=C5=99=C3=ADk?= Date: Mon, 24 Apr 2023 15:59:01 +0000 Subject: [PATCH 5/5] Check correct `uname -m` output for 32-bit powerpc. OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/eppic?expand=0&rev=32 --- eppic.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eppic.spec b/eppic.spec index 34a9b7b..4d8e6dd 100644 --- a/eppic.spec +++ b/eppic.spec @@ -90,7 +90,7 @@ case `uname -m` in TARGET=IA64 TARGET_CFLAGS= ;; - powerpc) + ppc) TARGET=PPC TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64 ;;