Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package kdumpid for openSUSE:Factory checked 
in at 2022-08-16 17:08:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kdumpid (Old)
 and      /work/SRC/openSUSE:Factory/.kdumpid.new.1521 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kdumpid"

Tue Aug 16 17:08:07 2022 rev:2 rq:996781 version:1.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/kdumpid/kdumpid.changes  2022-04-20 
17:03:43.847169880 +0200
+++ /work/SRC/openSUSE:Factory/.kdumpid.new.1521/kdumpid.changes        
2022-08-16 17:08:08.555949670 +0200
@@ -1,0 +2,7 @@
+Tue Aug 16 09:20:30 UTC 2022 - Petr Tesa????k <[email protected]>
+
+- Fix build with binutils-2.39:
+  * kdumpid-append_insn.patch
+  * kdumpid-binutils-2.39-fix.patch
+
+-------------------------------------------------------------------

New:
----
  kdumpid-append_insn.patch
  kdumpid-binutils-2.39-fix.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kdumpid.spec ++++++
--- /var/tmp/diff_new_pack.IY2Psx/_old  2022-08-16 17:08:09.219951656 +0200
+++ /var/tmp/diff_new_pack.IY2Psx/_new  2022-08-16 17:08:09.223951668 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package kdumpid
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -34,14 +34,16 @@
 URL:            http://sourceforge.net/p/kdumpid
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Source:         %{name}-%{version}.tar.bz2
+Patch1:         %{name}-append_insn.patch
+Patch2:         %{name}-binutils-2.39-fix.patch
 
 %description
 Kdumpid extracts information such as type of dump, architecture
 and kernel version from raw vmcores (Kernel memory dumps).
 
-
 %prep
 %setup
+%autopatch -p1
 
 %build
 make CUSTOM_CFLAGS="${CFLAGS:-%optflags}"

++++++ kdumpid-append_insn.patch ++++++
From: Petr Tesarik <[email protected]>
Date: Tue Aug 16 10:39:16 2022 +0200
Subject: Split off append_insn() from instruction printers
Upstream: yes
Git-commit: 222de76bc6d1dc7acfb094980d266834a6672fbc

This allows to reuse the code.

Signed-off-by: Petr Tesarik <[email protected]>

diff --git a/ppc.c b/ppc.c
index 5a496c4..4a321c4 100644
--- a/ppc.c
+++ b/ppc.c
@@ -40,21 +40,27 @@ static const char sep[] = ", \t\r\n";
 
 static disassembler_ftype print_insn;
 
-static int
-disas_fn(void *data, const char *fmt, ...)
+static void
+append_insn(void *data, const char *fmt, va_list va)
 {
        struct disas_priv *priv = data;
-       va_list va;
        size_t remain;
        int len;
 
-       va_start(va, fmt);
-
        remain = priv->insn + sizeof(priv->insn) - priv->iptr;
        len = vsnprintf(priv->iptr, remain, fmt, va);
        if (len > 0)
                priv->iptr += len;
 
+}
+
+static int
+disas_fn(void *data, const char *fmt, ...)
+{
+       va_list va;
+
+       va_start(va, fmt);
+       append_insn(data, fmt, va);
        va_end(va);
 
        return 0;
diff --git a/ppc64.c b/ppc64.c
index 3d421ac..1542b80 100644
--- a/ppc64.c
+++ b/ppc64.c
@@ -40,21 +40,26 @@ static const char sep[] = ", \t\r\n";
 
 static disassembler_ftype print_insn;
 
-static int
-disas_fn(void *data, const char *fmt, ...)
+static void
+append_insn(void *data, const char *fmt, va_list va)
 {
        struct disas_priv *priv = data;
-       va_list va;
        size_t remain;
        int len;
 
-       va_start(va, fmt);
-
        remain = priv->insn + sizeof(priv->insn) - priv->iptr;
        len = vsnprintf(priv->iptr, remain, fmt, va);
        if (len > 0)
                priv->iptr += len;
+}
 
+static int
+disas_fn(void *data, const char *fmt, ...)
+{
+       va_list va;
+
+       va_start(va, fmt);
+       append_insn(data, fmt, va);
        va_end(va);
 
        return 0;
diff --git a/s390.c b/s390.c
index bef4e79..15db888 100644
--- a/s390.c
+++ b/s390.c
@@ -45,21 +45,26 @@ static const char sep[] = ", \t\r\n";
 
 static disassembler_ftype print_insn;
 
-static int
-disas_fn(void *data, const char *fmt, ...)
+static void
+append_insn(void *data, const char *fmt, va_list va)
 {
        struct disas_priv *priv = data;
-       va_list va;
        size_t remain;
        int len;
 
-       va_start(va, fmt);
-
        remain = priv->insn + sizeof(priv->insn) - priv->iptr;
        len = vsnprintf(priv->iptr, remain, fmt, va);
        if (len > 0)
                priv->iptr += len;
+}
 
+static int
+disas_fn(void *data, const char *fmt, ...)
+{
+       va_list va;
+
+       va_start(va, fmt);
+       append_insn(data, fmt, va);
        va_end(va);
 
        return 0;
diff --git a/x86.c b/x86.c
index ac9bec6..0f69c76 100644
--- a/x86.c
+++ b/x86.c
@@ -37,21 +37,26 @@ static const char sep[] = ", \t\r\n";
 
 static disassembler_ftype print_insn;
 
-static int
-disas_fn(void *data, const char *fmt, ...)
+static void
+append_insn(void *data, const char *fmt, va_list va)
 {
        struct disas_priv *priv = data;
-       va_list va;
        size_t remain;
        int len;
 
-       va_start(va, fmt);
-
        remain = priv->insn + sizeof(priv->insn) - priv->iptr;
        len = vsnprintf(priv->iptr, remain, fmt, va);
        if (len > 0)
                priv->iptr += len;
+}
 
+static int
+disas_fn(void *data, const char *fmt, ...)
+{
+       va_list va;
+
+       va_start(va, fmt);
+       append_insn(data, fmt, va);
        va_end(va);
 
        return 0;

++++++ kdumpid-binutils-2.39-fix.patch ++++++
From: Petr Tesarik <[email protected]>
Date: Tue Aug 16 11:09:11 2022 +0200
Subject: Fix build with binutils-2.39
Upstream: yes
Git-commit: beb8ea652e0cd313be781cf16b9f378715fe15fd

binutils commit 60a3da00bd5407f07d64dff82a4dae98230dfaac added a
new parameter to init_disassemble_info().

Check this change at build time. Note that this is the kind of
check that GNU Autoconf was invented for, but let's try to keep
this dinosaur away from this project for some more more.

Signed-off-by: Petr Tesarik <[email protected]>

diff --git a/Makefile b/Makefile
index 0bc4f65..b44dc88 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,9 @@ COMPRESS=bzip2 -9
 VER_MAJOR=1
 VER_MINOR=3
 
-CFLAGS=-DVER_MAJOR=$(VER_MAJOR) -DVER_MINOR=$(VER_MINOR)
+CDEFS:=$(shell ./cdefs.sh)
+
+CFLAGS=-DVER_MAJOR=$(VER_MAJOR) -DVER_MINOR=$(VER_MINOR) $(CDEFS)
 
 ifndef INSTALL
 INSTALL=/usr/bin/install
diff --git a/cdefs.sh b/cdefs.sh
new file mode 100755
index 0000000..c2d3de6
--- /dev/null
+++ b/cdefs.sh
@@ -0,0 +1,17 @@
+#! /bin/sh
+tmpdir=$(mktemp -d)
+trap 'rm -rf "$tmpdir"' EXIT
+cd "$tmpdir"
+
+cat > dis_asm.c <<EOF
+#include <dis-asm.h>
+void fn(struct disassemble_info *info, void *stream,
+        fprintf_ftype fprintf_func, fprintf_styled_ftype fprintf_styled_func)
+{
+  init_disassemble_info(info, stream, fprintf_func, fprintf_styled_func);
+}
+EOF
+if make dis_asm.o &> /dev/null
+then
+    echo "-DDIS_ASM_STYLED_PRINTF"
+fi
diff --git a/ppc.c b/ppc.c
index 4a321c4..8d460ae 100644
--- a/ppc.c
+++ b/ppc.c
@@ -66,6 +66,23 @@ disas_fn(void *data, const char *fmt, ...)
        return 0;
 }
 
+#ifdef DIS_ASM_STYLED_PRINTF
+
+static int
+disas_styled_fn(void *data, enum disassembler_style style,
+               const char *fmt, ...)
+{
+       va_list va;
+
+       va_start(va, fmt);
+       append_insn(data, fmt, va);
+       va_end(va);
+
+       return 0;
+}
+
+#endif /* DIS_ASM_STYLED_PRINTF */
+
 static void error_func(int status, bfd_vma memaddr,
                       struct disassemble_info *dinfo)
 {
@@ -123,7 +140,11 @@ looks_like_kcode_ppc(struct dump_desc *dd, uint64_t addr)
                return -1;
 
        memset(&priv, 0, sizeof priv);
+#ifdef DIS_ASM_STYLED_PRINTF
+       init_disassemble_info(&info, &priv, disas_fn, disas_styled_fn);
+#else
        init_disassemble_info(&info, &priv, disas_fn);
+#endif
        info.memory_error_func = error_func;
        info.buffer        = dd->page;
        info.buffer_vma    = addr;
diff --git a/ppc64.c b/ppc64.c
index 1542b80..67a912f 100644
--- a/ppc64.c
+++ b/ppc64.c
@@ -65,6 +65,23 @@ disas_fn(void *data, const char *fmt, ...)
        return 0;
 }
 
+#ifdef DIS_ASM_STYLED_PRINTF
+
+static int
+disas_styled_fn(void *data, enum disassembler_style style,
+               const char *fmt, ...)
+{
+       va_list va;
+
+       va_start(va, fmt);
+       append_insn(data, fmt, va);
+       va_end(va);
+
+       return 0;
+}
+
+#endif /* DIS_ASM_STYLED_PRINTF */
+
 static void
 print_address(bfd_vma addr, struct disassemble_info *info)
 {
@@ -138,7 +155,11 @@ looks_like_kcode_ppc64(struct dump_desc *dd, uint64_t addr)
                return -1;
 
        memset(&priv, 0, sizeof priv);
+#ifdef DIS_ASM_STYLED_PRINTF
+       init_disassemble_info(&info, &priv, disas_fn, disas_styled_fn);
+#else
        init_disassemble_info(&info, &priv, disas_fn);
+#endif
        info.print_address_func = print_address;
        info.memory_error_func = error_func;
        info.buffer        = dd->page;
diff --git a/s390.c b/s390.c
index 15db888..fdd23f7 100644
--- a/s390.c
+++ b/s390.c
@@ -70,6 +70,23 @@ disas_fn(void *data, const char *fmt, ...)
        return 0;
 }
 
+#ifdef DIS_ASM_STYLED_PRINTF
+
+static int
+disas_styled_fn(void *data, enum disassembler_style style,
+               const char *fmt, ...)
+{
+       va_list va;
+
+       va_start(va, fmt);
+       append_insn(data, fmt, va);
+       va_end(va);
+
+       return 0;
+}
+
+#endif /* DIS_ASM_STYLED_PRINTF */
+
 static void error_func(int status, bfd_vma memaddr,
                       struct disassemble_info *dinfo)
 {
@@ -128,7 +145,11 @@ looks_like_kcode_s390(struct dump_desc *dd, uint64_t addr)
                return -1;
 
        memset(&priv, 0, sizeof priv);
+#ifdef DIS_ASM_STYLED_PRINTF
+       init_disassemble_info(&info, &priv, disas_fn, disas_styled_fn);
+#else
        init_disassemble_info(&info, &priv, disas_fn);
+#endif
        info.memory_error_func = error_func;
        info.buffer        = dd->page;
        info.buffer_vma    = addr + DEFAULT_LOAD_ADDR;
diff --git a/x86.c b/x86.c
index 0f69c76..5c72bbb 100644
--- a/x86.c
+++ b/x86.c
@@ -62,6 +62,23 @@ disas_fn(void *data, const char *fmt, ...)
        return 0;
 }
 
+#ifdef DIS_ASM_STYLED_PRINTF
+
+static int
+disas_styled_fn(void *data, enum disassembler_style style,
+               const char *fmt, ...)
+{
+       va_list va;
+
+       va_start(va, fmt);
+       append_insn(data, fmt, va);
+       va_end(va);
+
+       return 0;
+}
+
+#endif /* DIS_ASM_STYLED_PRINTF */
+
 static void error_func(int status, bfd_vma memaddr,
                       struct disassemble_info *dinfo)
 {
@@ -255,7 +272,11 @@ looks_like_kcode_x86(struct dump_desc *dd, uint64_t addr)
        if (!priv)
                return -1;
 
+#ifdef DIS_ASM_STYLED_PRINTF
+       init_disassemble_info(&info, priv, disas_fn, disas_styled_fn);
+#else
        init_disassemble_info(&info, priv, disas_fn);
+#endif
        info.memory_error_func = error_func;
        info.buffer        = dd->page;
        info.buffer_vma    = addr;

Reply via email to