aboutsummaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authorcem <cem@FreeBSD.org>2016-07-14 01:48:54 +0800
committercem <cem@FreeBSD.org>2016-07-14 01:48:54 +0800
commit069c1fd26d5719296dfdcb0b3d34a98698156dbf (patch)
treeab51fff0d12ebcaa9f5ecac4eccad04a060ba2a6 /devel
parent305ca93a5d4e605795c276bee5c4c2ef9f7cc2f3 (diff)
downloadfreebsd-ports-graphics-069c1fd26d5719296dfdcb0b3d34a98698156dbf.tar.gz
freebsd-ports-graphics-069c1fd26d5719296dfdcb0b3d34a98698156dbf.tar.zst
freebsd-ports-graphics-069c1fd26d5719296dfdcb0b3d34a98698156dbf.zip
Add elfutils 0.163
Elfutils is a collection of utilities, including: stack (to show backtraces); nm (for listing symbols from object files); size (for listing the section sizes of an object or archive file); strip (for discarding symbols); readelf (to see the raw ELF file structures); elflint (to check for well-formed ELF files); and elfcompress (to compress or decompress ELF sections). It also provides libraries to allow other programs to manipulate ELF and DWARF data. WWW: https://fedorahosted.org/elfutils/ Reviewed by: bdrewery Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7206
Diffstat (limited to 'devel')
-rw-r--r--devel/Makefile1
-rw-r--r--devel/elfutils/Makefile42
-rw-r--r--devel/elfutils/distinfo3
-rw-r--r--devel/elfutils/files/patch-backends_x86__64__initreg.c10
-rw-r--r--devel/elfutils/files/patch-lib_Makefile.am11
-rw-r--r--devel/elfutils/files/patch-lib_byteswap.h5
-rw-r--r--devel/elfutils/files/patch-lib_endian.h5
-rw-r--r--devel/elfutils/files/patch-lib_error.c67
-rw-r--r--devel/elfutils/files/patch-lib_error.h21
-rw-r--r--devel/elfutils/files/patch-lib_eu-config.h150
-rw-r--r--devel/elfutils/files/patch-lib_exitfail.h5
-rw-r--r--devel/elfutils/files/patch-lib_features.h4
-rw-r--r--devel/elfutils/files/patch-lib_gettext.h4
-rw-r--r--devel/elfutils/files/patch-lib_ssp.h4
-rw-r--r--devel/elfutils/files/patch-lib_stdio__ext.h19
-rw-r--r--devel/elfutils/files/patch-lib_system.h34
-rw-r--r--devel/elfutils/files/patch-lib_vasnprintf.h26
-rw-r--r--devel/elfutils/files/patch-libdw_Makefile.am19
-rw-r--r--devel/elfutils/files/patch-libdwfl_dwfl__error.c22
-rw-r--r--devel/elfutils/files/patch-src_Makefile.am54
-rw-r--r--devel/elfutils/files/patch-src_ldgeneric.c23
-rw-r--r--devel/elfutils/files/patch-tests_Makefile.am55
-rw-r--r--devel/elfutils/pkg-descr5
-rw-r--r--devel/elfutils/pkg-plist72
24 files changed, 661 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index 7bcfbd0ad87..2e226e7a9a4 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -429,6 +429,7 @@
SUBDIR += elfrc
SUBDIR += elfsh
SUBDIR += elftoaout
+ SUBDIR += elfutils
SUBDIR += elixir-apex
SUBDIR += elixir-bson
SUBDIR += elixir-calendar
diff --git a/devel/elfutils/Makefile b/devel/elfutils/Makefile
new file mode 100644
index 00000000000..c630a1ca4f1
--- /dev/null
+++ b/devel/elfutils/Makefile
@@ -0,0 +1,42 @@
+# Created by: Conrad Meyer <cem@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME= elfutils
+PORTVERSION= 0.163
+CATEGORIES= devel
+MASTER_SITES= https://fedorahosted.org/releases/e/l/elfutils/
+
+MAINTAINER= cem@FreeBSD.org
+COMMENT= Library for manipulating ELF files and partial implementation of binutils
+
+LICENSE= LGPL3 GPLv2 GPLv3
+LICENSE_COMB= multi
+LICENSE_FILE_GPLv3= ${WRKSRC}/COPYING
+LICENSE_FILE_GPLv2= ${WRKSRC}/COPYING-GPLV2
+LICENSE_FILE_LGPL3= ${WRKSRC}/COPYING-LGPLV3
+
+BUILD_DEPENDS= gnulib>=0:devel/gnulib
+
+OPTIONS_DEFINE= NLS
+OPTIONS_SUB= yes
+
+NLS_USES= gettext
+NLS_CONFIGURE_ENABLE= nls
+
+USES= gmake libtool tar:bzip2
+USE_AUTOTOOLS= automake
+USE_GCC= 4.9+
+GNU_CONFIGURE= yes
+
+# Avoid conflict with binutils / elftoolchain programs with the same names:
+CONFIGURE_ARGS+= --program-prefix=eu-
+
+post-patch:
+ @cd $(WRKSRC) && ${AUTOMAKE}
+ @${CP} -a \
+ $(LOCALBASE)/share/gnulib/lib/obstack.c \
+ $(LOCALBASE)/share/gnulib/lib/obstack.h \
+ $(LOCALBASE)/share/gnulib/lib/obstack_printf.c \
+ $(WRKSRC)/lib
+
+.include <bsd.port.mk>
diff --git a/devel/elfutils/distinfo b/devel/elfutils/distinfo
new file mode 100644
index 00000000000..4fc23908cb0
--- /dev/null
+++ b/devel/elfutils/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1468426694
+SHA256 (elfutils-0.163.tar.bz2) = 7c774f1eef329309f3b05e730bdac50013155d437518a2ec0e24871d312f2e23
+SIZE (elfutils-0.163.tar.bz2) = 6029307
diff --git a/devel/elfutils/files/patch-backends_x86__64__initreg.c b/devel/elfutils/files/patch-backends_x86__64__initreg.c
new file mode 100644
index 00000000000..c0a3baf2053
--- /dev/null
+++ b/devel/elfutils/files/patch-backends_x86__64__initreg.c
@@ -0,0 +1,10 @@
+--- backends/x86_64_initreg.c.orig 2014-06-17 18:51:09 UTC
++++ backends/x86_64_initreg.c
+@@ -32,6 +32,7 @@
+
+ #include <stdlib.h>
+ #ifdef __x86_64__
++# include <sys/types.h>
+ # include <sys/user.h>
+ # include <sys/ptrace.h>
+ #endif
diff --git a/devel/elfutils/files/patch-lib_Makefile.am b/devel/elfutils/files/patch-lib_Makefile.am
new file mode 100644
index 00000000000..7f27927b9ea
--- /dev/null
+++ b/devel/elfutils/files/patch-lib_Makefile.am
@@ -0,0 +1,11 @@
+--- lib/Makefile.am.orig 2016-07-13 07:11:15 UTC
++++ lib/Makefile.am
+@@ -35,7 +35,7 @@ noinst_LIBRARIES = libeu.a
+
+ libeu_a_SOURCES = xstrdup.c xstrndup.c xmalloc.c next_prime.c \
+ crc32.c crc32_file.c md5.c sha1.c \
+- color.c
++ color.c error.c obstack.c obstack_printf.c
+
+ noinst_HEADERS = fixedsizehash.h system.h dynamicsizehash.h list.h md5.h \
+ sha1.h eu-config.h
diff --git a/devel/elfutils/files/patch-lib_byteswap.h b/devel/elfutils/files/patch-lib_byteswap.h
new file mode 100644
index 00000000000..b8953b70942
--- /dev/null
+++ b/devel/elfutils/files/patch-lib_byteswap.h
@@ -0,0 +1,5 @@
+--- lib/byteswap.h.orig 2016-07-13 06:58:54 UTC
++++ lib/byteswap.h
+@@ -0,0 +1,2 @@
++#pragma once
++#include <sys/endian.h>
diff --git a/devel/elfutils/files/patch-lib_endian.h b/devel/elfutils/files/patch-lib_endian.h
new file mode 100644
index 00000000000..7319d82c338
--- /dev/null
+++ b/devel/elfutils/files/patch-lib_endian.h
@@ -0,0 +1,5 @@
+--- lib/endian.h.orig 2016-07-13 06:58:54 UTC
++++ lib/endian.h
+@@ -0,0 +1,2 @@
++#pragma once
++#include <sys/endian.h>
diff --git a/devel/elfutils/files/patch-lib_error.c b/devel/elfutils/files/patch-lib_error.c
new file mode 100644
index 00000000000..e80726187fb
--- /dev/null
+++ b/devel/elfutils/files/patch-lib_error.c
@@ -0,0 +1,67 @@
+--- lib/error.c.orig 2016-07-13 06:58:54 UTC
++++ lib/error.c
+@@ -0,0 +1,64 @@
++#include <err.h>
++#include <errno.h>
++#include <stdarg.h>
++#include <stdio.h>
++
++#include "error.h"
++
++unsigned int error_message_count;
++int error_one_per_line;
++void (*error_print_progname)(void) = NULL;
++
++static const char *lastfile;
++static unsigned lastline;
++
++/* Good enough. */
++
++void
++error_at_line(int status, int errnum, const char *fn, unsigned line,
++ const char *format, ...)
++{
++ va_list ap;
++ int serrno;
++
++ if (error_one_per_line != 0 && fn != NULL && fn == lastfile && line ==
++ lastline)
++ return;
++
++ serrno = errno;
++ errno = errnum;
++
++ fflush(stdout);
++
++ if (error_print_progname != NULL) {
++ error_print_progname();
++ fprintf(stderr, ":");
++ }
++
++ if (fn != NULL) {
++ lastfile = fn;
++ lastline = line;
++
++ fprintf(stderr, "%s:%u: ", fn, line);
++ } else if (error_print_progname != NULL) {
++ fprintf(stderr, " ");
++ }
++
++ va_start(ap, format);
++ if (status) {
++ if (errnum)
++ verr(status, format, ap);
++ else
++ verrx(status, format, ap);
++ } else {
++ if (errnum)
++ vwarn(format, ap);
++ else
++ vwarnx(format, ap);
++ }
++ va_end(ap);
++
++ errno = serrno;
++ error_message_count++;
++}
++
diff --git a/devel/elfutils/files/patch-lib_error.h b/devel/elfutils/files/patch-lib_error.h
new file mode 100644
index 00000000000..e2d04d68129
--- /dev/null
+++ b/devel/elfutils/files/patch-lib_error.h
@@ -0,0 +1,21 @@
+--- lib/error.h.orig 2016-07-13 06:58:54 UTC
++++ lib/error.h
+@@ -0,0 +1,18 @@
++#pragma once
++
++/*
++ * error, error_at_line, error_message_count, error_one_per_line,
++ * error_print_progname - glibc error reporting functions
++ */
++
++/* void error(int status, int errnum, const char *format, ...); */
++#define error(st, en, ...) error_at_line(st, en, NULL, 0, __VA_ARGS__)
++
++void error_at_line(int status, int errnum, const char *filename,
++ unsigned int linenum, const char *format, ...);
++
++extern unsigned int error_message_count;
++
++extern int error_one_per_line;
++
++extern void (*error_print_progname) (void);
diff --git a/devel/elfutils/files/patch-lib_eu-config.h b/devel/elfutils/files/patch-lib_eu-config.h
new file mode 100644
index 00000000000..74377ed8830
--- /dev/null
+++ b/devel/elfutils/files/patch-lib_eu-config.h
@@ -0,0 +1,150 @@
+--- lib/eu-config.h.orig 2015-06-11 11:38:55 UTC
++++ lib/eu-config.h
+@@ -187,4 +187,147 @@ asm (".section predict_data, \"aw\"; .pr
+ #endif
+
+
++/* FreeBSD ports of glibcisms */
++#include <sys/cdefs.h>
++#include <libgen.h>
++#include <stdarg.h>
++#include <stdint.h>
++#include <stdlib.h>
++#include <string.h>
++#include <wchar.h>
++
++#define _GL_ATTRIBUTE_PURE __attribute__((__pure__))
++
++struct obstack;
++extern int obstack_printf(struct obstack *, const char *, ...);
++extern int obstack_vprintf(struct obstack *, const char *, va_list);
++
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wshadow"
++static inline void *
++mempcpy(void * restrict dst, const void * restrict src, size_t len)
++{
++
++ return (((char *)memcpy(dst, src, len)) + len);
++}
++
++static inline wchar_t *
++wmempcpy(wchar_t * restrict dst, const wchar_t * restrict src, size_t len)
++{
++
++ return (wmemcpy(dst, src, len) + len);
++}
++#pragma GCC diagnostic pop
++
++static inline void *
++rawmemchr(const void *s, int c)
++{
++
++ return (memchr(s, c, SIZE_MAX));
++}
++
++static inline void
++tdestroy(void *vroot __unused, void (*freefct)(void *) __unused)
++{
++
++ /* XXX: Just leak the memory for now. */
++}
++
++static inline char *
++canonicalize_file_name(const char *path)
++{
++
++ return (realpath(path, NULL));
++}
++
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expr) ({ \
++ long value; \
++ do { \
++ value = (long)(expr); \
++ } while (value == -1 && errno == EINTR); \
++ (value); \
++})
++#endif
++
++#define strndupa(s, n) \
++({ \
++ size_t len = (n); \
++ const char *end; \
++ char *res; \
++ \
++ end = memchr((s), 0, (n)); \
++ if (end != NULL) \
++ len = end - (s); \
++ \
++ res = alloca(len + 1); \
++ memcpy(res, (s), len); \
++ res[len] = '\0'; \
++ res; \
++})
++
++
++#define program_invocation_short_name __DECONST(char *, getprogname())
++#ifndef loff_t
++#define loff_t off_t
++#endif
++#ifndef off64_t
++#define off64_t off_t
++#endif
++
++#define ftruncate64 ftruncate
++#define open64 open
++#define fstat64 fstat
++#define stat64 stat
++#define pread64 pread
++#define mmap64 mmap
++#define lseek64 lseek
++
++#define MAP_POPULATE MAP_PREFAULT_READ
++
++#define bswap_16 bswap16
++#define bswap_32 bswap32
++#define bswap_64 bswap64
++
++#define fputc_unlocked putc_unlocked
++#define fputs_unlocked fputs
++#define fwrite_unlocked fwrite
++#define fread_unlocked fread
++
++#ifndef __BYTE_ORDER
++#define __BYTE_ORDER _BYTE_ORDER
++#endif
++#ifndef __LITTLE_ENDIAN
++#define __LITTLE_ENDIAN _LITTLE_ENDIAN
++#endif
++#ifndef __BIG_ENDIAN
++#define __BIG_ENDIAN _BIG_ENDIAN
++#endif
++
++#define DL_CALL_FCT(fn, args) ((fn) args)
++
++/* This package doesn't really respect --disable-nls. Hack it. */
++#if !ENABLE_NLS
++/* Skip loading libintl.h, which is hardcoded in most source files: */
++#define _LIBINTL_H 1
++#define dgettext(module, str) (str)
++#define gettext(str) (str)
++
++static inline char *
++bindtextdomain(const char *d __unused, const char *dr __unused)
++{
++
++ return ("/");
++}
++
++static inline char *
++textdomain(const char *dom)
++{
++
++ return (__DECONST(char *, dom));
++}
++
++#define ngettext(s, p, n) (((n) == 1) ? (s) : (p))
++#endif
++
+ #endif /* eu-config.h */
diff --git a/devel/elfutils/files/patch-lib_exitfail.h b/devel/elfutils/files/patch-lib_exitfail.h
new file mode 100644
index 00000000000..0a416c7cae1
--- /dev/null
+++ b/devel/elfutils/files/patch-lib_exitfail.h
@@ -0,0 +1,5 @@
+--- lib/exitfail.h.orig 2016-07-13 08:19:52 UTC
++++ lib/exitfail.h
+@@ -0,0 +1,2 @@
++#pragma once
++#define exit_failure EXIT_FAILURE
diff --git a/devel/elfutils/files/patch-lib_features.h b/devel/elfutils/files/patch-lib_features.h
new file mode 100644
index 00000000000..0772552e82d
--- /dev/null
+++ b/devel/elfutils/files/patch-lib_features.h
@@ -0,0 +1,4 @@
+--- lib/features.h.orig 2016-07-13 04:39:31 UTC
++++ lib/features.h
+@@ -0,0 +1,1 @@
++/* Nop. */
diff --git a/devel/elfutils/files/patch-lib_gettext.h b/devel/elfutils/files/patch-lib_gettext.h
new file mode 100644
index 00000000000..90e2e7fde9b
--- /dev/null
+++ b/devel/elfutils/files/patch-lib_gettext.h
@@ -0,0 +1,4 @@
+--- lib/gettext.h.orig 2016-07-13 08:20:19 UTC
++++ lib/gettext.h
+@@ -0,0 +1 @@
++/* Nop */
diff --git a/devel/elfutils/files/patch-lib_ssp.h b/devel/elfutils/files/patch-lib_ssp.h
new file mode 100644
index 00000000000..57d840e50be
--- /dev/null
+++ b/devel/elfutils/files/patch-lib_ssp.h
@@ -0,0 +1,4 @@
+--- lib/ssp.h.orig 2016-07-13 06:58:54 UTC
++++ lib/ssp.h
+@@ -0,0 +1 @@
++#include <ssp/ssp.h>
diff --git a/devel/elfutils/files/patch-lib_stdio__ext.h b/devel/elfutils/files/patch-lib_stdio__ext.h
new file mode 100644
index 00000000000..25143d759fd
--- /dev/null
+++ b/devel/elfutils/files/patch-lib_stdio__ext.h
@@ -0,0 +1,19 @@
+--- lib/stdio_ext.h.orig 2016-07-13 06:58:54 UTC
++++ lib/stdio_ext.h
+@@ -0,0 +1,16 @@
++#pragma once
++#include <stdio.h>
++
++enum {
++ FSETLOCKING_QUERY,
++ FSETLOCKING_INTERNAL,
++ FSETLOCKING_BYCALLER,
++};
++
++static inline int
++__fsetlocking(FILE *fp __unused, int type __unused)
++{
++
++ /* No-op on FreeBSD? */
++ return (FSETLOCKING_BYCALLER);
++}
diff --git a/devel/elfutils/files/patch-lib_system.h b/devel/elfutils/files/patch-lib_system.h
new file mode 100644
index 00000000000..715fa393b51
--- /dev/null
+++ b/devel/elfutils/files/patch-lib_system.h
@@ -0,0 +1,34 @@
+--- lib/system.h.orig 2014-02-05 00:21:43 UTC
++++ lib/system.h
+@@ -29,6 +29,8 @@
+ #ifndef LIB_SYSTEM_H
+ #define LIB_SYSTEM_H 1
+
++#include <ssp/string.h>
++
+ #include <argp.h>
+ #include <stddef.h>
+ #include <stdint.h>
+@@ -36,16 +38,18 @@
+ #include <byteswap.h>
+ #include <unistd.h>
+
++#include <eu-config.h>
++
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
+ # define LE32(n) (n)
+ # define LE64(n) (n)
+-# define BE32(n) bswap_32 (n)
+-# define BE64(n) bswap_64 (n)
++# define BE32(n) bswap32 (n)
++# define BE64(n) bswap64 (n)
+ #elif __BYTE_ORDER == __BIG_ENDIAN
+ # define BE32(n) (n)
+ # define BE64(n) (n)
+-# define LE32(n) bswap_32 (n)
+-# define LE64(n) bswap_64 (n)
++# define LE32(n) bswap32 (n)
++# define LE64(n) bswap64 (n)
+ #else
+ # error "Unknown byte order"
+ #endif
diff --git a/devel/elfutils/files/patch-lib_vasnprintf.h b/devel/elfutils/files/patch-lib_vasnprintf.h
new file mode 100644
index 00000000000..6bbc1784b62
--- /dev/null
+++ b/devel/elfutils/files/patch-lib_vasnprintf.h
@@ -0,0 +1,26 @@
+--- lib/vasnprintf.h.orig 2016-07-13 08:19:27 UTC
++++ lib/vasnprintf.h
+@@ -0,0 +1,23 @@
++#pragma once
++#include <stdarg.h>
++#include <stdio.h>
++
++static inline char *
++vasnprintf(char *resultbuf, size_t *lengthp, const char *format, va_list args)
++{
++ char *alloc;
++ int len;
++
++ len = vasprintf(&alloc, format, args);
++ if (len < 0)
++ return (NULL);
++
++ *lengthp = len;
++
++ if (resultbuf != NULL && (size_t)len < *lengthp) {
++ memcpy(resultbuf, alloc, len + 1);
++ free(alloc);
++ return (resultbuf);
++ }
++ return (alloc);
++}
diff --git a/devel/elfutils/files/patch-libdw_Makefile.am b/devel/elfutils/files/patch-libdw_Makefile.am
new file mode 100644
index 00000000000..b07b6ec55cc
--- /dev/null
+++ b/devel/elfutils/files/patch-libdw_Makefile.am
@@ -0,0 +1,19 @@
+--- libdw/Makefile.am.orig 2015-06-10 19:44:33 UTC
++++ libdw/Makefile.am
+@@ -105,14 +105,14 @@ am_libdw_pic_a_OBJECTS = $(libdw_a_SOURC
+ libdw_so_SOURCES =
+ libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \
+ ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
+- ../libelf/libelf.so
++ ../libelf/libelf.so ../lib/libeu.a
+ # The rpath is necessary for libebl because its $ORIGIN use will
+ # not fly in a setuid executable that links in libdw.
+ $(LINK) -shared -o $@ -Wl,--soname,$@.$(VERSION),-z,defs \
+ -Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
+ -Wl,--version-script,$<,--no-undefined \
+ -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
+- -ldl $(argp_LDADD) $(zip_LIBS)
++ $(argp_LDADD) $(zip_LIBS)
+ @$(textrel_check)
+ ln -fs $@ $@.$(VERSION)
+
diff --git a/devel/elfutils/files/patch-libdwfl_dwfl__error.c b/devel/elfutils/files/patch-libdwfl_dwfl__error.c
new file mode 100644
index 00000000000..f0a605d17c0
--- /dev/null
+++ b/devel/elfutils/files/patch-libdwfl_dwfl__error.c
@@ -0,0 +1,22 @@
+--- libdwfl/dwfl_error.c.orig 2015-06-10 19:44:33 UTC
++++ libdwfl/dwfl_error.c
+@@ -136,7 +136,7 @@ __libdwfl_seterrno (Dwfl_Error error)
+ global_error = canonicalize (error);
+ }
+
+-
++static __thread char strerr_buf[64];
+ const char *
+ dwfl_errmsg (error)
+ int error;
+@@ -155,7 +155,9 @@ dwfl_errmsg (error)
+ switch (error &~ 0xffff)
+ {
+ case OTHER_ERROR (ERRNO):
+- return strerror_r (error & 0xffff, "bad", 0);
++ strcpy(strerr_buf, "bad");
++ (void)strerror_r (error & 0xffff, strerr_buf, sizeof strerr_buf);
++ return strerr_buf;
+ case OTHER_ERROR (LIBELF):
+ return elf_errmsg (error & 0xffff);
+ case OTHER_ERROR (LIBDW):
diff --git a/devel/elfutils/files/patch-src_Makefile.am b/devel/elfutils/files/patch-src_Makefile.am
new file mode 100644
index 00000000000..3d629265a0f
--- /dev/null
+++ b/devel/elfutils/files/patch-src_Makefile.am
@@ -0,0 +1,54 @@
+--- src/Makefile.am.orig 2015-06-11 11:38:55 UTC
++++ src/Makefile.am
+@@ -72,11 +72,11 @@ CLEANFILES += make-debug-archive
+
+ if BUILD_STATIC
+ libasm = ../libasm/libasm.a
+-libdw = ../libdw/libdw.a $(zip_LIBS) $(libelf) $(libebl) -ldl
++libdw = ../libdw/libdw.a $(zip_LIBS) $(libelf) $(libebl) $(libeu)
+ libelf = ../libelf/libelf.a
+ else
+ libasm = ../libasm/libasm.so
+-libdw = ../libdw/libdw.so
++libdw = ../libdw/libdw.so $(libeu)
+ libelf = ../libelf/libelf.so
+ endif
+ libebl = ../libebl/libebl.a
+@@ -103,27 +103,27 @@ ranlib_no_Wstack_usage = yes
+ ar_no_Wstack_usage = yes
+ unstrip_no_Wstack_usage = yes
+
+-readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
+-nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl \
++readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD)
++nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) \
+ $(demanglelib)
+ size_LDADD = $(libelf) $(libeu) $(argp_LDADD)
+-strip_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
+-ld_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
++strip_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD)
++ld_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD)
+ if NATIVE_LD
+-# -ldl is always needed for libebl.
++# is always needed for libebl.
+ ld_LDADD += libld_elf.a
+ endif
+ ld_LDFLAGS = -rdynamic
+-elflint_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
++elflint_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD)
+ findtextrel_LDADD = $(libdw) $(libelf) $(argp_LDADD)
+ addr2line_LDADD = $(libdw) $(libelf) $(argp_LDADD) $(demanglelib)
+-elfcmp_LDADD = $(libebl) $(libelf) $(argp_LDADD) -ldl
+-objdump_LDADD = $(libasm) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
++elfcmp_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD)
++objdump_LDADD = $(libasm) $(libebl) $(libelf) $(libeu) $(argp_LDADD)
+ ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
+ strings_LDADD = $(libelf) $(libeu) $(argp_LDADD)
+ ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
+-unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl
+-stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl $(demanglelib)
++unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
++stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(demanglelib)
+
+ ldlex.o: ldscript.c
+ ldlex_no_Werror = yes
diff --git a/devel/elfutils/files/patch-src_ldgeneric.c b/devel/elfutils/files/patch-src_ldgeneric.c
new file mode 100644
index 00000000000..edad433e5cb
--- /dev/null
+++ b/devel/elfutils/files/patch-src_ldgeneric.c
@@ -0,0 +1,23 @@
+--- src/ldgeneric.c.orig 2014-02-05 00:21:44 UTC
++++ src/ldgeneric.c
+@@ -2631,9 +2631,9 @@ ld_generic_generate_sections (struct ld_
+ /* Callback function registered with on_exit to make sure the temporary
+ files gets removed if something goes wrong. */
+ static void
+-remove_tempfile (int status, void *arg)
++remove_tempfile (void)
+ {
+- if (status != 0 && ld_state.tempfname != NULL)
++ if (ld_state.tempfname != NULL)
+ unlink (ld_state.tempfname);
+ }
+
+@@ -2680,7 +2680,7 @@ ld_generic_open_outfile (struct ld_state
+
+ /* Make sure we remove the temporary file in case something goes
+ wrong. */
+- on_exit (remove_tempfile, NULL);
++ atexit (remove_tempfile);
+
+ /* Create the ELF file data for the output file. */
+ Elf *elf = ld_state.outelf = elf_begin (fd,
diff --git a/devel/elfutils/files/patch-tests_Makefile.am b/devel/elfutils/files/patch-tests_Makefile.am
new file mode 100644
index 00000000000..c6eb1e44067
--- /dev/null
+++ b/devel/elfutils/files/patch-tests_Makefile.am
@@ -0,0 +1,55 @@
+--- tests/Makefile.am.orig 2015-06-11 11:38:55 UTC
++++ tests/Makefile.am
+@@ -346,7 +346,7 @@ libasm = -lasm
+ libebl = -lebl
+ else !STANDALONE
+ if BUILD_STATIC
+-libdw = ../libdw/libdw.a $(zip_LIBS) $(libelf) $(libebl) -ldl
++libdw = ../libdw/libdw.a $(zip_LIBS) $(libelf) $(libebl)
+ libelf = ../libelf/libelf.a
+ libasm = ../libasm/libasm.a
+ else
+@@ -389,27 +389,27 @@ funcretval_LDADD = $(libdw) $(argp_LDADD
+ allregs_LDADD = $(libdw) $(argp_LDADD)
+ find_prologues_LDADD = $(libdw) $(argp_LDADD)
+ #show_ciefde_LDADD = ../libdwarf/libdwarf.so $(libelf)
+-asm_tst1_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+-asm_tst2_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+-asm_tst3_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+-asm_tst4_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+-asm_tst5_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+-asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+-asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+-asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+-asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) -ldl
+-dwflmodtest_LDADD = $(libdw) $(libebl) $(libelf) $(argp_LDADD) -ldl
++asm_tst1_LDADD = $(libasm) $(libebl) $(libelf)
++asm_tst2_LDADD = $(libasm) $(libebl) $(libelf)
++asm_tst3_LDADD = $(libasm) $(libebl) $(libelf)
++asm_tst4_LDADD = $(libasm) $(libebl) $(libelf)
++asm_tst5_LDADD = $(libasm) $(libebl) $(libelf)
++asm_tst6_LDADD = $(libasm) $(libebl) $(libelf)
++asm_tst7_LDADD = $(libasm) $(libebl) $(libelf)
++asm_tst8_LDADD = $(libasm) $(libebl) $(libelf)
++asm_tst9_LDADD = $(libasm) $(libebl) $(libelf)
++dwflmodtest_LDADD = $(libdw) $(libebl) $(libelf) $(argp_LDADD)
+ rdwrmmap_LDADD = $(libelf)
+-dwfl_bug_addr_overflow_LDADD = $(libdw) $(libebl) $(libelf) -ldl
++dwfl_bug_addr_overflow_LDADD = $(libdw) $(libebl) $(libelf)
+ arls_LDADD = $(libelf)
+-dwfl_bug_fd_leak_LDADD = $(libdw) $(libebl) $(libelf) -ldl
+-dwfl_bug_report_LDADD = $(libdw) $(libebl) $(libelf) -ldl
+-dwfl_bug_getmodules_LDADD = $(libdw) $(libebl) $(libelf) -ldl
+-dwfl_addr_sect_LDADD = $(libdw) $(libebl) $(libelf) $(argp_LDADD) -ldl
++dwfl_bug_fd_leak_LDADD = $(libdw) $(libebl) $(libelf)
++dwfl_bug_report_LDADD = $(libdw) $(libebl) $(libelf)
++dwfl_bug_getmodules_LDADD = $(libdw) $(libebl) $(libelf)
++dwfl_addr_sect_LDADD = $(libdw) $(libebl) $(libelf) $(argp_LDADD)
+ dwarf_getmacros_LDADD = $(libdw)
+ dwarf_ranges_LDADD = $(libdw)
+ dwarf_getstring_LDADD = $(libdw)
+-addrcfi_LDADD = $(libdw) $(libebl) $(libelf) $(argp_LDADD) -ldl
++addrcfi_LDADD = $(libdw) $(libebl) $(libelf) $(argp_LDADD)
+ test_flag_nobits_LDADD = $(libelf)
+ rerequest_tag_LDADD = $(libdw)
+ alldts_LDADD = $(libebl) $(libelf)
diff --git a/devel/elfutils/pkg-descr b/devel/elfutils/pkg-descr
new file mode 100644
index 00000000000..29c29b17491
--- /dev/null
+++ b/devel/elfutils/pkg-descr
@@ -0,0 +1,5 @@
+Elfutils provides a set of binutils-replacement tools,
+prefixed with eu-, as well as a set of libraries for
+manipulating ELF and DWARF data.
+
+WWW: https://fedorahosted.org/elfutils/
diff --git a/devel/elfutils/pkg-plist b/devel/elfutils/pkg-plist
new file mode 100644
index 00000000000..c12df7ea612
--- /dev/null
+++ b/devel/elfutils/pkg-plist
@@ -0,0 +1,72 @@
+bin/eu-addr2line
+bin/eu-ar
+bin/eu-elfcmp
+bin/eu-elflint
+bin/eu-findtextrel
+bin/eu-ld
+bin/eu-make-debug-archive
+bin/eu-nm
+bin/eu-objdump
+bin/eu-ranlib
+bin/eu-readelf
+bin/eu-size
+bin/eu-stack
+bin/eu-strings
+bin/eu-strip
+bin/eu-unstrip
+include/dwarf.h
+include/elfutils/elf-knowledge.h
+include/elfutils/known-dwarf.h
+include/elfutils/libasm.h
+include/elfutils/libdw.h
+include/elfutils/libdwelf.h
+include/elfutils/libdwfl.h
+include/elfutils/libebl.h
+include/elfutils/version.h
+include/gelf.h
+include/libelf.h
+include/nlist.h
+lib/elfutils/libebl_aarch64-0.163.so
+lib/elfutils/libebl_aarch64.so
+lib/elfutils/libebl_alpha-0.163.so
+lib/elfutils/libebl_alpha.so
+lib/elfutils/libebl_arm-0.163.so
+lib/elfutils/libebl_arm.so
+lib/elfutils/libebl_i386-0.163.so
+lib/elfutils/libebl_i386.so
+lib/elfutils/libebl_ia64-0.163.so
+lib/elfutils/libebl_ia64.so
+lib/elfutils/libebl_ppc-0.163.so
+lib/elfutils/libebl_ppc.so
+lib/elfutils/libebl_ppc64-0.163.so
+lib/elfutils/libebl_ppc64.so
+lib/elfutils/libebl_s390-0.163.so
+lib/elfutils/libebl_s390.so
+lib/elfutils/libebl_sh-0.163.so
+lib/elfutils/libebl_sh.so
+lib/elfutils/libebl_sparc-0.163.so
+lib/elfutils/libebl_sparc.so
+lib/elfutils/libebl_tilegx-0.163.so
+lib/elfutils/libebl_tilegx.so
+lib/elfutils/libebl_x86_64-0.163.so
+lib/elfutils/libebl_x86_64.so
+lib/libasm-0.163.so
+lib/libasm.a
+lib/libasm.so
+lib/libasm.so.1
+lib/libdw-0.163.so
+lib/libdw.a
+lib/libdw.so
+lib/libdw.so.1
+lib/libebl.a
+lib/libelf-0.163.so
+lib/libelf.a
+lib/libelf.so
+lib/libelf.so.1
+%%NLS%%share/locale/de/LC_MESSAGES/elfutils.mo
+%%NLS%%share/locale/en@boldquot/LC_MESSAGES/elfutils.mo
+%%NLS%%share/locale/en@quot/LC_MESSAGES/elfutils.mo
+%%NLS%%share/locale/es/LC_MESSAGES/elfutils.mo
+%%NLS%%share/locale/ja/LC_MESSAGES/elfutils.mo
+%%NLS%%share/locale/pl/LC_MESSAGES/elfutils.mo
+%%NLS%%share/locale/uk/LC_MESSAGES/elfutils.mo