You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-libs/elfutils/files/musl/elfutils-0.185-macros.patch

87 lines
2.4 KiB

May not be required (or at least some hunks) with next release (0.186?)
https://git.alpinelinux.org/aports/plain/main/elfutils/musl-macros.patch
--- a/src/arlib.h
+++ b/src/arlib.h
@@ -29,6 +29,16 @@
#include <stdint.h>
#include <sys/types.h>
+#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
+++ b/src/elfcompress.c
@@ -35,6 +35,14 @@
#include <gelf.h>
#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;
--- a/lib/libeu.h
+++ b/lib/libeu.h
@@ -31,6 +31,27 @@
#include <stddef.h>
#include <stdint.h>
+#include <unistd.h>
+#include <alloca.h>
+#include <string.h>
+
+#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__));
--- a/src/strip.c
+++ b/src/strip.c
@@ -46,6 +46,14 @@
#include <system.h>
#include <printversion.h>
+#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. */