summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2011-09-06 13:20:39 +0000
committerAnthony G. Basile <blueness@gentoo.org>2011-09-06 13:20:39 +0000
commit18f9950911d3d126c8157849341a35418d8a2dd4 (patch)
treeea84e62922f5ab697aebef6198d198c9af06e41d /dev-util/elfkickers
parentApply patch to disable striping, we handle it by PM. (diff)
downloadgentoo-2-18f9950911d3d126c8157849341a35418d8a2dd4.tar.gz
gentoo-2-18f9950911d3d126c8157849341a35418d8a2dd4.tar.bz2
gentoo-2-18f9950911d3d126c8157849341a35418d8a2dd4.zip
Patch for missing ELF defs on FreeBSD, bug #380085
(Portage version: 2.1.10.11/cvs/Linux x86_64)
Diffstat (limited to 'dev-util/elfkickers')
-rw-r--r--dev-util/elfkickers/ChangeLog8
-rw-r--r--dev-util/elfkickers/elfkickers-3.0-r2.ebuild34
-rw-r--r--dev-util/elfkickers/files/add-freebsd-elf-defs.patch68
3 files changed, 109 insertions, 1 deletions
diff --git a/dev-util/elfkickers/ChangeLog b/dev-util/elfkickers/ChangeLog
index bd645652f1fc..0583c400d248 100644
--- a/dev-util/elfkickers/ChangeLog
+++ b/dev-util/elfkickers/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for dev-util/elfkickers
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-util/elfkickers/ChangeLog,v 1.41 2011/09/05 20:36:17 maekke Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/elfkickers/ChangeLog,v 1.42 2011/09/06 13:20:39 blueness Exp $
+
+*elfkickers-3.0-r2 (06 Sep 2011)
+
+ 06 Sep 2011; Anthony G. Basile <blueness@gentoo.org>
+ +elfkickers-3.0-r2.ebuild, +files/add-freebsd-elf-defs.patch:
+ Patch for missing ELF defs on FreeBSD, bug #380085
05 Sep 2011; Markus Meier <maekke@gentoo.org> elfkickers-3.0-r1.ebuild:
add ~arm, bug #380085
diff --git a/dev-util/elfkickers/elfkickers-3.0-r2.ebuild b/dev-util/elfkickers/elfkickers-3.0-r2.ebuild
new file mode 100644
index 000000000000..72dab508df41
--- /dev/null
+++ b/dev-util/elfkickers/elfkickers-3.0-r2.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-util/elfkickers/elfkickers-3.0-r2.ebuild,v 1.1 2011/09/06 13:20:39 blueness Exp $
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+MY_PN=${PN/elf/ELF}-${PV}
+S=${WORKDIR}/${MY_PN}
+
+DESCRIPTION="collection of programs to manipulate ELF files: sstrip, rebind, elfls, elftoc"
+HOMEPAGE="http://www.muppetlabs.com/~breadbox/software/elfkickers.html"
+SRC_URI="http://www.muppetlabs.com/~breadbox/pub/software/${MY_PN}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="doc"
+
+DEPEND="app-misc/pax-utils"
+RDEPEND=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/respect-CFLAGS-LDFLAGS.patch
+ epatch "${FILESDIR}"/create-destdir-path.patch
+ epatch "${FILESDIR}"/add-freebsd-elf-defs.patch
+ sed -i -e "s:^prefix = /usr/local:prefix = ${D}:" Makefile \
+ || die "sed failed"
+}
+
+src_compile() {
+ emake CC=$(tc-getCC) all
+}
diff --git a/dev-util/elfkickers/files/add-freebsd-elf-defs.patch b/dev-util/elfkickers/files/add-freebsd-elf-defs.patch
new file mode 100644
index 000000000000..792a91d6dfb2
--- /dev/null
+++ b/dev-util/elfkickers/files/add-freebsd-elf-defs.patch
@@ -0,0 +1,68 @@
+--- ./elfrw/elfrw.h.orig 2011-05-31 01:47:08.000000000 +0200
++++ ./elfrw/elfrw.h 2011-06-08 12:16:37.000000000 +0200
+@@ -10,6 +10,24 @@
+ #include <stdio.h>
+ #include <elf.h>
+
++#ifdef __FreeBSD__
++typedef uint16_t Elf64_Section;
++
++#define PT_GNU_STACK 0x6474e551
++#define PT_GNU_RELRO 0x6474e552
++
++#if __FreeBSD_version < 700022
++#define SHT_GNU_HASH 0x6ffffff6
++#define EM_CRIS 76
++#define EM_M32R 88
++#define EM_MN10300 89
++#endif
++
++#define ELFCLASSNUM 3
++#define ELFDATANUM 3
++#define EV_NUM 2
++#endif
++
+ /*
+ * The initialization functions. Call one of these to set the flavor
+ * of ELF structures to translate to and from. The library can be
+--- ./elftoc/readelf.h.orig 2011-05-22 20:46:29.000000000 +0200
++++ ./elftoc/readelf.h 2011-06-08 12:16:37.000000000 +0200
+@@ -7,6 +7,12 @@
+ #ifndef _readelf_h_
+ #define _readelf_h_
+
++#ifdef __FreeBSD__
++#define ELFCLASSNUM 3
++#define ELFDATANUM 3
++#define EV_NUM 2
++#endif
++
+ /* Read all of the basic headers from the file image (namely the ELF
+ * header, the program segment header table, and the section header
+ * table). False is returned if the file could not be parsed as an ELF
+--- ./elftoc/pieces.c.orig 2011-05-26 03:25:14.000000000 +0200
++++ ./elftoc/pieces.c 2011-06-08 12:16:37.000000000 +0200
+@@ -16,6 +16,10 @@
+ #include "out.h"
+ #include "pieces.h"
+
++#ifdef __FreeBSD__
++typedef uint64_t Elf32_Xword;
++#endif
++
+ /* Flags used to insert warnings in the generated source code.
+ */
+ #define PW_MISALIGNED 0x0001 /* piece misaligned for original type */
+--- ./elftoc/outbase.h.orig 2011-05-22 20:46:29.000000000 +0200
++++ ./elftoc/outbase.h 2011-06-08 12:16:37.000000000 +0200
+@@ -7,6 +7,10 @@
+ #ifndef _outbase_h_
+ #define _outbase_h_
+
++#ifdef __FreeBSD__
++#define NT_AUXV 6
++#endif
++
+ /* Set the current output file. Call this before calling any output
+ * functions. (The FILE* argument is given as a void* so as to not
+ * include stdio.h here.)