From 7b0628f037dcbf85cfb381d5e05dea39a2059d33 Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 25 May 2022 22:50:03 +0100 Subject: fixed various broken dependencies --- repo/system/elfutils/elfutils.xibuild | 14 ++-- repo/system/elfutils/error.h | 27 +++++++ repo/system/elfutils/files/error.h | 27 ------- repo/system/elfutils/fix-aarch64_fregs.patch | 14 ++++ repo/system/elfutils/fix-uninitialized.patch | 17 +++++ repo/system/elfutils/musl-asm-ptrace-h.patch | 10 +++ repo/system/elfutils/musl-macros.patch | 87 ++++++++++++++++++++++ repo/system/elfutils/musl-strndupa.patch | 18 +++++ .../elfutils/patches/fix-aarch64_fregs.patch | 14 ---- .../elfutils/patches/fix-uninitialized.patch | 17 ----- .../elfutils/patches/musl-asm-ptrace-h.patch | 10 --- repo/system/elfutils/patches/musl-macros.patch | 87 ---------------------- repo/system/elfutils/patches/musl-strndupa.patch | 18 ----- 13 files changed, 180 insertions(+), 180 deletions(-) create mode 100644 repo/system/elfutils/error.h delete mode 100644 repo/system/elfutils/files/error.h create mode 100644 repo/system/elfutils/fix-aarch64_fregs.patch create mode 100644 repo/system/elfutils/fix-uninitialized.patch create mode 100644 repo/system/elfutils/musl-asm-ptrace-h.patch create mode 100644 repo/system/elfutils/musl-macros.patch create mode 100644 repo/system/elfutils/musl-strndupa.patch delete mode 100644 repo/system/elfutils/patches/fix-aarch64_fregs.patch delete mode 100644 repo/system/elfutils/patches/fix-uninitialized.patch delete mode 100644 repo/system/elfutils/patches/musl-asm-ptrace-h.patch delete mode 100644 repo/system/elfutils/patches/musl-macros.patch delete mode 100644 repo/system/elfutils/patches/musl-strndupa.patch (limited to 'repo/system/elfutils') diff --git a/repo/system/elfutils/elfutils.xibuild b/repo/system/elfutils/elfutils.xibuild index a68827f..5f7eb38 100644 --- a/repo/system/elfutils/elfutils.xibuild +++ b/repo/system/elfutils/elfutils.xibuild @@ -1,17 +1,17 @@ #!/bin/sh -MAKEDEPS="bison flex zlib bzip2 xz argp-standalone libtool fts musl-obstack" +MAKEDEPS="bison flex zlib bzip2 xz argp-standalone libtool musl-obstack" DEPS="musl zlib" PKG_VER=0.186 SOURCE=https://sourceware.org/elfutils/ftp/$PKG_VER/elfutils-$PKG_VER.tar.bz2 ADDITIONAL=" - files/error.h - patches/fix-aarch64_fregs.patch - patches/fix-uninitialized.patch - patches/musl-macros.patch - patches/musl-strndupa.patch - patches/musl-asm-ptrace-h.patch + error.h + fix-aarch64_fregs.patch + fix-uninitialized.patch + musl-macros.patch + musl-strndupa.patch + musl-asm-ptrace-h.patch " DESC="Utilities and DSOs to handle ELF files and DWARF data" diff --git a/repo/system/elfutils/error.h b/repo/system/elfutils/error.h new file mode 100644 index 0000000..ef06827 --- /dev/null +++ b/repo/system/elfutils/error.h @@ -0,0 +1,27 @@ +#ifndef _ERROR_H_ +#define _ERROR_H_ + +#include +#include +#include +#include +#include + +static unsigned int error_message_count = 0; + +static inline void error(int status, int errnum, const char* format, ...) +{ + va_list ap; + fprintf(stderr, "%s: ", program_invocation_name); + va_start(ap, format); + vfprintf(stderr, format, ap); + va_end(ap); + if (errnum) + fprintf(stderr, ": %s", strerror(errnum)); + fprintf(stderr, "\n"); + error_message_count++; + if (status) + exit(status); +} + +#endif /* _ERROR_H_ */ diff --git a/repo/system/elfutils/files/error.h b/repo/system/elfutils/files/error.h deleted file mode 100644 index ef06827..0000000 --- a/repo/system/elfutils/files/error.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef _ERROR_H_ -#define _ERROR_H_ - -#include -#include -#include -#include -#include - -static unsigned int error_message_count = 0; - -static inline void error(int status, int errnum, const char* format, ...) -{ - va_list ap; - fprintf(stderr, "%s: ", program_invocation_name); - va_start(ap, format); - vfprintf(stderr, format, ap); - va_end(ap); - if (errnum) - fprintf(stderr, ": %s", strerror(errnum)); - fprintf(stderr, "\n"); - error_message_count++; - if (status) - exit(status); -} - -#endif /* _ERROR_H_ */ diff --git a/repo/system/elfutils/fix-aarch64_fregs.patch b/repo/system/elfutils/fix-aarch64_fregs.patch new file mode 100644 index 0000000..4007416 --- /dev/null +++ b/repo/system/elfutils/fix-aarch64_fregs.patch @@ -0,0 +1,14 @@ +It looks like fregs.vregs[] is an array of double? +Casting to Dwarf_Word instead of & 0xFFFFFFF should do. + +--- a/backends/aarch64_initreg.c 2015-11-27 14:36:29.000000000 +0100 ++++ b/backends/aarch64_initreg.c 2016-08-09 03:47:25.428560159 +0200 +@@ -82,7 +82,7 @@ + + Dwarf_Word dwarf_fregs[32]; + for (int r = 0; r < 32; r++) +- dwarf_fregs[r] = fregs.vregs[r] & 0xFFFFFFFF; ++ dwarf_fregs[r] = (Dwarf_Word)fregs.vregs[r]; + + if (! setfunc (64, 32, dwarf_fregs, arg)) + return false; diff --git a/repo/system/elfutils/fix-uninitialized.patch b/repo/system/elfutils/fix-uninitialized.patch new file mode 100644 index 0000000..31ecd9e --- /dev/null +++ b/repo/system/elfutils/fix-uninitialized.patch @@ -0,0 +1,17 @@ + +--- a/libcpu/i386_disasm.c 2015-08-21 14:22:37.000000000 +0200 ++++ b/libcpu/i386_disasm.c 2015-11-20 06:30:59.250629957 +0100 +@@ -1,4 +1,4 @@ +-/* Disassembler for x86. ++/* Disassembler for x86. + Copyright (C) 2007, 2008, 2009, 2011 Red Hat, Inc. + This file is part of elfutils. + Written by Ulrich Drepper , 2007. +@@ -710,6 +710,7 @@ + + case 'm': + /* Mnemonic. */ ++ str = mnebuf; + + if (unlikely (instrtab[cnt].mnemonic == MNE_INVALID)) + { diff --git a/repo/system/elfutils/musl-asm-ptrace-h.patch b/repo/system/elfutils/musl-asm-ptrace-h.patch new file mode 100644 index 0000000..fc14686 --- /dev/null +++ b/repo/system/elfutils/musl-asm-ptrace-h.patch @@ -0,0 +1,10 @@ +--- a/backends/ppc_initreg.c 2019-11-26 23:48:42.000000000 +0100 ++++ b/backends/ppc_initreg.c 2019-12-08 16:57:58.334872602 +0100 +@@ -32,6 +32,7 @@ + + #include + #if defined(__powerpc__) && defined(__linux__) ++# include + # include + # include + #endif diff --git a/repo/system/elfutils/musl-macros.patch b/repo/system/elfutils/musl-macros.patch new file mode 100644 index 0000000..0d7ec41 --- /dev/null +++ b/repo/system/elfutils/musl-macros.patch @@ -0,0 +1,87 @@ +--- a/src/arlib.h 2015-08-21 14:22:37.000000000 +0200 ++++ b/src/arlib.h 2015-11-20 08:02:55.153199611 +0100 +@@ -29,6 +29,16 @@ + #include + #include + ++#if !defined(ACCESSPERMS) ++# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */ ++#endif ++#if !defined(ALLPERMS) ++# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */ ++#endif ++#if !defined(DEFFILEMODE) ++# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/ ++#endif ++ + + /* State of -D/-U flags. */ + extern bool arlib_deterministic_output; +--- a/src/elfcompress.c.orig 2016-04-02 12:51:26.903848894 +0200 ++++ b/src/elfcompress.c 2016-04-02 12:55:15.076996338 +0200 +@@ -35,6 +35,14 @@ + #include + #include "system.h" + ++#if !defined(FNM_EXTMATCH) ++# define FNM_EXTMATCH 0 ++#endif ++ ++#if !defined(ALLPERMS) ++# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */ ++#endif ++ + /* Name and version of program. */ + static void print_version (FILE *stream, struct argp_state *state); + ARGP_PROGRAM_VERSION_HOOK_DEF = print_version; +diff --git a/lib/libeu.h b/lib/libeu.h +index 69fe3d7..e5c99b8 100644 +--- a/lib/libeu.h ++++ b/lib/libeu.h +@@ -31,6 +31,27 @@ + + #include + #include ++#include ++#include ++#include ++ ++#ifndef TEMP_FAILURE_RETRY ++#define TEMP_FAILURE_RETRY(expression) \ ++ (__extension__ \ ++ ({ long int __result; \ ++ do __result = (long int) (expression); \ ++ while (__result == -1L && errno == EINTR); \ ++ __result; })) ++#endif ++ ++#ifndef strndupa ++#define strndupa(s, n) \ ++ (__extension__ ({const char *__in = (s); \ ++ size_t __len = strnlen (__in, (n)) + 1; \ ++ char *__out = (char *) alloca (__len); \ ++ __out[__len-1] = '\0'; \ ++ (char *) memcpy (__out, __in, __len-1);})) ++#endif + + extern void *xmalloc (size_t) __attribute__ ((__malloc__)); + extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__)); +diff --git a/src/strip.c b/src/strip.c +index 48792a7..d2f0c60 100644 +--- a/src/strip.c ++++ b/src/strip.c +@@ -46,6 +46,14 @@ + #include + #include + ++#if !defined(FNM_EXTMATCH) ++# define FNM_EXTMATCH 0 ++#endif ++ ++#if !defined(ACCESSPERMS) ++#define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) ++#endif ++ + typedef uint8_t GElf_Byte; + + /* Name and version of program. */ diff --git a/repo/system/elfutils/musl-strndupa.patch b/repo/system/elfutils/musl-strndupa.patch new file mode 100644 index 0000000..a520688 --- /dev/null +++ b/repo/system/elfutils/musl-strndupa.patch @@ -0,0 +1,18 @@ +--- a/src/unstrip.c.orig 2017-04-27 14:26:26.000000000 +0000 ++++ b/src/unstrip.c 2017-05-05 15:51:33.515154220 +0000 +@@ -56,6 +56,15 @@ + # define _(str) gettext (str) + #endif + ++#ifndef strndupa ++#define strndupa(s, n) \ ++ (__extension__ ({const char *__in = (s); \ ++ size_t __len = strnlen (__in, (n)) + 1; \ ++ char *__out = (char *) alloca (__len); \ ++ __out[__len-1] = '\0'; \ ++ (char *) memcpy (__out, __in, __len-1);})) ++#endif ++ + /* Name and version of program. */ + ARGP_PROGRAM_VERSION_HOOK_DEF = print_version; + diff --git a/repo/system/elfutils/patches/fix-aarch64_fregs.patch b/repo/system/elfutils/patches/fix-aarch64_fregs.patch deleted file mode 100644 index 4007416..0000000 --- a/repo/system/elfutils/patches/fix-aarch64_fregs.patch +++ /dev/null @@ -1,14 +0,0 @@ -It looks like fregs.vregs[] is an array of double? -Casting to Dwarf_Word instead of & 0xFFFFFFF should do. - ---- a/backends/aarch64_initreg.c 2015-11-27 14:36:29.000000000 +0100 -+++ b/backends/aarch64_initreg.c 2016-08-09 03:47:25.428560159 +0200 -@@ -82,7 +82,7 @@ - - Dwarf_Word dwarf_fregs[32]; - for (int r = 0; r < 32; r++) -- dwarf_fregs[r] = fregs.vregs[r] & 0xFFFFFFFF; -+ dwarf_fregs[r] = (Dwarf_Word)fregs.vregs[r]; - - if (! setfunc (64, 32, dwarf_fregs, arg)) - return false; diff --git a/repo/system/elfutils/patches/fix-uninitialized.patch b/repo/system/elfutils/patches/fix-uninitialized.patch deleted file mode 100644 index 31ecd9e..0000000 --- a/repo/system/elfutils/patches/fix-uninitialized.patch +++ /dev/null @@ -1,17 +0,0 @@ - ---- a/libcpu/i386_disasm.c 2015-08-21 14:22:37.000000000 +0200 -+++ b/libcpu/i386_disasm.c 2015-11-20 06:30:59.250629957 +0100 -@@ -1,4 +1,4 @@ --/* Disassembler for x86. -+/* Disassembler for x86. - Copyright (C) 2007, 2008, 2009, 2011 Red Hat, Inc. - This file is part of elfutils. - Written by Ulrich Drepper , 2007. -@@ -710,6 +710,7 @@ - - case 'm': - /* Mnemonic. */ -+ str = mnebuf; - - if (unlikely (instrtab[cnt].mnemonic == MNE_INVALID)) - { diff --git a/repo/system/elfutils/patches/musl-asm-ptrace-h.patch b/repo/system/elfutils/patches/musl-asm-ptrace-h.patch deleted file mode 100644 index fc14686..0000000 --- a/repo/system/elfutils/patches/musl-asm-ptrace-h.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/backends/ppc_initreg.c 2019-11-26 23:48:42.000000000 +0100 -+++ b/backends/ppc_initreg.c 2019-12-08 16:57:58.334872602 +0100 -@@ -32,6 +32,7 @@ - - #include - #if defined(__powerpc__) && defined(__linux__) -+# include - # include - # include - #endif diff --git a/repo/system/elfutils/patches/musl-macros.patch b/repo/system/elfutils/patches/musl-macros.patch deleted file mode 100644 index 0d7ec41..0000000 --- a/repo/system/elfutils/patches/musl-macros.patch +++ /dev/null @@ -1,87 +0,0 @@ ---- a/src/arlib.h 2015-08-21 14:22:37.000000000 +0200 -+++ b/src/arlib.h 2015-11-20 08:02:55.153199611 +0100 -@@ -29,6 +29,16 @@ - #include - #include - -+#if !defined(ACCESSPERMS) -+# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */ -+#endif -+#if !defined(ALLPERMS) -+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */ -+#endif -+#if !defined(DEFFILEMODE) -+# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/ -+#endif -+ - - /* State of -D/-U flags. */ - extern bool arlib_deterministic_output; ---- a/src/elfcompress.c.orig 2016-04-02 12:51:26.903848894 +0200 -+++ b/src/elfcompress.c 2016-04-02 12:55:15.076996338 +0200 -@@ -35,6 +35,14 @@ - #include - #include "system.h" - -+#if !defined(FNM_EXTMATCH) -+# define FNM_EXTMATCH 0 -+#endif -+ -+#if !defined(ALLPERMS) -+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */ -+#endif -+ - /* Name and version of program. */ - static void print_version (FILE *stream, struct argp_state *state); - ARGP_PROGRAM_VERSION_HOOK_DEF = print_version; -diff --git a/lib/libeu.h b/lib/libeu.h -index 69fe3d7..e5c99b8 100644 ---- a/lib/libeu.h -+++ b/lib/libeu.h -@@ -31,6 +31,27 @@ - - #include - #include -+#include -+#include -+#include -+ -+#ifndef TEMP_FAILURE_RETRY -+#define TEMP_FAILURE_RETRY(expression) \ -+ (__extension__ \ -+ ({ long int __result; \ -+ do __result = (long int) (expression); \ -+ while (__result == -1L && errno == EINTR); \ -+ __result; })) -+#endif -+ -+#ifndef strndupa -+#define strndupa(s, n) \ -+ (__extension__ ({const char *__in = (s); \ -+ size_t __len = strnlen (__in, (n)) + 1; \ -+ char *__out = (char *) alloca (__len); \ -+ __out[__len-1] = '\0'; \ -+ (char *) memcpy (__out, __in, __len-1);})) -+#endif - - extern void *xmalloc (size_t) __attribute__ ((__malloc__)); - extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__)); -diff --git a/src/strip.c b/src/strip.c -index 48792a7..d2f0c60 100644 ---- a/src/strip.c -+++ b/src/strip.c -@@ -46,6 +46,14 @@ - #include - #include - -+#if !defined(FNM_EXTMATCH) -+# define FNM_EXTMATCH 0 -+#endif -+ -+#if !defined(ACCESSPERMS) -+#define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) -+#endif -+ - typedef uint8_t GElf_Byte; - - /* Name and version of program. */ diff --git a/repo/system/elfutils/patches/musl-strndupa.patch b/repo/system/elfutils/patches/musl-strndupa.patch deleted file mode 100644 index a520688..0000000 --- a/repo/system/elfutils/patches/musl-strndupa.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/src/unstrip.c.orig 2017-04-27 14:26:26.000000000 +0000 -+++ b/src/unstrip.c 2017-05-05 15:51:33.515154220 +0000 -@@ -56,6 +56,15 @@ - # define _(str) gettext (str) - #endif - -+#ifndef strndupa -+#define strndupa(s, n) \ -+ (__extension__ ({const char *__in = (s); \ -+ size_t __len = strnlen (__in, (n)) + 1; \ -+ char *__out = (char *) alloca (__len); \ -+ __out[__len-1] = '\0'; \ -+ (char *) memcpy (__out, __in, __len-1);})) -+#endif -+ - /* Name and version of program. */ - ARGP_PROGRAM_VERSION_HOOK_DEF = print_version; - -- cgit v1.2.1