summaryrefslogtreecommitdiff
path: root/sys-devel/prelink
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-devel/prelink
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-devel/prelink')
-rw-r--r--sys-devel/prelink/Manifest14
-rw-r--r--sys-devel/prelink/files/prelink-20130503-libiberty-md5.patch61
-rw-r--r--sys-devel/prelink/files/prelink-20130503-prelink-conf.patch39
-rw-r--r--sys-devel/prelink/files/prelink-armhf-dynamic-linker.patch12
-rw-r--r--sys-devel/prelink/files/prelink.confd43
-rw-r--r--sys-devel/prelink/files/prelink.cron61
-rw-r--r--sys-devel/prelink/metadata.xml8
-rw-r--r--sys-devel/prelink/prelink-20130503-r1.ebuild78
-rw-r--r--sys-devel/prelink/prelink-20130503.ebuild83
-rw-r--r--sys-devel/prelink/prelink-20151030.ebuild66
10 files changed, 465 insertions, 0 deletions
diff --git a/sys-devel/prelink/Manifest b/sys-devel/prelink/Manifest
new file mode 100644
index 000000000000..bdbccb11cd5b
--- /dev/null
+++ b/sys-devel/prelink/Manifest
@@ -0,0 +1,14 @@
+AUX prelink-20130503-libiberty-md5.patch 2604 SHA256 4d09fe9a9bb731e24681ced804c541f63c9976ac1320960678eccd80a3b234c3 SHA512 5240d1d0d2a0014aa117f09cb8af872cda178401d09d1df4260bfedecf0aa74b2c713dc08ba0cf08a15aba2e49155a40047c30f7907b27a65f39ebbf8ad4f9ca WHIRLPOOL d7a537b60d2297491cf96d738dabe5ce1a88a9aab7e5e67027daa84c3a44d6ad207f77cb28e880beb576b6c64ab4f863765f1d932ddaff53270d3caee6719097
+AUX prelink-20130503-prelink-conf.patch 910 SHA256 52d2c0d52bde5c6ea9b2101d37dc4dbca988f5aece517ad85ee1ff4be2ff2a9d SHA512 640fce42bac33d76a9ed312a138817695b57b03e7b0d1c57b074903739c3fb3b7c64b8c0d839687dd60fd50054d682f2f095c3f0eff7d5f4fe505d6c334267b2 WHIRLPOOL 60fcaa242576c52fdbcbe1715b9087de191399346164deff143646a8a4a8b92d518b5ac6b22c64f4c7c4321d11a0932c32ffd6fdca581bab5a1c7006b77c1499
+AUX prelink-armhf-dynamic-linker.patch 519 SHA256 d6ca6ce138a5e33568376068e5e48425e2601e17863f17f166abcb36772c45ff SHA512 af898440f11af102d6d4b95ade2ed267dc5e3e01407ded17ca2df7454ee845f8177c0316e9bc73838f3965f5000f58ac51055588fdb4a90293cc431e07e9e467 WHIRLPOOL 48c3f54c56dd2e324f7d33b7ebeb71b6123c7c263baa3c8a98306a209bcbf2a454fc2b816df836f7d6c37e143b65e8b1a59ae2f62e3594a9a949267e1a3246e9
+AUX prelink.confd 1677 SHA256 e5db6bcc86a010a50be9134cb440f8366247ee36f1556f97d4f270746eb59dea SHA512 d9edf2535d0b5f1effa797882abfc1cae71a4944e7a443880845a6f860d160125f2ab3a1d69db444e31a35b62a09ed661adcbc1ee62539e9a73f270d33602e9b WHIRLPOOL a584d7b609dcd545930f95934f2de8cc15f39c6ff0c9e0cf92d13429842960ef27f91e23026dd74a72c2e755e150c5837c7d026dc88b5965ba514503fb7a83c1
+AUX prelink.cron 2424 SHA256 6258d94475db9f58902c1e13ef0f3abe1422f0c955d6e385455a4c7e8f63957c SHA512 0c336bcd3b77fabd978d637b4063bb88ac6a675ba910b374af0373a0a7567ecffd356bf5a5532d66fab119d975fd7cc4f3c359b46f2696d313388aa6eb140f7d WHIRLPOOL 1facaf56c783c7ee1227cb4e45b4c1531b7d1bcb8cf8e4a70fb17c1f17669be7d21bb2aa3e0d06d2bddd4b6c96ddbd7799cfe4fd13def7389912c05113bf6c29
+DIST prelink-20130503.tar.bz2 928040 SHA256 6339c7605e9b6f414d1be32530c9c8011f38820d36431c8a62e8674ca37140f0 SHA512 69138a695e3e535deacd8224f6f8364ff64b8868b87b516d1f3392d9df968f77265177e9fede09c38f16aa878f9fd57a9ec39f0d9deabc0c9c01609b11156ba3 WHIRLPOOL 51b4234009c6ac6e6f45f09e3513feb5efe1dbf9d705b55f88d0443fe386bacbe04fa4a4e5d60caf40ef0a98a5557eb2e9f3a11549ec01c0200c324cb948ab34
+DIST prelink-cross-20151030.tar.bz2 701337 SHA256 c87a8c4f0805d80d6b48b63a430537f58e8eeae721972d6e19af5b3cc92fec0f SHA512 75edd8617b95ae5bd3bfc968732ee142c968855c97c5b2b93784d3476a9724e0fd9a4eb7af681a5356616a4f023e24d5c5a2e75fb57e2a25b142cc901d9bfcaf WHIRLPOOL d40ad1d9e39e1c3b4027c83db2399579f133796d77f72a9d162ffb5c60b887c01110110e5feb9377373b21e72889518a0cebacdb442798e1d9ff08be2f115972
+DIST prelink.pdf 474129 SHA256 83e62795c59cb0dec683585a97b8777c8756a555ff056725425bfdf21e6d5baf SHA512 86b7163fcf6f43d1764183b3dfc30aad8de99ce198b2721af276c81fc361e9f5fd8f4aea1e8e0c653f0566e8346dff4b4ba72909359167aa92c094f5561d2e1e WHIRLPOOL b497b07c073fd883735e34db46d050b036356f680e3df3299ae361a4dc8d5ba4190aa193662ff4f917d3b5e875846170025583c07ec281f05b2520ec6fc1418f
+EBUILD prelink-20130503-r1.ebuild 2458 SHA256 033f90d532969a938126a50142cd6c638ce34d946d8bf057baca0962faf12a39 SHA512 2cc0e66fb48f2137bc9a8118d1ed97e58dd5725bd30b042c4276dad5df2d65ef8298e93cdaeb0b8b292c16ff255fa1ddacdc104150ac478e1bf8677869ce4939 WHIRLPOOL a8e05b821f2968af117d6f1586d564cb96ecb325fd4ed38efd0bf9edb0e29e3e22ce377676923f02dbabcf81ff1156f095a6de462cf7daf37bf0c60cb90e9b7e
+EBUILD prelink-20130503.ebuild 2617 SHA256 450cd11c161cbf0d0056ce1bdbb185b176c7818bc3c661034c09a88e9cb046b8 SHA512 4ba50aad1ba5e142f8a0c96d2ab73fca49712202c506a57af58e9fee5021446e6587f9715420244c39aef9f006baf8cfef7cd318e8e6e21f36aa590f7840cbc0 WHIRLPOOL f530d9b77770911d0d9be262c2fbfba9ee229282c59393b23b297db58686ac8bdb75a675811c46eac13762fd82b113cd3163acdd2539875b6f197d9c4305b3ab
+EBUILD prelink-20151030.ebuild 1737 SHA256 daa2fa9ffd8ffc00240094fe2c0102eb5196f2270f86fb11a5b1e704859a5461 SHA512 7889421c986260cac8f31d3eafe1e354bb78dec1e00f2fec5798a3347c845c4dd4ba973e5f0c0728d4efe993f393ea50607b5d00591488a0b38574d519d70f36 WHIRLPOOL 7c4fd58715e6b2191e202cc1ba3ecf8daaf78bc63e16d13ae774815cde8338372e63c507abbff0c63ec6a4b63aa8e2724f42d29f804166a30d6deaf887c6688e
+MISC ChangeLog 3905 SHA256 42cb90deb4594ebc9d4f43c04eaefc5da92f4aab3d108d900e364590dee2f22c SHA512 4789b1608f8c6717ce6a6e2b3eedc714b474655e1b645a212c0260e2caba6e068e0ae9fcd24bb40bb01a257499b5454cc3923e26770bdc1978fda3f109e2a07f WHIRLPOOL 2f7d5eda649e14a6735931b8cb430ec739554eb18bf24b0b66b4f09f60d4c549aece7b6fee08cc0f975eeac0f2de1004f14e727db6125e35952071b583270977
+MISC ChangeLog-2015 12945 SHA256 4af1796fa18fdac847919d2adbb713ad6d70633844f7ac69c90d103e870f867b SHA512 0aaeaa81248c0f06ca339033e3c7b47eb70ad87f39a853b7774803f1fbd93b71149248adb0f14c2802f20e071baff287113569e52873dd77f7f9d1719b3bd0d8 WHIRLPOOL 7d4532d13353d668648bba3c1218b07e1588354a3d059152878d95a58e7848966f326652c65f6f3211b7a5d492080cf410ecaff04ed90a0cf7582adb9bd8af4d
+MISC metadata.xml 257 SHA256 fcb691c3299a07a5fe4f936baa5aa146b8aa3cb9491ba88fd12547cb540b02c2 SHA512 fd85d9cf15f6b7db96e4d184e32ae6f1503a5b70cb4cb1ce930ba13a1d5d4c4b24971781e95b7f3f9ead58b31760f84c368bc6fa2a793b4b5baf78259b047ff1 WHIRLPOOL 62b62e3e5489b8983ddd7bfc6017411d5e02f9710763206baa84b826388c8685fe7bdc0bb6a76c029e73ae4c160e9af6c8544406dc70a203c7c3d65d4aa15400
diff --git a/sys-devel/prelink/files/prelink-20130503-libiberty-md5.patch b/sys-devel/prelink/files/prelink-20130503-libiberty-md5.patch
new file mode 100644
index 000000000000..5a9fffb838f9
--- /dev/null
+++ b/sys-devel/prelink/files/prelink-20130503-libiberty-md5.patch
@@ -0,0 +1,61 @@
+From 8eeb9da6d017761037bf757780ea544dfeabbad8 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 31 Jul 2012 09:02:35 +0000
+Subject: [PATCH] libiberty/md5: fix strict alias warnings
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Current libiberty md5 code triggers these warnings with gcc-4.7.1 for me:
+
+libiberty/md5.c: In function ‘md5_finish_ctx’:
+libiberty/md5.c:117:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
+libiberty/md5.c:118:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
+
+The change below fixes things for me. The optimized output (-O2) is the same
+before/after my change on x86_64-linux. I imagine it'll be the same for most
+targets. It seems simpler than using a union on the md5_ctx buffer since these
+are the only two locations in the code where this occurs.
+---
+ libiberty/ChangeLog | 5 +++++
+ libiberty/md5.c | 12 ++++++++----
+ 2 files changed, 13 insertions(+), 4 deletions(-)
+
+2012-07-31 Mike Frysinger <vapier@gentoo.org>
+
+ * md5.c (md5_finish_ctx): Declare swap_bytes. Assign SWAP() output
+ to swap_bytes, and then call memcpy to move it to ctx->buffer.
+
+diff --git a/libiberty/md5.c b/libiberty/md5.c
+index 0db8fc8..8cc0cb5 100644
+--- a/src/md5.c
++++ b/src/md5.c
+@@ -103,6 +103,7 @@ md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
+ {
+ /* Take yet unprocessed bytes into account. */
+ md5_uint32 bytes = ctx->buflen;
++ md5_uint32 swap_bytes;
+ size_t pad;
+
+ /* Now count remaining bytes. */
+@@ -113,10 +114,13 @@ md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
+ pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
+ memcpy (&ctx->buffer[bytes], fillbuf, pad);
+
+- /* Put the 64-bit file length in *bits* at the end of the buffer. */
+- *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3);
+- *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) |
+- (ctx->total[0] >> 29));
++ /* Put the 64-bit file length in *bits* at the end of the buffer.
++ Use memcpy to avoid aliasing problems. On most systems, this
++ will be optimized away to the same code. */
++ swap_bytes = SWAP (ctx->total[0] << 3);
++ memcpy (&ctx->buffer[bytes + pad], &swap_bytes, sizeof (swap_bytes));
++ swap_bytes = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
++ memcpy (&ctx->buffer[bytes + pad + 4], &swap_bytes, sizeof (swap_bytes));
+
+ /* Process last bytes. */
+ md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
+--
+1.8.2.1
+
diff --git a/sys-devel/prelink/files/prelink-20130503-prelink-conf.patch b/sys-devel/prelink/files/prelink-20130503-prelink-conf.patch
new file mode 100644
index 000000000000..9233a4114827
--- /dev/null
+++ b/sys-devel/prelink/files/prelink-20130503-prelink-conf.patch
@@ -0,0 +1,39 @@
+--- a/doc/prelink.conf
++++ b/doc/prelink.conf
+@@ -5,6 +5,7 @@
+ # If a directory name is prefixed with `-h ', symbolic links in a
+ # directory hierarchy are followed.
+ # Directories or files with `-b ' prefix will be blacklisted.
++-c /etc/prelink.conf.d/*.conf
+ -b *.la
+ -b *.png
+ -b *.py
+@@ -16,8 +16,11 @@
+ -b *.a
+ -b *.js
+ -b /lib/modules
+--b /usr/lib/locale
+--b /usr/X11R6/lib{,64}/X11/xfig
++-b /usr/lib{,x32,32,64}/locale
++-b /usr/lib{,x32,32,64}/wine
++-b /usr/lib{,x32,32,64}/valgrind
++-b /usr/X11R6/lib{,x32,32,64}/X11/xfig
++-b /usr/src
+ -l /bin
+ -l /usr/bin
+ -l /sbin
+@@ -27,9 +30,9 @@
+ -l /usr/games
+ -l /usr/libexec
+ -l /var/ftp/bin
+--l /lib{,64}
+--l /usr/lib{,64}
+--l /usr/X11R6/lib{,64}
+--l /usr/kerberos/lib{,64}
++-l /lib{,x32,32,64}
++-l /usr/lib{,x32,32,64}
++-l /usr/X11R6/lib{,x32,32,64}
++-l /usr/kerberos/lib{,x32,32,64}
+ -l /usr/X11R6/LessTif
+--l /var/ftp/lib{,64}
++-l /var/ftp/lib{,x32,32,64}
diff --git a/sys-devel/prelink/files/prelink-armhf-dynamic-linker.patch b/sys-devel/prelink/files/prelink-armhf-dynamic-linker.patch
new file mode 100644
index 000000000000..896101040b5b
--- /dev/null
+++ b/sys-devel/prelink/files/prelink-armhf-dynamic-linker.patch
@@ -0,0 +1,12 @@
+diff -urNp prelink_orig/src/arch-arm.c prelink/src/arch-arm.c
+--- prelink_orig/src/arch-arm.c 2011-08-26 03:20:49.000000000 -0400
++++ prelink/src/arch-arm.c 2012-11-28 23:59:28.030164736 -0500
+@@ -832,7 +832,7 @@ PL_ARCH = {
+ .R_COPY = R_ARM_COPY,
+ .R_RELATIVE = R_ARM_RELATIVE,
+ .rtype_class_valid = RTYPE_CLASS_VALID,
+- .dynamic_linker = "/lib/ld-linux.so.3",
++ .dynamic_linker = "/lib/ld-linux-armhf.so.3",
+ .adjust_dyn = arm_adjust_dyn,
+ .adjust_rel = arm_adjust_rel,
+ .adjust_rela = arm_adjust_rela,
diff --git a/sys-devel/prelink/files/prelink.confd b/sys-devel/prelink/files/prelink.confd
new file mode 100644
index 000000000000..6b89b8c1f1fd
--- /dev/null
+++ b/sys-devel/prelink/files/prelink.confd
@@ -0,0 +1,43 @@
+# For an in depth prelinking guide, please see:
+# http://www.gentoo.org/doc/en/prelink-howto.xml
+
+# Control prelinking behavior in the cronjob.
+# yes - automatically prelink the system
+# no - automatically un-prelink the system
+# "" - do nothing at all (user manages)
+# (if you change this from yes to no prelink -ua
+# will be run next night to undo prelinking)
+PRELINKING=""
+
+# Options to pass to prelink
+# -m Try to conserve virtual memory by allowing overlapping
+# assigned virtual memory slots for libraries which
+# never appear together in one binary
+# -R Randomize virtual memory slot assignments for libraries.
+# This makes it slightly harder for various buffer overflow
+# attacks, since library addresses will be different on each
+# host using -R.
+PRELINK_OPTS=-mR
+
+# How often should full prelink be run (in days)
+# Normally, prelink will be run in quick mode, every
+# $PRELINK_FULL_TIME_INTERVAL days it will be run
+# in normal mode. Comment it out if it should be run
+# in normal mode always.
+PRELINK_FULL_TIME_INTERVAL=14
+
+# How often should prelink run (in days) even if
+# no packages have been upgraded via portage.
+# If $PRELINK_FULL_TIME_INTERVAL days have not elapsed
+# yet since last normal mode prelinking, last
+# quick mode prelinking happened less than
+# $PRELINK_NOEMER_CHECK_INTERVAL days ago
+# and no packages have been upgraded by portage
+# since last quick mode prelinking, prelink
+# will not do anything.
+# Change to
+# PRELINK_NOEMER_CHECK_INTERVAL=0
+# if you want to disable the portage database timestamp
+# check (especially if you don't use portage
+# exclusively to upgrade system libraries and/or binaries).
+PRELINK_NOEMER_CHECK_INTERVAL=7
diff --git a/sys-devel/prelink/files/prelink.cron b/sys-devel/prelink/files/prelink.cron
new file mode 100644
index 000000000000..a3edc429fee7
--- /dev/null
+++ b/sys-devel/prelink/files/prelink.cron
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+. /etc/conf.d/prelink
+log="/var/log/prelink.log"
+
+case $PRELINKING in
+ yes|no);;
+ *) exit 0;;
+esac
+
+ionice -c3 -p $$ >/dev/null 2>&1
+renice +19 -p $$ >/dev/null 2>&1
+
+if [ "$PRELINKING" != yes ]; then
+ sed -ri '/^[[:space:]]*#?[[:space:]]*KDE_IS_PRELINKED=/s:.*:#KDE_IS_PRELINKED=1:' /etc/env.d/*kde* 2>/dev/null
+ if [ -f /etc/prelink.cache ]; then
+ echo /usr/sbin/prelink -uav > ${log}
+ /usr/sbin/prelink -uav >> ${log} 2>&1 \
+ || echo Prelink failed with return value $? >> ${log}
+ rm -f /etc/prelink.cache
+ # Restart init if needed
+ [ -n "$(find `ldd /sbin/init | awk 'NF == 4 { print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
+ fi
+ exit 0
+fi
+
+sed -ri '/^[[:space:]]*#?[[:space:]]*KDE_IS_PRELINKED=/s:.*:KDE_IS_PRELINKED=1:' /etc/env.d/*kde* 2>/dev/null
+
+if [ ! -f /etc/prelink.cache -o -f /var/lib/misc/prelink.force ] \
+ || grep -q '^prelink-ELF0.[0-2]' /etc/prelink.cache; then
+ # If cache does not exist or is from older prelink versions or
+ # if we were asked to explicitely, force full prelinking
+ rm -f /etc/prelink.cache /var/lib/misc/prelink.force
+ PRELINK_OPTS="$PRELINK_OPTS -f"
+ date > /var/lib/misc/prelink.full
+ cp -a /var/lib/misc/prelink.full /var/lib/misc/prelink.quick
+elif [ -n "$PRELINK_FULL_TIME_INTERVAL" \
+ -a "`find /var/lib/misc/prelink.full -mtime -${PRELINK_FULL_TIME_INTERVAL} 2>/dev/null`" \
+ = /var/lib/misc/prelink.full ]; then
+ # If no more than PRELINK_NOEMER_CHECK_INTERVAL days elapsed from last prelink
+ # (be it full or quick) and no packages have been upgraded via rpm since then,
+ # don't do anything.
+ [ "`find /var/lib/misc/prelink.quick -mtime -${PRELINK_NOEMER_CHECK_INTERVAL:-7} 2>/dev/null`" \
+ -a -f /var/cache/edb/counter \
+ -a /var/cache/edb/counter -ot /var/lib/misc/prelink.quick ] && exit 0
+ date > /var/lib/misc/prelink.quick
+ # If prelink without -q has been run in the last
+ # PRELINK_FULL_TIME_INTERVAL days, just use quick mode
+ PRELINK_OPTS="$PRELINK_OPTS -q"
+else
+ date > /var/lib/misc/prelink.full
+ cp -a /var/lib/misc/prelink.full /var/lib/misc/prelink.quick
+fi
+
+echo /usr/sbin/prelink -av $PRELINK_OPTS > ${log}
+/usr/sbin/prelink -av $PRELINK_OPTS >> ${log} 2>&1 \
+ || echo Prelink failed with return value $? >> ${log}
+# Restart init if needed
+[ -n "$(find `ldd /sbin/init | awk 'NF == 4 { print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
+
+exit 0
diff --git a/sys-devel/prelink/metadata.xml b/sys-devel/prelink/metadata.xml
new file mode 100644
index 000000000000..e396f3755977
--- /dev/null
+++ b/sys-devel/prelink/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/prelink/prelink-20130503-r1.ebuild b/sys-devel/prelink/prelink-20130503-r1.ebuild
new file mode 100644
index 000000000000..5f8f8e9f70d4
--- /dev/null
+++ b/sys-devel/prelink/prelink-20130503-r1.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit autotools eutils flag-o-matic
+
+DESCRIPTION="Modifies ELFs to avoid runtime symbol resolutions resulting in faster load times"
+HOMEPAGE="https://people.redhat.com/jakub/prelink"
+
+SRC_URI="mirror://gentoo/${P}.tar.bz2"
+#SRC_URI="https://people.redhat.com/jakub/prelink/${P}.tar.bz2"
+
+# if not available on jakub's dev space extract the distfile with rpm2tarbz2 from
+# https://mirrors.kernel.org/fedora/development/rawhide/source/SRPMS/p/prelink-[ver].src.rpm
+#
+# track http://pkgs.fedoraproject.org/cgit/prelink.git/ for updates
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 -arm ~ppc ~ppc64 ~x86"
+IUSE="selinux"
+
+DEPEND=">=dev-libs/elfutils-0.100[static-libs(+)]
+ selinux? ( sys-libs/libselinux[static-libs(+)] )
+ !dev-libs/libelf
+ >=sys-libs/glibc-2.8"
+RDEPEND="${DEPEND}
+ >=sys-devel/binutils-2.18"
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-20130503-prelink-conf.patch
+ epatch "${FILESDIR}"/${PN}-20130503-libiberty-md5.patch
+ epatch "${FILESDIR}"/${PN}-armhf-dynamic-linker.patch
+
+ sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.in || die #469126
+
+ sed -i -e '/^CC=/s: : -Wl,--disable-new-dtags :' testsuite/functions.sh #100147
+ # >=binutils-2.22 --no-copy-dt-needed-entries is the default
+ # --copy-dt-needed-entries was renamed from --add-needed in 2.21, use the
+ # former so we don't have to bump the dep
+ sed -i \
+ -e '/CCLINK=/s:CCLINK="$(CC):& -Wl,--add-needed :' \
+ -e '/CXXLINK=/s:CXXLINK="$(CXX):& -Wl,--add-needed :' \
+ testsuite/Makefile.am
+
+ has_version 'dev-libs/elfutils[threads]' && append-ldflags -pthread
+
+ eautoreconf # prevent maintainer mode
+
+ # have to do this after eautoreconf or automake barfs on the trailing
+ # backslash of the previous line
+ sed -i -e 's:undosyslibs.sh::' testsuite/Makefile.in #254201
+
+ export ac_cv_{header_selinux_selinux_h,lib_selinux_is_selinux_enabled}=$(usex selinux)
+}
+
+src_install() {
+ default
+
+ insinto /etc
+ doins doc/prelink.conf
+
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/prelink.cron prelink
+ newconfd "${FILESDIR}"/prelink.confd prelink
+}
+
+pkg_postinst() {
+ if [ -z "${REPLACING_VERSIONS}" ] ; then
+ elog "You may wish to read the Gentoo Linux Prelink Guide, which can be"
+ elog "found online at:"
+ elog " https://wiki.gentoo.org/wiki/Prelink"
+ elog "Please edit /etc/conf.d/prelink to enable and configure prelink"
+ fi
+}
diff --git a/sys-devel/prelink/prelink-20130503.ebuild b/sys-devel/prelink/prelink-20130503.ebuild
new file mode 100644
index 000000000000..46b2197ba6ed
--- /dev/null
+++ b/sys-devel/prelink/prelink-20130503.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit autotools eutils flag-o-matic
+
+DESCRIPTION="Modifies ELFs to avoid runtime symbol resolutions resulting in faster load times"
+HOMEPAGE="https://people.redhat.com/jakub/prelink"
+
+SRC_URI="mirror://gentoo/${P}.tar.bz2"
+#SRC_URI="https://people.redhat.com/jakub/prelink/${P}.tar.bz2"
+
+# if not available on jakub's dev space extract the distfile with rpm2tarbz2 from
+# https://mirrors.kernel.org/fedora/development/rawhide/source/SRPMS/p/prelink-[ver].src.rpm
+#
+# track http://pkgs.fedoraproject.org/cgit/prelink.git/ for updates
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 -arm ppc ppc64 x86"
+IUSE="selinux"
+
+DEPEND=">=dev-libs/elfutils-0.100[static-libs(+)]
+ selinux? ( sys-libs/libselinux[static-libs(+)] )
+ !dev-libs/libelf
+ >=sys-libs/glibc-2.8"
+RDEPEND="${DEPEND}
+ >=sys-devel/binutils-2.18"
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-20130503-prelink-conf.patch
+ epatch "${FILESDIR}"/${PN}-20130503-libiberty-md5.patch
+ epatch "${FILESDIR}"/${PN}-armhf-dynamic-linker.patch
+
+ sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.in || die #469126
+
+ sed -i -e '/^CC=/s: : -Wl,--disable-new-dtags :' testsuite/functions.sh #100147
+ # >=binutils-2.22 --no-copy-dt-needed-entries is the default
+ # --copy-dt-needed-entries was renamed from --add-needed in 2.21, use the
+ # former so we don't have to bump the dep
+ sed -i \
+ -e '/CCLINK=/s:CCLINK="$(CC):& -Wl,--add-needed :' \
+ -e '/CXXLINK=/s:CXXLINK="$(CXX):& -Wl,--add-needed :' \
+ testsuite/Makefile.am
+
+ has_version 'dev-libs/elfutils[threads]' && append-ldflags -pthread
+
+ eautoreconf # prevent maintainer mode
+
+ # have to do this after eautoreconf or automake barfs on the trailing
+ # backslash of the previous line
+ sed -i -e 's:undosyslibs.sh::' testsuite/Makefile.in #254201
+
+ export ac_cv_{header_selinux_selinux_h,lib_selinux_is_selinux_enabled}=$(usex selinux)
+}
+
+src_install() {
+ default
+
+ insinto /etc
+ doins doc/prelink.conf
+
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/prelink.cron prelink
+ newconfd "${FILESDIR}"/prelink.confd prelink
+
+ dodir /var/{lib/misc,log}
+ touch "${ED}"/var/lib/misc/prelink.{full,quick,force}
+ touch "${ED}"/var/log/prelink.log
+}
+
+pkg_postinst() {
+ if [ -z "${REPLACING_VERSIONS}" ] ; then
+ elog "You may wish to read the Gentoo Linux Prelink Guide, which can be"
+ elog "found online at:"
+ elog " https://wiki.gentoo.org/wiki/Prelink"
+ elog "Please edit /etc/conf.d/prelink to enable and configure prelink"
+ fi
+ touch "${EROOT}/var/lib/misc/prelink.force"
+}
diff --git a/sys-devel/prelink/prelink-20151030.ebuild b/sys-devel/prelink/prelink-20151030.ebuild
new file mode 100644
index 000000000000..69a205c9d16a
--- /dev/null
+++ b/sys-devel/prelink/prelink-20151030.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+MY_PN="${PN}-cross"
+MY_P="${MY_PN}-${PV}"
+
+inherit autotools eutils flag-o-matic
+
+DESCRIPTION="Modifies ELFs to avoid runtime symbol resolutions resulting in faster load times"
+HOMEPAGE="https://git.yoctoproject.org/cgit/cgit.cgi/prelink-cross/ https://people.redhat.com/jakub/prelink"
+SRC_URI="https://git.yoctoproject.org/cgit/cgit.cgi/${MY_PN}/snapshot/${MY_P}.tar.bz2
+ doc? ( https://people.redhat.com/jakub/prelink/prelink.pdf )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
+IUSE="doc selinux"
+
+DEPEND=">=dev-libs/elfutils-0.100[static-libs(+)]
+ selinux? ( sys-libs/libselinux[static-libs(+)] )
+ !dev-libs/libelf
+ sys-libs/binutils-libs
+ >=sys-libs/glibc-2.8"
+RDEPEND="${DEPEND}
+ >=sys-devel/binutils-2.18"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-20130503-prelink-conf.patch
+ epatch "${FILESDIR}"/${PN}-20130503-libiberty-md5.patch
+
+ sed -i -e '/^CC=/s: : -Wl,--disable-new-dtags :' testsuite/functions.sh #100147
+
+ has_version 'dev-libs/elfutils[threads]' && append-ldflags -pthread
+
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable selinux)
+}
+
+src_install() {
+ default
+
+ use doc && dodoc "${WORKDIR}"/prelink.pdf
+
+ insinto /etc
+ doins doc/prelink.conf
+
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/prelink.cron prelink
+ newconfd "${FILESDIR}"/prelink.confd prelink
+}
+
+pkg_postinst() {
+ if [ -z "${REPLACING_VERSIONS}" ] ; then
+ elog "You may wish to read the Gentoo Linux Prelink Guide, which can be"
+ elog "found online at:"
+ elog " https://wiki.gentoo.org/wiki/Prelink"
+ elog "Please edit /etc/conf.d/prelink to enable and configure prelink"
+ fi
+}