mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
elfutils: build for target, fix build
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
b1f4435aa2
commit
87c051620d
@ -22,18 +22,17 @@
|
||||
|
||||
. config/options $1
|
||||
|
||||
setup_toolchain host
|
||||
strip_lto
|
||||
|
||||
cd $PKG_BUILD
|
||||
mkdir -p objdir && cd objdir
|
||||
../configure --host=$HOST_NAME \
|
||||
--build=$HOST_NAME \
|
||||
--target=$TARGET_NAME \
|
||||
--prefix=$ROOT/$TOOLCHAIN \
|
||||
--program-prefix=eu_ \
|
||||
--with-zlib \
|
||||
--without-bzlib \
|
||||
--with-lzma \
|
||||
./configure --host=$TARGET_NAME \
|
||||
--build=$HOST_NAME \
|
||||
--prefix=/usr \
|
||||
--disable-werror \
|
||||
--disable-progs \
|
||||
--with-zlib \
|
||||
--without-bzlib \
|
||||
--without-lzma \
|
||||
|
||||
make
|
||||
make install
|
||||
make V=1
|
||||
$MAKEINSTALL
|
@ -19,18 +19,18 @@
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="elfutils"
|
||||
PKG_VERSION="0.153"
|
||||
PKG_VERSION="0.155"
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="https://fedorahosted.org/elfutils/"
|
||||
PKG_URL="https://fedorahosted.org/releases/e/l/elfutils/$PKG_VERSION/$PKG_NAME-$PKG_VERSION.tar.bz2"
|
||||
PKG_DEPENDS=""
|
||||
PKG_BUILD_DEPENDS="ccache bison flex zlib-host xz"
|
||||
PKG_DEPENDS="zlib"
|
||||
PKG_BUILD_DEPENDS="toolchain zlib"
|
||||
PKG_PRIORITY="optional"
|
||||
PKG_SECTION="toolchain/devel"
|
||||
PKG_SECTION="devel"
|
||||
PKG_SHORTDESC="elfutils: collection of utilities to handle ELF objects"
|
||||
PKG_LONGDESC="Elfutils is a collection of utilities, including eu-ld (a linker), eu-nm (for listing symbols from object files), eu-size (for listing the section sizes of an object or archive file), eu-strip (for discarding symbols), eu-readelf (to see the raw ELF file structures), and eu-elflint (to check for well-formed ELF files)."
|
||||
PKG_IS_ADDON="no"
|
||||
|
||||
PKG_AUTORECONF="no"
|
||||
PKG_AUTORECONF="yes"
|
@ -0,0 +1,92 @@
|
||||
Allow the usage of an external implementation of the argp functions
|
||||
|
||||
uClibc lack the argp family of functions that glibc has. Therefore, we
|
||||
add a check in the configure script to see if argp_parse is available
|
||||
in the C library. If not, we look if it is available in the additional
|
||||
'argp' library. If so, we link against that library. If not, we error
|
||||
out.
|
||||
|
||||
This allows to build elfutils against uClibc with an external argp
|
||||
library.
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
|
||||
Index: b/configure.ac
|
||||
===================================================================
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -269,6 +269,13 @@
|
||||
enable_progs=yes)
|
||||
AM_CONDITIONAL(ENABLE_PROGS, test "$enable_progs" = yes)
|
||||
|
||||
+AC_CHECK_FUNC([argp_parse])
|
||||
+if test "$ac_cv_func_argp_parse" != yes; then
|
||||
+ AC_CHECK_LIB([argp],[argp_parse],ARGP_LIBS=-largp,
|
||||
+ AC_MSG_ERROR([No argp_parse function available.]))
|
||||
+fi
|
||||
+AC_SUBST(ARGP_LIBS)
|
||||
+
|
||||
dnl Test for zlib and bzlib, gives ZLIB/BZLIB .am
|
||||
dnl conditional and config.h USE_ZLIB/USE_BZLIB #define.
|
||||
save_LIBS="$LIBS"
|
||||
Index: b/src/Makefile.am
|
||||
===================================================================
|
||||
--- a/src/Makefile.am
|
||||
+++ b/src/Makefile.am
|
||||
@@ -98,26 +98,29 @@
|
||||
# Buggy old compilers.
|
||||
readelf_no_Werror = yes
|
||||
|
||||
-readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
|
||||
+readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl \
|
||||
+ $(ARGP_LIBS)
|
||||
nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl \
|
||||
- $(demanglelib)
|
||||
-size_LDADD = $(libelf) $(libeu) $(libmudflap)
|
||||
-strip_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
|
||||
-ld_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
|
||||
+ $(demanglelib) $(ARGP_LIBS)
|
||||
+size_LDADD = $(libelf) $(libeu) $(libmudflap) $(ARGP_LIBS)
|
||||
+strip_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl $(ARGP_LIBS)
|
||||
+ld_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl $(ARGP_LIBS)
|
||||
if NATIVE_LD
|
||||
# -ldl is always needed for libebl.
|
||||
ld_LDADD += libld_elf.a
|
||||
endif
|
||||
ld_LDFLAGS = -rdynamic
|
||||
-elflint_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
|
||||
-findtextrel_LDADD = $(libdw) $(libelf) $(libmudflap)
|
||||
-addr2line_LDADD = $(libdw) $(libelf) $(libmudflap)
|
||||
-elfcmp_LDADD = $(libebl) $(libelf) $(libmudflap) -ldl
|
||||
-objdump_LDADD = $(libasm) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
|
||||
-ranlib_LDADD = libar.a $(libelf) $(libeu) $(libmudflap)
|
||||
-strings_LDADD = $(libelf) $(libeu) $(libmudflap)
|
||||
-ar_LDADD = libar.a $(libelf) $(libeu) $(libmudflap)
|
||||
-unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(libmudflap) -ldl
|
||||
+elflint_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl $(ARGP_LIBS)
|
||||
+findtextrel_LDADD = $(libdw) $(libelf) $(libmudflap) $(ARGP_LIBS)
|
||||
+addr2line_LDADD = $(libdw) $(libelf) $(libmudflap) $(ARGP_LIBS)
|
||||
+elfcmp_LDADD = $(libebl) $(libelf) $(libmudflap) -ldl $(ARGP_LIBS)
|
||||
+objdump_LDADD = $(libasm) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl \
|
||||
+ $(ARGP_LIBS)
|
||||
+ranlib_LDADD = libar.a $(libelf) $(libeu) $(libmudflap) $(ARGP_LIBS)
|
||||
+strings_LDADD = $(libelf) $(libeu) $(libmudflap) $(ARGP_LIBS)
|
||||
+ar_LDADD = libar.a $(libelf) $(libeu) $(libmudflap) $(ARGP_LIBS)
|
||||
+unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(libmudflap) -ldl \
|
||||
+ $(ARGP_LIBS)
|
||||
|
||||
ldlex.o: ldscript.c
|
||||
ldlex_no_Werror = yes
|
||||
Index: b/libdw/Makefile.am
|
||||
===================================================================
|
||||
--- a/libdw/Makefile.am
|
||||
+++ b/libdw/Makefile.am
|
||||
@@ -111,7 +111,7 @@
|
||||
-Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
|
||||
-Wl,--version-script,$<,--no-undefined \
|
||||
-Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
|
||||
- -ldl $(zip_LIBS)
|
||||
+ -ldl $(zip_LIBS) $(ARGP_LIBS)
|
||||
if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
|
||||
ln -fs $@ $@.$(VERSION)
|
||||
|
@ -0,0 +1,24 @@
|
||||
Provide a compatibility alias __memcpy
|
||||
|
||||
For some reason, libelf uses the internal glibc alias __memcpy, which
|
||||
doesn't exist in uClibc. Add a manual alias so that the build can
|
||||
proceed with uClibc.
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
|
||||
Index: b/libelf/libelf.h
|
||||
===================================================================
|
||||
--- a/libelf/libelf.h
|
||||
+++ b/libelf/libelf.h
|
||||
@@ -34,6 +34,11 @@
|
||||
/* Get the ELF types. */
|
||||
#include <elf.h>
|
||||
|
||||
+#ifndef _LIBC
|
||||
+#ifndef __mempcpy
|
||||
+#define __mempcpy mempcpy
|
||||
+#endif
|
||||
+#endif
|
||||
|
||||
/* Known translation types. */
|
||||
typedef enum
|
1307
packages/devel/elfutils/patches/bk/elfutils-04-fts.patch
Normal file
1307
packages/devel/elfutils/patches/bk/elfutils-04-fts.patch
Normal file
File diff suppressed because it is too large
Load Diff
1684
packages/devel/elfutils/patches/elfutils-00-portability.patch
Normal file
1684
packages/devel/elfutils/patches/elfutils-00-portability.patch
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,77 @@
|
||||
diff -Naur elfutils-0.155/libasm/Makefile.am elfutils-0.155.patch/libasm/Makefile.am
|
||||
--- elfutils-0.155/libasm/Makefile.am 2012-08-27 20:27:31.000000000 +0200
|
||||
+++ elfutils-0.155.patch/libasm/Makefile.am 2013-03-05 18:11:43.841545009 +0100
|
||||
@@ -69,7 +69,6 @@
|
||||
-Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \
|
||||
-Wl,--soname,$@.$(VERSION) \
|
||||
../libebl/libebl.a ../libelf/libelf.so $(libasm_so_LDLIBS)
|
||||
- if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
|
||||
ln -fs $@ $@.$(VERSION)
|
||||
|
||||
install: install-am libasm.so
|
||||
diff -Naur elfutils-0.155/libasm/Makefile.in elfutils-0.155.patch/libasm/Makefile.in
|
||||
--- elfutils-0.155/libasm/Makefile.in 2012-08-27 20:29:45.000000000 +0200
|
||||
+++ elfutils-0.155.patch/libasm/Makefile.in 2013-03-05 18:12:05.604432305 +0100
|
||||
@@ -654,7 +654,6 @@
|
||||
@MUDFLAP_FALSE@ -Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \
|
||||
@MUDFLAP_FALSE@ -Wl,--soname,$@.$(VERSION) \
|
||||
@MUDFLAP_FALSE@ ../libebl/libebl.a ../libelf/libelf.so $(libasm_so_LDLIBS)
|
||||
-@MUDFLAP_FALSE@ if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
|
||||
@MUDFLAP_FALSE@ ln -fs $@ $@.$(VERSION)
|
||||
|
||||
@MUDFLAP_FALSE@install: install-am libasm.so
|
||||
diff -Naur elfutils-0.155/libdw/Makefile.am elfutils-0.155.patch/libdw/Makefile.am
|
||||
--- elfutils-0.155/libdw/Makefile.am 2012-08-27 20:27:31.000000000 +0200
|
||||
+++ elfutils-0.155.patch/libdw/Makefile.am 2013-03-05 18:12:26.753322780 +0100
|
||||
@@ -112,7 +112,6 @@
|
||||
-Wl,--version-script,$<,--no-undefined \
|
||||
-Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
|
||||
-ldl $(zip_LIBS)
|
||||
- if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
|
||||
ln -fs $@ $@.$(VERSION)
|
||||
|
||||
install: install-am libdw.so
|
||||
diff -Naur elfutils-0.155/libdw/Makefile.in elfutils-0.155.patch/libdw/Makefile.in
|
||||
--- elfutils-0.155/libdw/Makefile.in 2012-08-27 20:29:45.000000000 +0200
|
||||
+++ elfutils-0.155.patch/libdw/Makefile.in 2013-03-05 18:12:41.272246520 +0100
|
||||
@@ -844,7 +844,6 @@
|
||||
@MUDFLAP_FALSE@ -Wl,--version-script,$<,--no-undefined \
|
||||
@MUDFLAP_FALSE@ -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
|
||||
@MUDFLAP_FALSE@ -ldl $(zip_LIBS)
|
||||
-@MUDFLAP_FALSE@ if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
|
||||
@MUDFLAP_FALSE@ ln -fs $@ $@.$(VERSION)
|
||||
|
||||
@MUDFLAP_FALSE@install: install-am libdw.so
|
||||
diff -Naur elfutils-0.155/libelf/Makefile.am elfutils-0.155.patch/libelf/Makefile.am
|
||||
--- elfutils-0.155/libelf/Makefile.am 2012-08-27 20:27:31.000000000 +0200
|
||||
+++ elfutils-0.155.patch/libelf/Makefile.am 2013-03-05 18:13:23.328024851 +0100
|
||||
@@ -106,7 +106,6 @@
|
||||
$(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
|
||||
-Wl,--version-script,$(srcdir)/libelf.map,--no-undefined \
|
||||
-Wl,--soname,$@.$(VERSION),-z,defs,-z,relro $(libelf_so_LDLIBS)
|
||||
- if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
|
||||
ln -fs $@ $@.$(VERSION)
|
||||
|
||||
install: install-am libelf.so
|
||||
diff -Naur elfutils-0.155/libelf/Makefile.in elfutils-0.155.patch/libelf/Makefile.in
|
||||
--- elfutils-0.155/libelf/Makefile.in 2012-08-27 20:29:45.000000000 +0200
|
||||
+++ elfutils-0.155.patch/libelf/Makefile.in 2013-03-05 18:13:37.270951393 +0100
|
||||
@@ -830,7 +830,6 @@
|
||||
@MUDFLAP_FALSE@ $(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
|
||||
@MUDFLAP_FALSE@ -Wl,--version-script,$(srcdir)/libelf.map,--no-undefined \
|
||||
@MUDFLAP_FALSE@ -Wl,--soname,$@.$(VERSION),-z,defs,-z,relro $(libelf_so_LDLIBS)
|
||||
-@MUDFLAP_FALSE@ if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
|
||||
@MUDFLAP_FALSE@ ln -fs $@ $@.$(VERSION)
|
||||
|
||||
@MUDFLAP_FALSE@install: install-am libelf.so
|
||||
diff -Naur elfutils-0.155/src/Makefile.in elfutils-0.155.patch/src/Makefile.in
|
||||
--- elfutils-0.155/src/Makefile.in 2012-08-27 20:29:46.000000000 +0200
|
||||
+++ elfutils-0.155.patch/src/Makefile.in 2013-03-05 18:14:22.361713943 +0100
|
||||
@@ -867,7 +867,6 @@
|
||||
@NATIVE_LD_FALSE@ $(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
|
||||
@NATIVE_LD_FALSE@ $(libelf) $(libeu) \
|
||||
@NATIVE_LD_FALSE@ -Wl,--version-script,$(srcdir)/libld_elf_i386.map
|
||||
-@NATIVE_LD_FALSE@ $(textrel_check)
|
||||
|
||||
# Special rule to make it possible to define libld_elf_a_SOURCES as we do.
|
||||
# Otherwise make would complain.
|
@ -0,0 +1,26 @@
|
||||
diff -Naur elfutils-0.155/Makefile.am elfutils-0.155.patch/Makefile.am
|
||||
--- elfutils-0.155/Makefile.am 2012-08-27 20:27:31.000000000 +0200
|
||||
+++ elfutils-0.155.patch/Makefile.am 2013-03-05 18:38:47.565095550 +0100
|
||||
@@ -23,8 +23,7 @@
|
||||
pkginclude_HEADERS = version.h
|
||||
|
||||
# Add doc back when we have some real content.
|
||||
-SUBDIRS = config m4 lib libelf libebl libdwfl libdw libcpu libasm backends \
|
||||
- src po tests
|
||||
+SUBDIRS = config m4 lib libelf libebl libdwfl libdw
|
||||
|
||||
EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
|
||||
COPYING COPYING-GPLV2 COPYING-LGPLV3
|
||||
diff -Naur elfutils-0.155/Makefile.in elfutils-0.155.patch/Makefile.in
|
||||
--- elfutils-0.155/Makefile.in 2012-08-27 20:29:45.000000000 +0200
|
||||
+++ elfutils-0.155.patch/Makefile.in 2013-03-05 18:39:11.176974119 +0100
|
||||
@@ -256,8 +256,7 @@
|
||||
pkginclude_HEADERS = version.h
|
||||
|
||||
# Add doc back when we have some real content.
|
||||
-SUBDIRS = config m4 lib libelf libebl libdwfl libdw libcpu libasm backends \
|
||||
- src po tests
|
||||
+SUBDIRS = config m4 lib libelf libebl libdwfl libdw
|
||||
|
||||
EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
|
||||
COPYING COPYING-GPLV2 COPYING-LGPLV3
|
@ -1,45 +0,0 @@
|
||||
commit 210c2f03efbbaacc51f2641baa0947d9c316de12
|
||||
Author: Roland McGrath <roland@hack.frob.com>
|
||||
Date: Wed Mar 28 10:22:35 2012 -0700
|
||||
|
||||
RHBZ#805447: Fix core file grokking for case of truncated .dynstr
|
||||
|
||||
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
|
||||
index 87a0555..86f6fba 100644
|
||||
--- a/libdwfl/ChangeLog
|
||||
+++ b/libdwfl/ChangeLog
|
||||
@@ -1,3 +1,10 @@
|
||||
+2012-03-28 Roland McGrath <roland@hack.frob.com>
|
||||
+
|
||||
+ * dwfl_segment_report_module.c
|
||||
+ (dwfl_segment_report_module: read_portion): Don't use existing buffer
|
||||
+ when FILESZ is zero (string mode) and available portion doesn't hold
|
||||
+ a terminated string.
|
||||
+
|
||||
2011-12-02 Roland McGrath <roland@hack.frob.com>
|
||||
|
||||
* elf-from-memory.c (elf_from_remote_memory): Fix ELFCLASS64 case
|
||||
diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c
|
||||
index 012a0fd..5534180 100644
|
||||
--- a/libdwfl/dwfl_segment_report_module.c
|
||||
+++ b/libdwfl/dwfl_segment_report_module.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Sniff out modules from ELF headers visible in memory segments.
|
||||
- Copyright (C) 2008-2010 Red Hat, Inc.
|
||||
+ Copyright (C) 2008-2012 Red Hat, Inc.
|
||||
This file is part of Red Hat elfutils.
|
||||
|
||||
Red Hat elfutils is free software; you can redistribute it and/or modify
|
||||
@@ -155,7 +155,11 @@ dwfl_segment_report_module (Dwfl *dwfl, int ndx, const char *name,
|
||||
inline bool read_portion (void **data, size_t *data_size,
|
||||
GElf_Addr vaddr, size_t filesz)
|
||||
{
|
||||
- if (vaddr - start + filesz > buffer_available)
|
||||
+ if (vaddr - start + filesz > buffer_available
|
||||
+ /* If we're in string mode, then don't consider the buffer we have
|
||||
+ sufficient unless it contains the terminator of the string. */
|
||||
+ || (filesz == 0 && memchr (vaddr - start + buffer, '\0',
|
||||
+ buffer_available - (vaddr - start)) == NULL))
|
||||
{
|
||||
*data = NULL;
|
||||
*data_size = filesz;
|
Loading…
x
Reference in New Issue
Block a user