Initial commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
From http://cgit.openembedded.org/openembedded-core/plain/meta/recipes-devtools/elfutils/files/0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch
|
||||
|
||||
From 2e2232d0935bf8ef6e66ebffba3be68a73b5b3e5 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sun, 8 Sep 2019 15:57:59 -0700
|
||||
Subject: [PATCH] ppc_initreg.c: Incliude asm/ptrace.h for pt_regs definition
|
||||
|
||||
Fixes
|
||||
| ../../elfutils-0.176/backends/ppc_initreg.c:79:22: error: field 'r' has incomplete type
|
||||
| struct pt_regs r;
|
||||
| ^
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
backends/ppc_initreg.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/backends/ppc_initreg.c
|
||||
+++ b/backends/ppc_initreg.c
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <stdlib.h>
|
||||
#if defined(__powerpc__) && defined(__linux__)
|
||||
# include <sys/ptrace.h>
|
||||
+# include <asm/ptrace.h>
|
||||
# include <sys/user.h>
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
--- a/config/libelf.pc.in
|
||||
+++ b/config/libelf.pc.in
|
||||
@@ -8,7 +8,7 @@ Description: elfutils libelf library to
|
||||
Version: @VERSION@
|
||||
URL: http://elfutils.org/
|
||||
|
||||
-Libs: -L${libdir} -lelf
|
||||
+Libs: -L${libdir} -lelf @intl_LDFLAGS@
|
||||
Cflags: -I${includedir}
|
||||
|
||||
Requires.private: zlib
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -590,6 +590,9 @@ AC_CONFIG_FILES([config/libelf.pc config
|
||||
AC_SUBST(USE_NLS, yes)
|
||||
AM_PO_SUBDIRS
|
||||
|
||||
+case "$USE_NLS" in yes) intl_LDFLAGS="-lintl" ;; esac
|
||||
+AC_SUBST([intl_LDFLAGS])
|
||||
+
|
||||
dnl Appended to the config.h file.
|
||||
dnl We hide all kinds of configuration magic in lib/eu-config.h.
|
||||
AH_BOTTOM([#include <eu-config.h>])
|
||||
--- a/libasm/libasmP.h
|
||||
+++ b/libasm/libasmP.h
|
||||
@@ -36,6 +36,9 @@
|
||||
|
||||
#include "libdwelf.h"
|
||||
|
||||
+#ifdef _ /* fix libintl-stub */
|
||||
+#undef _
|
||||
+#endif
|
||||
/* gettext helper macros. */
|
||||
#define _(Str) dgettext ("elfutils", Str)
|
||||
|
||||
--- a/libdw/libdwP.h
|
||||
+++ b/libdw/libdwP.h
|
||||
@@ -37,6 +37,9 @@
|
||||
#include <dwarf.h>
|
||||
#include "atomics.h"
|
||||
|
||||
+#ifdef _ /* fix libintl-stub */
|
||||
+#undef _
|
||||
+#endif
|
||||
|
||||
/* gettext helper macros. */
|
||||
#define _(Str) dgettext ("elfutils", Str)
|
||||
--- a/libdwfl/libdwflP.h
|
||||
+++ b/libdwfl/libdwflP.h
|
||||
@@ -47,6 +47,9 @@
|
||||
|
||||
typedef struct Dwfl_Process Dwfl_Process;
|
||||
|
||||
+#ifdef _ /* fix libintl-stub */
|
||||
+#undef _
|
||||
+#endif
|
||||
/* gettext helper macros. */
|
||||
#define _(Str) dgettext ("elfutils", Str)
|
||||
|
||||
--- a/libelf/libelfP.h
|
||||
+++ b/libelf/libelfP.h
|
||||
@@ -39,6 +39,9 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
+#ifdef _ /* fix libintl-stub */
|
||||
+#undef _
|
||||
+#endif
|
||||
/* gettext helper macros. */
|
||||
#define _(Str) dgettext ("elfutils", Str)
|
||||
|
||||
11
package/libs/elfutils/patches/005-build_only_libs.patch
Normal file
11
package/libs/elfutils/patches/005-build_only_libs.patch
Normal file
@@ -0,0 +1,11 @@
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -27,7 +27,7 @@ AM_MAKEFLAGS = --no-print-directory
|
||||
pkginclude_HEADERS = version.h
|
||||
|
||||
SUBDIRS = config m4 lib libelf libcpu backends libebl libdwelf libdwfl libdw \
|
||||
- libasm debuginfod src po doc tests
|
||||
+ libasm
|
||||
|
||||
EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
|
||||
COPYING COPYING-GPLV2 COPYING-LGPLV3
|
||||
@@ -0,0 +1,55 @@
|
||||
From 578f370c7e7a9f056aefa062b34590b0aa13bce5 Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Tue, 15 Aug 2017 17:27:30 +0800
|
||||
Subject: [PATCH] Fix build on aarch64/musl
|
||||
|
||||
Errors
|
||||
|
||||
invalid operands to binary & (have 'long double' and 'unsigned int')
|
||||
|
||||
error: redefinition
|
||||
of 'struct iovec'
|
||||
struct iovec { void *iov_base; size_t iov_len; };
|
||||
^
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
|
||||
Rebase to 0.170
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
|
||||
---
|
||||
backends/aarch64_initreg.c | 4 ++--
|
||||
backends/arm_initreg.c | 2 +-
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/backends/aarch64_initreg.c
|
||||
+++ b/backends/aarch64_initreg.c
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "system.h"
|
||||
#include <assert.h>
|
||||
#if defined(__aarch64__) && defined(__linux__)
|
||||
-# include <linux/uio.h>
|
||||
+# include <sys/uio.h>
|
||||
# include <sys/user.h>
|
||||
# include <sys/ptrace.h>
|
||||
/* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */
|
||||
@@ -82,7 +82,7 @@ aarch64_set_initial_registers_tid (pid_t
|
||||
|
||||
Dwarf_Word dwarf_fregs[32];
|
||||
for (int r = 0; r < 32; r++)
|
||||
- dwarf_fregs[r] = fregs.vregs[r] & 0xFFFFFFFF;
|
||||
+ dwarf_fregs[r] = (unsigned int)fregs.vregs[r] & 0xFFFFFFFF;
|
||||
|
||||
if (! setfunc (64, 32, dwarf_fregs, arg))
|
||||
return false;
|
||||
--- a/backends/arm_initreg.c
|
||||
+++ b/backends/arm_initreg.c
|
||||
@@ -38,7 +38,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef __aarch64__
|
||||
-# include <linux/uio.h>
|
||||
+# include <sys/uio.h>
|
||||
# include <sys/user.h>
|
||||
# include <sys/ptrace.h>
|
||||
/* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */
|
||||
47
package/libs/elfutils/patches/100-musl-compat.patch
Normal file
47
package/libs/elfutils/patches/100-musl-compat.patch
Normal file
@@ -0,0 +1,47 @@
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=21002
|
||||
|
||||
--- a/lib/system.h
|
||||
+++ b/lib/system.h
|
||||
@@ -30,7 +30,18 @@
|
||||
#define LIB_SYSTEM_H 1
|
||||
|
||||
#include <errno.h>
|
||||
-#include <error.h>
|
||||
+#ifdef HAVE_ERROR_H
|
||||
+#include "error.h"
|
||||
+#else
|
||||
+#include "err.h"
|
||||
+#include <stdio.h>
|
||||
+#define error(status, errno, ...) \
|
||||
+ do { \
|
||||
+ fflush(stdout); \
|
||||
+ warn(__VA_ARGS__); \
|
||||
+ if (status) exit(status); \
|
||||
+ } while(0)
|
||||
+#endif
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/param.h>
|
||||
--- a/libdw/libdw_alloc.c
|
||||
+++ b/libdw/libdw_alloc.c
|
||||
@@ -152,5 +152,5 @@ __attribute ((noreturn)) attribute_hidde
|
||||
__libdw_oom (void)
|
||||
{
|
||||
while (1)
|
||||
- error (EXIT_FAILURE, ENOMEM, "libdw");
|
||||
+ error (EXIT_FAILURE, errno, gettext ("cannot allocate memory"));
|
||||
}
|
||||
--- a/libdwfl/dwfl_error.c
|
||||
+++ b/libdwfl/dwfl_error.c
|
||||
@@ -154,7 +154,11 @@ dwfl_errmsg (int error)
|
||||
switch (error &~ 0xffff)
|
||||
{
|
||||
case OTHER_ERROR (ERRNO):
|
||||
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
|
||||
return strerror_r (error & 0xffff, "bad", 0);
|
||||
+#else
|
||||
+ return strerror (error & 0xffff);
|
||||
+#endif
|
||||
case OTHER_ERROR (LIBELF):
|
||||
return elf_errmsg (error & 0xffff);
|
||||
case OTHER_ERROR (LIBDW):
|
||||
83
package/libs/elfutils/patches/101-no-fts.patch
Normal file
83
package/libs/elfutils/patches/101-no-fts.patch
Normal file
@@ -0,0 +1,83 @@
|
||||
--- a/libdwfl/argp-std.c
|
||||
+++ b/libdwfl/argp-std.c
|
||||
@@ -56,9 +56,6 @@ static const struct argp_option options[
|
||||
{ "linux-process-map", 'M', "FILE", 0,
|
||||
N_("Find addresses in files mapped as read from FILE"
|
||||
" in Linux /proc/PID/maps format"), 0 },
|
||||
- { "kernel", 'k', NULL, 0, N_("Find addresses in the running kernel"), 0 },
|
||||
- { "offline-kernel", 'K', "RELEASE", OPTION_ARG_OPTIONAL,
|
||||
- N_("Kernel with all modules"), 0 },
|
||||
{ "debuginfo-path", OPT_DEBUGINFO, "PATH", 0,
|
||||
N_("Search path for separate debuginfo files"), 0 },
|
||||
{ NULL, 0, NULL, 0, NULL, 0 }
|
||||
@@ -85,15 +82,6 @@ static const Dwfl_Callbacks proc_callbac
|
||||
.find_elf = INTUSE(dwfl_linux_proc_find_elf),
|
||||
};
|
||||
|
||||
-static const Dwfl_Callbacks kernel_callbacks =
|
||||
- {
|
||||
- .find_debuginfo = INTUSE(dwfl_standard_find_debuginfo),
|
||||
- .debuginfo_path = &debuginfo_path,
|
||||
-
|
||||
- .find_elf = INTUSE(dwfl_linux_kernel_find_elf),
|
||||
- .section_address = INTUSE(dwfl_linux_kernel_module_section_address),
|
||||
- };
|
||||
-
|
||||
/* Structure held at state->HOOK. */
|
||||
struct parse_opt
|
||||
{
|
||||
@@ -226,43 +214,6 @@ parse_opt (int key, char *arg, struct ar
|
||||
}
|
||||
break;
|
||||
|
||||
- case 'k':
|
||||
- {
|
||||
- struct parse_opt *opt = state->hook;
|
||||
- if (opt->dwfl == NULL)
|
||||
- {
|
||||
- Dwfl *dwfl = INTUSE(dwfl_begin) (&kernel_callbacks);
|
||||
- int result = INTUSE(dwfl_linux_kernel_report_kernel) (dwfl);
|
||||
- if (result != 0)
|
||||
- return fail (dwfl, result, _("cannot load kernel symbols"), state);
|
||||
- result = INTUSE(dwfl_linux_kernel_report_modules) (dwfl);
|
||||
- if (result != 0)
|
||||
- /* Non-fatal to have no modules since we do have the kernel. */
|
||||
- argp_failure (state, 0, result, _("cannot find kernel modules"));
|
||||
- opt->dwfl = dwfl;
|
||||
- }
|
||||
- else
|
||||
- goto toomany;
|
||||
- }
|
||||
- break;
|
||||
-
|
||||
- case 'K':
|
||||
- {
|
||||
- struct parse_opt *opt = state->hook;
|
||||
- if (opt->dwfl == NULL)
|
||||
- {
|
||||
- Dwfl *dwfl = INTUSE(dwfl_begin) (&offline_callbacks);
|
||||
- int result = INTUSE(dwfl_linux_kernel_report_offline) (dwfl, arg,
|
||||
- NULL);
|
||||
- if (result != 0)
|
||||
- return fail (dwfl, result, _("cannot find kernel or modules"), state);
|
||||
- opt->dwfl = dwfl;
|
||||
- }
|
||||
- else
|
||||
- goto toomany;
|
||||
- }
|
||||
- break;
|
||||
-
|
||||
case ARGP_KEY_SUCCESS:
|
||||
{
|
||||
struct parse_opt *opt = state->hook;
|
||||
--- a/libdwfl/Makefile.am
|
||||
+++ b/libdwfl/Makefile.am
|
||||
@@ -50,7 +50,7 @@ libdwfl_a_SOURCES = dwfl_begin.c dwfl_en
|
||||
argp-std.c find-debuginfo.c \
|
||||
dwfl_build_id_find_elf.c \
|
||||
dwfl_build_id_find_debuginfo.c \
|
||||
- linux-kernel-modules.c linux-proc-maps.c \
|
||||
+ linux-proc-maps.c \
|
||||
dwfl_addrmodule.c dwfl_addrdwarf.c \
|
||||
cu.c dwfl_module_nextcu.c dwfl_nextcu.c dwfl_cumodule.c \
|
||||
dwfl_module_addrdie.c dwfl_addrdie.c \
|
||||
26
package/libs/elfutils/patches/110-no-cdefs.patch
Normal file
26
package/libs/elfutils/patches/110-no-cdefs.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
From e399540ab67ffe83ca3c4cb768a2f0f2f32a9057 Mon Sep 17 00:00:00 2001
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Sun, 5 Apr 2020 15:56:59 -0700
|
||||
Subject: [PATCH] libelf: remove usage of sys/cdefs
|
||||
|
||||
sys/cdefs is a deprecated glibc header that is unavailable with other
|
||||
libc implementations such as musl.
|
||||
|
||||
features.h under glibc includes sys/cdefs whereas it does not under musl.
|
||||
|
||||
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
||||
---
|
||||
lib/fixedsizehash.h | 1 -
|
||||
libelf/elf.h | 10 ++++++----
|
||||
2 files changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/lib/fixedsizehash.h
|
||||
+++ b/lib/fixedsizehash.h
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
-#include <sys/cdefs.h>
|
||||
|
||||
#include <system.h>
|
||||
|
||||
Reference in New Issue
Block a user