summaryrefslogtreecommitdiff
path: root/dev-libs/libkdumpfile
diff options
context:
space:
mode:
Diffstat (limited to 'dev-libs/libkdumpfile')
-rw-r--r--dev-libs/libkdumpfile/Manifest3
-rw-r--r--dev-libs/libkdumpfile/files/libkdumpfile-0.5.5-bfd-include.patch918
-rw-r--r--dev-libs/libkdumpfile/libkdumpfile-0.5.5-r2.ebuild47
3 files changed, 968 insertions, 0 deletions
diff --git a/dev-libs/libkdumpfile/Manifest b/dev-libs/libkdumpfile/Manifest
index eb686da8b31c..5e7b29427f3a 100644
--- a/dev-libs/libkdumpfile/Manifest
+++ b/dev-libs/libkdumpfile/Manifest
@@ -1,6 +1,9 @@
AUX libkdumpfile-0.5.4-32-bit-tests.patch 2197 BLAKE2B 3368b373a0e8e7127bc560fdfa5b370e4a42920c04d18d05a5c60bd29ad6b33703e52e0dcaa886bc91444f5e90a11e3a97e3d64692d26430d48df5c2b43e3c3b SHA512 6cc17ef0214f8fab33e6c36df457a11c2dd1feaa18804e93fde94c7e68fe96ba3ba6869231de3215a38944025741028d696ef679d44dbcbb24d2cd363ea537db
AUX libkdumpfile-0.5.4-c99.patch 1500 BLAKE2B f7879cf9d08660ce89ae3e771c36cbe07a51767288c6dbd36be2e97a795698ca381370f16d7a3ff134b147eb2c5c01efba0bf792c5da7637df6597a355f283a9 SHA512 5b67254f2f113ea6e86a4024917bf02683ae8c9a6757edbc01f26d107ff86ae30dc111285e66513f81e36fe32188b45d52927235198217de40c256ee2effadaa
AUX libkdumpfile-0.5.4-disabled-compression-tests.patch 2006 BLAKE2B b4c8555ca7ea47dc5f842c71dee21967d1044d874538b8f02d30f11e6dc10306ceab52de0b0e0d3e20182234ce0a2c6a2885a528831ca7fda0d4c753620f5848 SHA512 27bcd11b409bc547eaa125736015ca319a9fbaa720b078dc7eec0274ab95302dff231048404957dea5c4cfed2854909faf23df4126efcadb767e44c5926983c4
+AUX libkdumpfile-0.5.5-bfd-include.patch 17521 BLAKE2B 2f900b524e6288cb2bca74f756ff35747704095ed4a9f28931105c24906a1e373c3d771cb9bb43957794348aa16dd3b37fbf9daf9f8187d836d97f598db9a7cf SHA512 9e9837c41815cdb5a7f1ddd9de06904aaf724c62cc1795c0d0a9586a3663f4d204e2971446fbed6ca6571f5fd5894330327081c4a2ac221fda44505faa54bde3
DIST libkdumpfile-0.5.4.tar.bz2 623108 BLAKE2B 17a425c2a0545f60574255d5ec139f60a59dd2c9c047a89f9d021afe31cae959c691b550d9ad4e10c88a11f5f1bab1a4d94dab025060dcd2598837442281b3b9 SHA512 6cdd77e3460b324f4e0641fc8f4cf1dcd8b7de4ec82a37ca11e4edfa7730f90305c2724825f8b1cf8ac2e8ad104fee1b6a36775287b084db802ae2f44a55cd85
+DIST libkdumpfile-0.5.5.tar.bz2 672321 BLAKE2B 41c2044ac7f11ab94b2c80771d28ded5dbd75693d3adffc84a96e9595b1a7b52229cac9ba6622e6715261a877fb7a90de570c791039287e6c44b8fa8e3c9e688 SHA512 35935bab7e7e9d5914b6f20efd545f89d89d7edf74c07e26057fdd07823aa73a87cde7765632289709b071d80501648c9373a202432f64ff469f95dd9a50adf3
EBUILD libkdumpfile-0.5.4-r1.ebuild 1192 BLAKE2B 52aa2fb439d4924da30e7987c069254604371e972d832cebb919a24ed51b8dfb174bcebd58ae6b2d7cada02d0b00c3864262d0a7e3c039e9a132deade418cc28 SHA512 365a38362b7795d9166d00262f3d544b5f00f87376493682431ebac8662bd1d7b3183088aadea09be662e7087c36413d39675aa10ec7d02bcc30da07e165173b
+EBUILD libkdumpfile-0.5.5-r2.ebuild 1047 BLAKE2B 25dc0972851b47a220e019ca35f60540ce169e9c45379abdc0d7e33f97434c518c3451e36669dda071a9181f073e731d1b5f5510d34822c6601edc2dd3746910 SHA512 747156864e23174bce4e05888c387416f6824d2dfb4dc89bae8dfb7395f76fb7056b5456fccc195aa5acd3166e123206dbb28103e5bcf8840bdc409ea16356b0
MISC metadata.xml 326 BLAKE2B 13b23cbf5c4089460907bebe9e73dad724bfea465300417f82d20748779d865459c6791d0a6d27237db88819690b4124235721c555895b3ca0a3aa5fa63ad2cf SHA512 aae2510a5c9a7662d7beaccef7c19b42be69e34bc0a2e6fb7f31d332ec7a5389f38aef97123b2f213bd4bb3376630b6989a6d71785f0198f563f9ce5d05cfdca
diff --git a/dev-libs/libkdumpfile/files/libkdumpfile-0.5.5-bfd-include.patch b/dev-libs/libkdumpfile/files/libkdumpfile-0.5.5-bfd-include.patch
new file mode 100644
index 000000000000..3524a9cd3a93
--- /dev/null
+++ b/dev-libs/libkdumpfile/files/libkdumpfile-0.5.5-bfd-include.patch
@@ -0,0 +1,918 @@
+https://github.com/ptesarik/libkdumpfile/pull/84
+
+From 0afee0c8783978d7a470beedaef672d3b8cce41b Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Thu, 26 Dec 2024 04:25:40 +0000
+Subject: [PATCH 1/3] tools: kdumpid: include config.h before <dis-asm.h>
+
+Before including bfd.h (or any of the headers installed by binutils),
+one has to define PACKAGE_NAME and PACKAGE_VERSION for kind of painful
+reasons described in binutils bug PR14243.
+
+This doesn't show up on some distros as they patch out the #ifdef check
+in the headers, but it does on Gentoo where we don't, at least.
+
+Moreover, we want to include config.h before *any* headers anyway, so
+that e.g. AC_SYSTEM_EXTENSIONS and various other autoconf macros work
+correctly if used.
+
+Bug: https://sourceware.org/PR14243
+--- a/tools/kdumpid/main.c
++++ b/tools/kdumpid/main.c
+@@ -14,6 +14,8 @@
+
+ #define _GNU_SOURCE
+
++#include "config.h"
++
+ #include <stdio.h>
+ #include <errno.h>
+ #include <stdlib.h>
+--- a/tools/kdumpid/ppc.c
++++ b/tools/kdumpid/ppc.c
+@@ -12,6 +12,8 @@
+ * GNU General Public License for more details.
+ */
+
++#include "config.h"
++
+ #include <stdarg.h>
+ #include <string.h>
+
+--- a/tools/kdumpid/ppc64.c
++++ b/tools/kdumpid/ppc64.c
+@@ -12,6 +12,8 @@
+ * GNU General Public License for more details.
+ */
+
++#include "config.h"
++
+ #include <stdarg.h>
+ #include <string.h>
+
+--- a/tools/kdumpid/s390.c
++++ b/tools/kdumpid/s390.c
+@@ -12,6 +12,8 @@
+ * GNU General Public License for more details.
+ */
+
++#include "config.h"
++
+ #include <stdarg.h>
+ #include <string.h>
+
+--- a/tools/kdumpid/search.c
++++ b/tools/kdumpid/search.c
+@@ -12,6 +12,8 @@
+ * GNU General Public License for more details.
+ */
+
++#include "config.h"
++
+ #include <stdlib.h>
+ #include <string.h>
+
+--- a/tools/kdumpid/util.c
++++ b/tools/kdumpid/util.c
+@@ -12,6 +12,8 @@
+ * GNU General Public License for more details.
+ */
+
++#include "config.h"
++
+ #include <string.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+--- a/tools/kdumpid/x86.c
++++ b/tools/kdumpid/x86.c
+@@ -1,3 +1,5 @@
++#include "config.h"
++
+ #include <stdarg.h>
+ #include <stdlib.h>
+ #include <string.h>
+
+From 859fd4f8b192c06857ab5bf3c696b10acf12b162 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Thu, 26 Dec 2024 04:35:16 +0000
+Subject: [PATCH 2/3] Always include addrxlat-priv.h (or config.h) where
+ appropriate
+
+addrxlat-priv.h includes config.h for us, but we should include it first
+to ensure it affects standard headers too given config.h may set feature
+test macros and so on.
+
+Where addrxlat-priv.h is not already used, add config.h instead.
+--- a/src/addrxlat/aarch64.c
++++ b/src/addrxlat/aarch64.c
+@@ -28,10 +28,11 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "addrxlat-priv.h"
++
+ #include <stdlib.h>
+ #include <string.h>
+
+-#include "addrxlat-priv.h"
+ #include <linux/version.h>
+
+ /** Maximum virtual address bits (architectural limit). */
+--- a/src/addrxlat/arm.c
++++ b/src/addrxlat/arm.c
+@@ -28,10 +28,10 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
+-#include <stdint.h>
+-
+ #include "addrxlat-priv.h"
+
++#include <stdint.h>
++
+ /* Maximum physical address bits (architectural limit) */
+ #define PHYSADDR_BITS_MAX 40
+ #define PHYSADDR_MASK ADDR_MASK(PHYSADDR_BITS_MAX)
+--- a/src/addrxlat/ctx.c
++++ b/src/addrxlat/ctx.c
+@@ -28,12 +28,12 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "addrxlat-priv.h"
++
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdarg.h>
+
+-#include "addrxlat-priv.h"
+-
+ /** Maximum length of the static error message. */
+ #define ERRBUF 64
+
+--- a/src/addrxlat/ia32.c
++++ b/src/addrxlat/ia32.c
+@@ -28,12 +28,12 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "addrxlat-priv.h"
++
+ #include <stdint.h>
+ #include <string.h>
+ #include <stdlib.h>
+
+-#include "addrxlat-priv.h"
+-
+ #define PGD_PSE_HIGH_SHIFT 13
+ #define PGD_PSE_HIGH_BITS 8
+ #define PGD_PSE_HIGH_MASK ADDR_MASK(PGD_PSE_HIGH_BITS)
+--- a/src/addrxlat/map.c
++++ b/src/addrxlat/map.c
+@@ -28,11 +28,11 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "addrxlat-priv.h"
++
+ #include <stdlib.h>
+ #include <string.h>
+
+-#include "addrxlat-priv.h"
+-
+ DEFINE_ALIAS(map_new);
+
+ addrxlat_map_t *
+--- a/src/addrxlat/riscv64.c
++++ b/src/addrxlat/riscv64.c
+@@ -28,10 +28,11 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "addrxlat-priv.h"
++
+ #include <stdlib.h>
+ #include <string.h>
+
+-#include "addrxlat-priv.h"
+ #include <linux/version.h>
+
+ /** Maximum physical address bits (architectural limit) */
+--- a/src/addrxlat/step.c
++++ b/src/addrxlat/step.c
+@@ -28,10 +28,10 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
+-#include <string.h>
+-
+ #include "addrxlat-priv.h"
+
++#include <string.h>
++
+ int
+ addrxlat_pteval_shift(addrxlat_pte_format_t fmt)
+ {
+--- a/src/addrxlat/sys.c
++++ b/src/addrxlat/sys.c
+@@ -28,11 +28,11 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "addrxlat-priv.h"
++
+ #include <stdlib.h>
+ #include <string.h>
+
+-#include "addrxlat-priv.h"
+-
+ addrxlat_sys_t *
+ addrxlat_sys_new(void)
+ {
+--- a/src/addrxlat/x86_64.c
++++ b/src/addrxlat/x86_64.c
+@@ -28,10 +28,10 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
+-#include <stdlib.h>
+-
+ #include "addrxlat-priv.h"
+
++#include <stdlib.h>
++
+ /* Maximum physical address bits (architectural limit) */
+ #define PHYSADDR_BITS_MAX 52
+ #define PHYSADDR_MASK ADDR_MASK(PHYSADDR_BITS_MAX)
+--- a/src/errmsg.h
++++ b/src/errmsg.h
+@@ -31,6 +31,8 @@
+ #ifndef _ERRMSG_H
+ #define _ERRMSG_H 1
+
++#include "config.h"
++
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdarg.h>
+--- a/src/list.h
++++ b/src/list.h
+@@ -31,6 +31,8 @@
+ #ifndef _LIST_H
+ #define _LIST_H 1
+
++#include "config.h"
++
+ #include <stddef.h>
+
+ /** Cast a structure field out to the containing structure.
+--- a/src/threads.h
++++ b/src/threads.h
+@@ -31,6 +31,8 @@
+ #ifndef _THREADS_H
+ #define _THREADS_H 1
+
++#include "config.h"
++
+ /* Multi-threading */
+ #if USE_PTHREAD
+
+--- a/tests/diskdump.h
++++ b/tests/diskdump.h
+@@ -29,6 +29,8 @@
+ #ifndef _DISKDUMP_H
+ #define _DISKDUMP_H 1
+
++#include "config.h"
++
+ #include <stdint.h>
+
+ #define MDF_SIGNATURE "makedumpfile"
+--- a/tests/lkcd.h
++++ b/tests/lkcd.h
+@@ -29,6 +29,8 @@
+ #ifndef _LKCD_H
+ #define _LKCD_H 1
+
++#include "config.h"
++
+ #include <stdint.h>
+
+ #define DUMP_MAGIC_NUMBER 0xa8190173618f23edULL
+--- a/tests/sadump.h
++++ b/tests/sadump.h
+@@ -29,6 +29,8 @@
+ #ifndef _SADUMP_H
+ #define _SADUMP_H 1
+
++#include "config.h"
++
+ #include <stdint.h>
+
+ /** Standard EFI time specification. */
+--- a/tests/testutil.h
++++ b/tests/testutil.h
+@@ -29,6 +29,8 @@
+ #ifndef _TESTUTIL_H
+ #define _TESTUTIL_H 1
+
++#include "config.h"
++
+ #include <stdio.h>
+ #include <stdint.h>
+ #include <stdbool.h>
+
+From f2de47962860027889b773da05e876ea0e3d24f9 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Thu, 26 Dec 2024 04:39:23 +0000
+Subject: [PATCH 3/3] Always include testutil.h (or config.h) where appropriate
+
+testutil.h includes config.h for us, but we should include it first
+to ensure it affects standard headers too given config.h may set feature
+test macros and so on.
+
+Where testutil.h is not already used, add config.h instead.
+
+(Same as done earlier for addrxlat-priv.h.)
+--- a/tests/addrmap.c
++++ b/tests/addrmap.c
+@@ -26,12 +26,12 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <libkdumpfile/addrxlat.h>
+
+-#include "testutil.h"
+-
+ static void
+ printmap(const addrxlat_map_t *map)
+ {
+--- a/tests/addrxlat.c
++++ b/tests/addrxlat.c
+@@ -26,6 +26,8 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <ctype.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -33,8 +35,6 @@
+ #include <getopt.h>
+ #include <libkdumpfile/addrxlat.h>
+
+-#include "testutil.h"
+-
+ #define ALLOC_INC 32
+
+ static size_t nentries;
+--- a/tests/attriter.c
++++ b/tests/attriter.c
+@@ -26,12 +26,12 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <string.h>
+ #include <stdio.h>
+ #include <libkdumpfile/kdumpfile.h>
+
+-#include "testutil.h"
+-
+ struct attrdef {
+ const char *name;
+ const char *value;
+--- a/tests/checkattr.c
++++ b/tests/checkattr.c
+@@ -28,6 +28,8 @@
+
+ #define _GNU_SOURCE
+
++#include "testutil.h"
++
+ #include <string.h>
+ #include <ctype.h>
+ #include <stdio.h>
+@@ -37,8 +39,6 @@
+ #include <unistd.h>
+ #include <libkdumpfile/kdumpfile.h>
+
+-#include "testutil.h"
+-
+ static int
+ check_noattr(kdump_ctx_t *ctx, char *key)
+ {
+--- a/tests/clearattr.c
++++ b/tests/clearattr.c
+@@ -26,12 +26,12 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <stdio.h>
+ #include <string.h>
+ #include <libkdumpfile/kdumpfile.h>
+
+-#include "testutil.h"
+-
+ #define ATTRPATH "linux.uts.sysname"
+ #define ATTRVALUE "Linux"
+
+--- a/tests/custom-meth.c
++++ b/tests/custom-meth.c
+@@ -28,12 +28,12 @@
+
+ #define _GNU_SOURCE
+
++#include "testutil.h"
++
+ #include <stdio.h>
+
+ #include <libkdumpfile/addrxlat.h>
+
+-#include "testutil.h"
+-
+ #define STEPS 2
+ #define XOR_VALUE 0xabcd
+ #define OFFSET 0x1111
+--- a/tests/data.c
++++ b/tests/data.c
+@@ -26,13 +26,13 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <string.h>
+ #include <ctype.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+
+-#include "testutil.h"
+-
+ #define ALLOC_INC 4096
+
+ static int
+--- a/tests/dumpdata.c
++++ b/tests/dumpdata.c
+@@ -26,6 +26,8 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+@@ -34,8 +36,6 @@
+ #include <unistd.h>
+ #include <libkdumpfile/kdumpfile.h>
+
+-#include "testutil.h"
+-
+ #define CHUNKSZ 256
+ #define BYTES_PER_LINE 16
+
+--- a/tests/elf-prstatus-mod-x86_64.c
++++ b/tests/elf-prstatus-mod-x86_64.c
+@@ -26,6 +26,8 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <stdint.h>
+ #include <stdio.h>
+ #include <sys/stat.h>
+@@ -35,8 +37,6 @@
+ #include <endian.h>
+ #include <libkdumpfile/kdumpfile.h>
+
+-#include "testutil.h"
+-
+ struct timeval_64 {
+ int64_t tv_sec;
+ int64_t tv_usec;
+--- a/tests/err-addrxlat.c
++++ b/tests/err-addrxlat.c
+@@ -26,6 +26,8 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdlib.h>
+@@ -35,8 +37,6 @@
+
+ #include <libkdumpfile/addrxlat.h>
+
+-#include "testutil.h"
+-
+ /* To test all corner cases, this string should be bigger than
+ * the internal fallback buffer (ERRBUF in addrxlat-priv.h)
+ */
+--- a/tests/fdset.c
++++ b/tests/fdset.c
+@@ -26,13 +26,13 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <libkdumpfile/kdumpfile.h>
+
+-#include "testutil.h"
+-
+ #define FILENAME_0 "fileA"
+ #define FILENAME_1 "fileB"
+
+--- a/tests/mkbinary.c
++++ b/tests/mkbinary.c
+@@ -26,6 +26,8 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <endian.h>
+ #include <getopt.h>
+ #include <stdio.h>
+@@ -33,8 +35,6 @@
+ #include <string.h>
+ #include <ctype.h>
+
+-#include "testutil.h"
+-
+ static int
+ parseheader(struct page_data *pg, char *p)
+ {
+--- a/tests/mkdiskdump.c
++++ b/tests/mkdiskdump.c
+@@ -26,6 +26,9 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "config.h"
++#include "testutil.h"
++
+ #include <string.h>
+ #include <endian.h>
+ #include <sys/time.h>
+@@ -34,8 +37,6 @@
+ #include <ctype.h>
+ #include <errno.h>
+
+-#include "config.h"
+-#include "testutil.h"
+ #include "diskdump.h"
+
+ #if USE_ZLIB
+--- a/tests/mkelf.c
++++ b/tests/mkelf.c
+@@ -26,6 +26,9 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "config.h"
++#include "testutil.h"
++
+ #include <string.h>
+ #include <endian.h>
+ #include <sys/time.h>
+@@ -36,8 +39,6 @@
+ #include <ctype.h>
+ #include <elf.h>
+
+-#include "config.h"
+-#include "testutil.h"
+ #include "diskdump.h"
+
+ typedef int write_fn(FILE *);
+--- a/tests/mklkcd.c
++++ b/tests/mklkcd.c
+@@ -26,6 +26,9 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "config.h"
++#include "testutil.h"
++
+ #include <string.h>
+ #include <endian.h>
+ #include <sys/time.h>
+@@ -33,8 +36,6 @@
+ #include <stdlib.h>
+ #include <ctype.h>
+
+-#include "config.h"
+-#include "testutil.h"
+ #include "lkcd.h"
+
+ #if USE_ZLIB
+--- a/tests/mksadump.c
++++ b/tests/mksadump.c
+@@ -26,6 +26,9 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "config.h"
++#include "testutil.h"
++
+ #include <limits.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -33,8 +36,6 @@
+ #include <ctype.h>
+ #include <time.h>
+
+-#include "config.h"
+-#include "testutil.h"
+ #include "sadump.h"
+
+ #define WS_CHARS " \f\n\r\t\v"
+--- a/tests/multiread.c
++++ b/tests/multiread.c
+@@ -26,6 +26,8 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <time.h>
+@@ -36,8 +38,6 @@
+ #include <pthread.h>
+ #include <libkdumpfile/kdumpfile.h>
+
+-#include "testutil.h"
+-
+ #define DEFITER 1000
+ #define DEFTHREADS 1
+
+--- a/tests/multixlat.c
++++ b/tests/multixlat.c
+@@ -26,6 +26,8 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <time.h>
+@@ -35,8 +37,6 @@
+ #include <unistd.h>
+ #include <libkdumpfile/kdumpfile.h>
+
+-#include "testutil.h"
+-
+ #define CHUNKSZ 256
+ #define BYTES_PER_LINE 16
+
+--- a/tests/nometh.c
++++ b/tests/nometh.c
+@@ -28,12 +28,12 @@
+
+ #define _GNU_SOURCE
+
++#include "testutil.h"
++
+ #include <stdio.h>
+
+ #include <libkdumpfile/addrxlat.h>
+
+-#include "testutil.h"
+-
+ static int
+ setup_pgt(addrxlat_ctx_t *ctx, addrxlat_sys_t *sys)
+ {
+--- a/tests/param.c
++++ b/tests/param.c
+@@ -26,13 +26,13 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <string.h>
+ #include <ctype.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+
+-#include "testutil.h"
+-
+ #define ARRAY_SEPARATORS " \t"
+
+ static char
+--- a/tests/slurp.c
++++ b/tests/slurp.c
+@@ -26,13 +26,13 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <errno.h>
+
+-#include "testutil.h"
+-
+ #define WATERMARK_LOW 256
+ #define WATERMARK_HIGH 1024
+
+--- a/tests/subattr.c
++++ b/tests/subattr.c
+@@ -26,12 +26,12 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <stdio.h>
+ #include <string.h>
+ #include <libkdumpfile/kdumpfile.h>
+
+-#include "testutil.h"
+-
+ #define ATTRDIR "linux.uts"
+ #define ATTRNAME "sysname"
+ #define ATTRPATH ATTRDIR "." ATTRNAME
+--- a/tests/sys-xlat.c
++++ b/tests/sys-xlat.c
+@@ -28,6 +28,8 @@
+
+ #define _GNU_SOURCE
+
++#include "testutil.h"
++
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdlib.h>
+@@ -36,8 +38,6 @@
+ #include <unistd.h>
+ #include <libkdumpfile/addrxlat.h>
+
+-#include "testutil.h"
+-
+ static char *data_file;
+ static char *cfg_file;
+
+--- a/tests/thread-errstr.c
++++ b/tests/thread-errstr.c
+@@ -26,6 +26,8 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+@@ -35,8 +37,6 @@
+ #include <pthread.h>
+ #include <libkdumpfile/kdumpfile.h>
+
+-#include "testutil.h"
+-
+ static pthread_mutex_t attr_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+ static enum {
+--- a/tests/typed-attr.c
++++ b/tests/typed-attr.c
+@@ -26,10 +26,10 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
+-#include <libkdumpfile/kdumpfile.h>
+-
+ #include "testutil.h"
+
++#include <libkdumpfile/kdumpfile.h>
++
+ #define ATTR_CACHE_SIZE "cache.size"
+ #define ATTR_SYSNAME "linux.uts.sysname"
+ #define ATTR_PHYS_BASE "linux.phys_base"
+--- a/tests/vmci-cleanup.c
++++ b/tests/vmci-cleanup.c
+@@ -26,13 +26,13 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <libkdumpfile/kdumpfile.h>
+
+-#include "testutil.h"
+-
+ static const char vmcore1[] =
+ "DIR.SUB.VAL=test1\n";
+
+--- a/tests/vmci-lines-post.c
++++ b/tests/vmci-lines-post.c
+@@ -26,12 +26,12 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <stdio.h>
+ #include <string.h>
+ #include <libkdumpfile/kdumpfile.h>
+
+-#include "testutil.h"
+-
+ #define xstr(s) #s
+ #define str(s) xstr(s)
+
+--- a/tests/vmci-post.c
++++ b/tests/vmci-post.c
+@@ -26,12 +26,12 @@
+ not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include "testutil.h"
++
+ #include <stdio.h>
+ #include <string.h>
+ #include <libkdumpfile/kdumpfile.h>
+
+-#include "testutil.h"
+-
+ #define xstr(s) #s
+ #define str(s) xstr(s)
+
+--- a/tests/xlat-os.c
++++ b/tests/xlat-os.c
+@@ -28,6 +28,8 @@
+
+ #define _GNU_SOURCE
+
++#include "testutil.h"
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -37,8 +39,6 @@
+
+ #include <libkdumpfile/addrxlat.h>
+
+-#include "testutil.h"
+-
+ struct cbdata {
+ addrxlat_ctx_t *ctx;
+ addrxlat_sys_t *sys;
+--- a/tests/xlatmap.c
++++ b/tests/xlatmap.c
+@@ -28,14 +28,14 @@
+
+ #define _GNU_SOURCE
+
++#include "testutil.h"
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <dlfcn.h>
+ #include <libkdumpfile/addrxlat.h>
+
+-#include "testutil.h"
+-
+ #define NMAPS 15
+ static addrxlat_map_t *map[NMAPS];
+
+--- a/tests/xlatop.c
++++ b/tests/xlatop.c
+@@ -28,12 +28,12 @@
+
+ #define _GNU_SOURCE
+
++#include "testutil.h"
++
+ #include <stdio.h>
+
+ #include <libkdumpfile/addrxlat.h>
+
+-#include "testutil.h"
+-
+ struct test {
+ addrxlat_fulladdr_t addr;
+ addrxlat_fulladdr_t expect;
+
diff --git a/dev-libs/libkdumpfile/libkdumpfile-0.5.5-r2.ebuild b/dev-libs/libkdumpfile/libkdumpfile-0.5.5-r2.ebuild
new file mode 100644
index 000000000000..2c9c9ab35874
--- /dev/null
+++ b/dev-libs/libkdumpfile/libkdumpfile-0.5.5-r2.ebuild
@@ -0,0 +1,47 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Kernel coredump file access"
+HOMEPAGE="https://github.com/ptesarik/libkdumpfile"
+SRC_URI="https://github.com/ptesarik/libkdumpfile/releases/download/v${PV}/${P}.tar.bz2"
+
+LICENSE="|| ( LGPL-3+ GPL-2+ )"
+SLOT="0/1"
+KEYWORDS="~amd64"
+IUSE="lzo snappy zlib zstd"
+
+DEPEND="
+ sys-libs/binutils-libs:=
+ lzo? ( dev-libs/lzo )
+ snappy? ( app-arch/snappy:= )
+ zlib? ( sys-libs/zlib )
+ zstd? ( app-arch/zstd:= )
+"
+RDEPEND="${DEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.5.5-bfd-include.patch
+)
+
+src_configure() {
+ local myeconfargs=(
+ # The Python bindings within libkdumpfile are deprecated
+ # and don't work w/ PEP517. There's a new CFFI bindings
+ # project we can use if anyone asks for them.
+ --without-python
+ $(use_with lzo lzo2)
+ $(use_with snappy)
+ $(use_with zlib)
+ $(use_with zstd libzstd)
+ )
+
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ default
+ find "${D}" -name '*.la' -delete || die
+}