From 7f59063f3e054df37ff4a480cd581ac6f901a7f4 Mon Sep 17 00:00:00 2001 From: Lianbo Jiang Date: Mon, 6 Dec 2021 11:36:29 +0800 Subject: [PATCH] Enable ZSTD feature Release: crash-8.0.0-3 Signed-off-by: Lianbo Jiang --- crash-8.0.0_build.patch | 20 ++++++++---------- crash.spec | 9 +++++--- lzo_snappy.patch => lzo_snappy_zstd.patch | 25 ++++++++++++----------- 3 files changed, 28 insertions(+), 26 deletions(-) rename lzo_snappy.patch => lzo_snappy_zstd.patch (78%) diff --git a/crash-8.0.0_build.patch b/crash-8.0.0_build.patch index 12cb747..d857d7f 100644 --- a/crash-8.0.0_build.patch +++ b/crash-8.0.0_build.patch @@ -1,8 +1,6 @@ -diff --git crash-8.0.0/Makefile crash-8.0.0/Makefile -index d0574d8f07d3..9dbb61d0dbc8 100644 ---- crash-8.0.0/Makefile +--- crash-8.0.0/Makefile.orig +++ crash-8.0.0/Makefile -@@ -198,7 +198,7 @@ GDB_FLAGS= +@@ -203,7 +203,7 @@ GDB_FLAGS= # TARGET_CFLAGS will be configured automatically by configure TARGET_CFLAGS= @@ -11,20 +9,18 @@ index d0574d8f07d3..9dbb61d0dbc8 100644 GPL_FILES= TAR_FILES=${SOURCE_FILES} Makefile ${GPL_FILES} README .rh_rpm_package crash.8 \ -@@ -228,7 +228,7 @@ all: make_configure +@@ -233,7 +233,7 @@ all: make_configure gdb_merge: force @if [ ! -f ${GDB}/README ]; then \ make --no-print-directory gdb_unzip; fi -- @echo "${LDFLAGS} -lz -llzo2 -lsnappy -ldl -rdynamic" > ${GDB}/gdb/mergelibs -+ @echo "${LDFLAGS} -lz -llzo2 -lsnappy -ldl -rdynamic -Wl,-z,now -fPIE" > ${GDB}/gdb/mergelibs +- @echo "${LDFLAGS} -lz -llzo2 -lsnappy -lzstd -ldl -rdynamic" > ${GDB}/gdb/mergelibs ++ @echo "${LDFLAGS} -lz -llzo2 -lsnappy -lzstd -ldl -rdynamic -Wl,-z,now -fPIE" > ${GDB}/gdb/mergelibs @echo "../../${PROGRAM} ../../${PROGRAM}lib.a" > ${GDB}/gdb/mergeobj @rm -f ${PROGRAM} @if [ ! -f ${GDB}/config.status ]; then \ -diff --git crash-8.0.0/configure.c crash-8.0.0/configure.c -index 75006e881f5a..06c94d58c56c 100644 ---- crash-8.0.0/configure.c +--- crash-8.0.0/configure.c.orig +++ crash-8.0.0/configure.c -@@ -780,7 +780,8 @@ build_configure(struct supported_gdb_version *sp) +@@ -810,7 +810,8 @@ build_configure(struct supported_gdb_version *sp) fprintf(fp2, "%s\n", sp->GDB); sprintf(target_data.gdb_version, "%s", &sp->GDB[4]); } else if (strncmp(buf, "LDFLAGS=", strlen("LDFLAGS=")) == 0) { @@ -33,3 +29,5 @@ index 75006e881f5a..06c94d58c56c 100644 + fprintf(fp2, "LDFLAGS=%s\n", ldflags ? ldflags : ""); } else fprintf(fp2, "%s", buf); + + diff --git a/crash.spec b/crash.spec index 15285b5..ddb3614 100644 --- a/crash.spec +++ b/crash.spec @@ -4,7 +4,7 @@ Summary: Kernel analysis utility for live systems, netdump, diskdump, kdump, LKCD or mcore dumpfiles Name: crash Version: 8.0.0 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3 Source0: https://github.com/crash-utility/crash/archive/crash-%{version}.tar.gz Source1: http://ftp.gnu.org/gnu/gdb/gdb-10.2.tar.gz @@ -17,7 +17,7 @@ BuildRequires: make Requires: binutils Provides: bundled(libiberty) Provides: bundled(gdb) = 10.2 -Patch0: lzo_snappy.patch +Patch0: lzo_snappy_zstd.patch Patch1: crash-8.0.0_build.patch %description @@ -38,7 +38,7 @@ offered by Mission Critical Linux, or the LKCD kernel patch. %prep %setup -n %{name}-%{version} -q -%patch0 -p1 -b lzo_snappy.patch +%patch0 -p1 -b lzo_snappy_zstd.patch %patch1 -p1 -b crash-8.0.0_build.patch %build @@ -65,6 +65,9 @@ cp -p defs.h %{buildroot}%{_includedir}/crash %{_includedir}/* %changelog +* Mon Dec 06 2021 Lianbo Jiang - 8.0.0-3 +- Enable ZSTD feature + * Fri Nov 26 2021 Lianbo Jiang - 8.0.0-2 - Enable LTO and Hardened package diff --git a/lzo_snappy.patch b/lzo_snappy_zstd.patch similarity index 78% rename from lzo_snappy.patch rename to lzo_snappy_zstd.patch index 8bc57a9..87b51fe 100644 --- a/lzo_snappy.patch +++ b/lzo_snappy_zstd.patch @@ -1,22 +1,23 @@ +--- crash-8.0.0/Makefile.orig ++++ crash-8.0.0/Makefile +@@ -233,7 +233,7 @@ all: make_configure + gdb_merge: force + @if [ ! -f ${GDB}/README ]; then \ + make --no-print-directory gdb_unzip; fi +- @echo "${LDFLAGS} -lz -ldl -rdynamic" > ${GDB}/gdb/mergelibs ++ @echo "${LDFLAGS} -lz -llzo2 -lsnappy -lzstd -ldl -rdynamic" > ${GDB}/gdb/mergelibs + @echo "../../${PROGRAM} ../../${PROGRAM}lib.a" > ${GDB}/gdb/mergeobj + @rm -f ${PROGRAM} + @if [ ! -f ${GDB}/config.status ]; then \ --- crash-8.0.0/diskdump.c.orig +++ crash-8.0.0/diskdump.c -@@ -23,6 +23,8 @@ +@@ -23,6 +23,9 @@ * GNU General Public License for more details. */ +#define LZO +#define SNAPPY ++#define ZSTD #include "defs.h" #include "diskdump.h" #include "xen_dom0.h" ---- crash-8.0.0/Makefile.orig -+++ crash-8.0.0/Makefile -@@ -228,7 +228,7 @@ all: make_configure - gdb_merge: force - @if [ ! -f ${GDB}/README ]; then \ - make --no-print-directory gdb_unzip; fi -- @echo "${LDFLAGS} -lz -ldl -rdynamic" > ${GDB}/gdb/mergelibs -+ @echo "${LDFLAGS} -lz -llzo2 -lsnappy -ldl -rdynamic" > ${GDB}/gdb/mergelibs - @echo "../../${PROGRAM} ../../${PROGRAM}lib.a" > ${GDB}/gdb/mergeobj - @rm -f ${PROGRAM} - @if [ ! -f ${GDB}/config.status ]; then \