Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
This commit is contained in:
125
package/libs/elfutils/Makefile
Normal file
125
package/libs/elfutils/Makefile
Normal file
@@ -0,0 +1,125 @@
|
||||
#
|
||||
# Copyright (C) 2010-2019 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=elfutils
|
||||
PKG_VERSION:=0.191
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION)
|
||||
PKG_HASH:=df76db71366d1d708365fc7a6c60ca48398f14367eb2b8954efc8897147ad871
|
||||
|
||||
PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
PKG_LICENSE_FILES:=COPYING COPYING-GPLV2 COPYING-LGPLV3
|
||||
PKG_CPE_ID:=cpe:/a:elfutils_project:elfutils
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/elfutils/Default
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=ELF manipulation libraries
|
||||
URL:=https://fedorahosted.org/elfutils/
|
||||
ABI_VERSION:=1
|
||||
endef
|
||||
|
||||
define Package/libasm
|
||||
$(call Package/elfutils/Default)
|
||||
TITLE+= (libasm)
|
||||
DEPENDS:=+libelf +libdw
|
||||
endef
|
||||
|
||||
define Package/libdw
|
||||
$(call Package/elfutils/Default)
|
||||
DEPENDS:=+libelf +libbz2 +USE_MUSL:musl-fts
|
||||
TITLE+= (libdw)
|
||||
endef
|
||||
|
||||
define Package/libelf
|
||||
$(call Package/elfutils/Default)
|
||||
DEPENDS:=$(INTL_DEPENDS) +zlib
|
||||
TITLE+= (libelf)
|
||||
PROVIDES:=libelf1
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_BUILD_NLS),y)
|
||||
TARGET_LDFLAGS += -lintl
|
||||
else
|
||||
CONFIGURE_ARGS += --disable-nls
|
||||
endif
|
||||
|
||||
HOST_CONFIGURE_ARGS += \
|
||||
--disable-shared \
|
||||
--disable-nls \
|
||||
--disable-debuginfod \
|
||||
--disable-libdebuginfod \
|
||||
--without-bzlib \
|
||||
--without-lzma \
|
||||
--without-zstd
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--program-prefix=eu- \
|
||||
--disable-debuginfod \
|
||||
--disable-libdebuginfod \
|
||||
--without-bzlib \
|
||||
--without-lzma \
|
||||
--without-zstd
|
||||
|
||||
HOST_CONFIGURE_VARS += \
|
||||
ac_cv_search__obstack_free=yes
|
||||
|
||||
CONFIGURE_VARS += \
|
||||
ac_cv_search__obstack_free=yes
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE \
|
||||
-Wno-unused-result \
|
||||
-Wno-format-nonliteral
|
||||
|
||||
ifneq ($(CONFIG_GCC_USE_VERSION_11),y)
|
||||
TARGET_CFLAGS += \
|
||||
-Wno-error=use-after-free
|
||||
endif
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libasm*.{a,so*} $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libdw*.{a,so*} $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf*.{a,so*} $(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libelf.pc $(1)/usr/lib/pkgconfig/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libdw.pc $(1)/usr/lib/pkgconfig/
|
||||
endef
|
||||
|
||||
define Package/libasm/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libasm{-*.so,*.so.*} $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libdw/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libdw{-*.so,*.so.*} $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libelf/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf{-*.so,*.so.*} $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
# these lines need to be ordered by dependency because of ABI versioning
|
||||
$(eval $(call BuildPackage,libelf))
|
||||
$(eval $(call BuildPackage,libdw))
|
||||
$(eval $(call BuildPackage,libasm))
|
||||
@@ -0,0 +1,23 @@
|
||||
--- 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 @LIBZSTD@
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -717,6 +717,9 @@ dnl AM_GNU_GETTEXT_REQUIRE_VERSION suppo
|
||||
AM_GNU_GETTEXT_VERSION([0.19.6])
|
||||
AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.6])
|
||||
|
||||
+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>])
|
||||
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 lib libelf libcpu backends libebl libdwelf libdwfl libdw \
|
||||
- libasm debuginfod src po doc tests
|
||||
+ libasm
|
||||
|
||||
EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING SECURITY \
|
||||
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. */
|
||||
29
package/libs/elfutils/patches/100-musl-compat.patch
Normal file
29
package/libs/elfutils/patches/100-musl-compat.patch
Normal file
@@ -0,0 +1,29 @@
|
||||
--- 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
|
||||
@@ -139,6 +139,7 @@ __libdwfl_seterrno (Dwfl_Error error)
|
||||
static const char *
|
||||
errnomsg(int error)
|
||||
{
|
||||
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
|
||||
/* Won't be changed by strerror_r, but not const so compiler doesn't throw warning */
|
||||
static char unknown[] = "unknown error";
|
||||
|
||||
@@ -149,6 +150,9 @@ errnomsg(int error)
|
||||
static __thread char msg[128];
|
||||
return strerror_r (error, msg, sizeof (msg)) ? unknown : msg;
|
||||
#endif
|
||||
+#else
|
||||
+ return strerror (error & 0xffff);
|
||||
+#endif
|
||||
}
|
||||
|
||||
const char *
|
||||
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
|
||||
@@ -51,9 +51,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 }
|
||||
@@ -80,15 +77,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
|
||||
{
|
||||
@@ -221,43 +209,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 \
|
||||
Reference in New Issue
Block a user