5 Commits 54bc228d6d ... ef6195cf0f

Author SHA1 Message Date
  Matías Fonzo ef6195cf0f recipes: devel/libelf: Removed in favor of elfutils 3 years ago
  Matías Fonzo 890753674e recipes: devel/elfutils: Added as drop in replacement for libelf 3 years ago
  Matías Fonzo e2013b7c14 recipes: libs/{libxml2,libxslt}: Fix missing unpack() instruction due to the recent adjustment 3 years ago
  Matías Fonzo bc8f786f3f recipes: tools/musl_utils: Renamed and reconfigured 3 years ago
  Matías Fonzo 27a016fb3a recipes: gnupg/pinentry-nox11: Set 'pkgname' for the documentation directory 3 years ago

+ 27 - 0
archive/elfutils/error.h

@@ -0,0 +1,27 @@
+#ifndef _ERROR_H_
+#define _ERROR_H_
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+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_ */

+ 17 - 0
patches/elfutils/fix-uninitialized.patch

@@ -0,0 +1,17 @@
+
+--- libcpu/i386_disasm.c	2015-08-21 14:22:37.000000000 +0200
++++ 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 <drepper@redhat.com>, 2007.
+@@ -710,6 +710,7 @@
+ 
+ 		case 'm':
+ 		  /* Mnemonic.  */
++		  str = mnebuf;
+ 
+ 		  if (unlikely (instrtab[cnt].mnemonic == MNE_INVALID))
+ 		    {

+ 10 - 0
patches/elfutils/musl-asm_ptrace_h.patch

@@ -0,0 +1,10 @@
+--- backends/ppc_initreg.c	2019-11-26 23:48:42.000000000 +0100
++++ backends/ppc_initreg.c	2019-12-08 16:57:58.334872602 +0100
+@@ -32,6 +32,7 @@
+ 
+ #include <stdlib.h>
+ #if defined(__powerpc__) && defined(__linux__)
++# include <asm/ptrace.h>
+ # include <sys/ptrace.h>
+ # include <sys/user.h>
+ #endif

+ 30 - 0
patches/elfutils/musl-cdefs.patch

@@ -0,0 +1,30 @@
+--- libelf/elf.h	2015-08-21 14:22:37.000000000 +0200
++++ libelf/elf.h	2015-11-20 04:54:33.948081321 +0100
+@@ -21,6 +21,17 @@
+ 
+ #include <features.h>
+ 
++#if !defined(__GLIBC__)
++/* C++ needs to know that types and declarations are C, not C++.  */
++#ifdef  __cplusplus
++# define __BEGIN_DECLS  extern "C" {
++# define __END_DECLS    }
++#else
++# define __BEGIN_DECLS
++# define __END_DECLS
++#endif
++#endif
++
+ __BEGIN_DECLS
+ 
+ /* Standard ELF types.  */
+--- lib/fixedsizehash.h.orig
++++ lib/fixedsizehash.h
+@@ -30,7 +30,6 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <sys/cdefs.h>
+ 
+ #include <system.h>
+ 

+ 87 - 0
patches/elfutils/musl-fts-obstack.patch

@@ -0,0 +1,87 @@
+--- configure.ac	2015-10-15 15:16:57.000000000 +0200
++++ configure.ac	2015-11-20 05:32:57.723901582 +0100
+@@ -305,6 +305,62 @@
+ fi
+ AC_SUBST([argp_LDADD])
+ 
++dnl Check if we have fts available from our libc
++AC_LINK_IFELSE(
++	[AC_LANG_PROGRAM(
++		[#if !defined(__x86_64__)
++		#undef  _FILE_OFFSET_BITS
++		#define _FILE_OFFSET_BITS 32
++		#endif
++		#include <fts.h>],
++		[FTS* fts = 0; return fts_close(fts); return 0;]
++		)],
++	[libc_has_fts="true"],
++	[libc_has_fts="false"]
++)
++
++dnl If our libc doesn't provide fts, then test for libfts
++if test "$libc_has_fts" = "false" ; then
++	AC_MSG_WARN("libc does not have fts")
++	AC_CHECK_LIB([fts], [fts_close], [have_fts="true"], [have_fts="false"])
++
++	if test "$have_fts" = "false"; then
++		AC_MSG_ERROR("no libfts found")
++	else
++		fts_LDADD="-lfts"
++	fi
++else
++	fts_LDADD=""
++fi
++AC_SUBST([fts_LDADD])
++
++dnl Check if we have obstack available from our libc
++AC_LINK_IFELSE(
++	[AC_LANG_PROGRAM(
++		[#include <obstack.h>],
++		[_obstack_begin(0, 0, 0, NULL, NULL); return 0;]
++		)],
++	[libc_has_obstack="true"],
++	[libc_has_obstack="false"]
++)
++
++dnl If our libc doesn't provide obstack, then test for libobstack
++if test "$libc_has_obstack" = "false" ; then
++	AC_MSG_WARN("libc does not have obstack")
++	AC_CHECK_LIB([obstack], [_obstack_begin], [have_obstack="true"], [have_obstack="false"])
++
++	if test "$have_obstack" = "false"; then
++		AC_MSG_ERROR("no libobstack found")
++	else
++		obstack_LDADD="-lobstack"
++	fi
++else
++	obstack_LDADD=""
++fi
++AC_SUBST([obstack_LDADD])
++
++dnl The directories with content.
++
+ dnl The directories with content.
+ 
+ dnl Documentation.
+--- src/Makefile.am.orig
++++ src/Makefile.am
+@@ -46,7 +46,7 @@
+ else
+ libasm = ../libasm/libasm.so
+ libdw = ../libdw/libdw.so
+-libelf = ../libelf/libelf.so
++libelf = ../libelf/libelf.so $(fts_LDADD) $(obstack_LDADD)
+ endif
+ libebl = ../libebl/libebl.a
+ libeu = ../lib/libeu.a
+--- libdw/Makefile.am.orig
++++ libdw/Makefile.am
+@@ -109,7 +109,7 @@
+ 		../libcpu/libcpu_pic.a libdw_pic.a ../libdwelf/libdwelf_pic.a \
+ 		../libdwfl/libdwfl_pic.a
+ libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
+-libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS) -pthread
++libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) $(zip_LIBS) -pthread
+ libdw_so_SOURCES =
+ libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
+ 	$(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \

+ 53 - 0
patches/elfutils/musl-macros.patch

@@ -0,0 +1,53 @@
+--- src/arlib.h	2015-08-21 14:22:37.000000000 +0200
++++ src/arlib.h	2015-11-20 08:02:55.153199611 +0100
+@@ -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;
+--- src/elfcompress.c.orig	2016-04-02 12:51:26.903848894 +0200
++++ src/elfcompress.c	2016-04-02 12:55:15.076996338 +0200
+@@ -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;
+--- src/strip.c.orig	2017-08-02 12:06:25.000000000 +0000
++++ src/strip.c	2017-08-05 01:58:01.523493062 +0000
+@@ -47,6 +47,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.  */

+ 65 - 0
patches/elfutils/musl-qsort_r.patch

@@ -0,0 +1,65 @@
+--- src/readelf.c
++++ src/readelf.c
+@@ -4773,10 +4773,11 @@ listptr_base (struct listptr *p)
+   return cudie_base (&cu);
+ }
+ 
++static const char *listptr_name;
++
+ static int
+-compare_listptr (const void *a, const void *b, void *arg)
++compare_listptr (const void *a, const void *b)
+ {
+-  const char *name = arg;
+   struct listptr *p1 = (void *) a;
+   struct listptr *p2 = (void *) b;
+ 
+@@ -4792,21 +4793,21 @@ compare_listptr (const void *a, const void *b, void *arg)
+ 	  p1->warned = p2->warned = true;
+ 	  error (0, 0,
+ 		 gettext ("%s %#" PRIx64 " used with different address sizes"),
+-		 name, (uint64_t) p1->offset);
++		 listptr_name, (uint64_t) p1->offset);
+ 	}
+       if (p1->dwarf64 != p2->dwarf64)
+ 	{
+ 	  p1->warned = p2->warned = true;
+ 	  error (0, 0,
+ 		 gettext ("%s %#" PRIx64 " used with different offset sizes"),
+-		 name, (uint64_t) p1->offset);
++		 listptr_name, (uint64_t) p1->offset);
+ 	}
+       if (listptr_base (p1) != listptr_base (p2))
+ 	{
+ 	  p1->warned = p2->warned = true;
+ 	  error (0, 0,
+ 		 gettext ("%s %#" PRIx64 " used with different base addresses"),
+-		 name, (uint64_t) p1->offset);
++		 listptr_name, (uint64_t) p1->offset);
+ 	}
+       if (p1->attr != p2 ->attr)
+ 	{
+@@ -4814,7 +4815,7 @@ compare_listptr (const void *a, const void *b, void *arg)
+ 	  error (0, 0,
+ 		 gettext ("%s %#" PRIx64
+ 			  " used with different attribute %s and %s"),
+-		 name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
++		 listptr_name, (uint64_t) p1->offset, dwarf_attr_name (p2->attr),
+ 		 dwarf_attr_name (p2->attr));
+ 	}
+     }
+@@ -4885,9 +4886,11 @@ notice_listptr (enum section_e section, struct listptr_table *table,
+ static void
+ sort_listptr (struct listptr_table *table, const char *name)
+ {
+-  if (table->n > 0)
+-    qsort_r (table->table, table->n, sizeof table->table[0],
+-	     &compare_listptr, (void *) name);
++  if (table->n > 0) {
++    listptr_name = name;
++    qsort (table->table, table->n, sizeof table->table[0],
++	     &compare_listptr);
++  }
+ }
+ 
+ static bool

+ 19 - 0
patches/elfutils/musl-strerror_r.patch

@@ -0,0 +1,19 @@
+--- libdwfl/dwfl_error.c	2015-09-29 17:18:51.000000000 +0200
++++ libdwfl/dwfl_error.c	2015-11-20 05:11:29.889002058 +0100
+@@ -154,7 +154,16 @@
+   switch (error &~ 0xffff)
+     {
+     case OTHER_ERROR (ERRNO):
++#if defined(__GLIBC__)
+       return strerror_r (error & 0xffff, "bad", 0);
++#else
++      {
++        static __thread char buf[128] = "";
++        if (0 == strerror_r(error & 0xffff, buf, sizeof(buf)))
++          return buf;
++      }
++      return "strerror_r() failed";
++#endif
+     case OTHER_ERROR (LIBELF):
+       return elf_errmsg (error & 0xffff);
+     case OTHER_ERROR (LIBDW):

+ 18 - 0
patches/elfutils/musl-strndupa.patch

@@ -0,0 +1,18 @@
+--- src/unstrip.c.orig	2017-04-27 14:26:26.000000000 +0000
++++ 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;
+ 

+ 0 - 0
patches/libelf/0006-Fix-build-on-aarch64-musl.patch


Some files were not shown because too many files changed in this diff