summaryrefslogtreecommitdiff
path: root/dev-util/trinity
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-10-22 11:09:47 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-10-22 11:09:47 +0100
commit64e107b9b6058580ff0432107eb37cefb0b2a7d8 (patch)
tree9a44e603e2ae365e2b1fe35ac37f73e830cdee1d /dev-util/trinity
parent957235cf19a691360c720f7913672adda4258ed0 (diff)
gentoo resync : 22.10.2018
Diffstat (limited to 'dev-util/trinity')
-rw-r--r--dev-util/trinity/Manifest8
-rw-r--r--dev-util/trinity/files/trinity-autofs.patch53
-rw-r--r--dev-util/trinity/files/trinity-irda.patch47
-rw-r--r--dev-util/trinity/files/trinity-memfd.patch79
-rw-r--r--dev-util/trinity/files/trinity-net-protocols.patch11
-rw-r--r--dev-util/trinity/trinity-1.8.ebuild15
-rw-r--r--dev-util/trinity/trinity-9999.ebuild5
7 files changed, 210 insertions, 8 deletions
diff --git a/dev-util/trinity/Manifest b/dev-util/trinity/Manifest
index 7f701cc1e3c7..f76cebcc5289 100644
--- a/dev-util/trinity/Manifest
+++ b/dev-util/trinity/Manifest
@@ -1,4 +1,8 @@
+AUX trinity-autofs.patch 1688 BLAKE2B 99b068123ff2de6f47569c5286fd12326451be1816f8386ef82fcea97816f7d922cb7496fc8cd356878c1b89434fb033fa345c18d25368dca0f1e1c8973ea229 SHA512 4e8b8fb16d37a8de966ffdc6049743e73c978947b4cbcecd460bc548ea4dc5a2f50e326e5745d7b31c2aeebb53e46026a8504bb26a8d9c2996b375ec2891152d
+AUX trinity-irda.patch 1557 BLAKE2B 23dc97baab847ffe565af9d1b595a01dd2b4355cc265e07eb17a5718630a4b5534b00fc44d828a7186ea565714d94cc6dd49fe9f3e5033390353a25ab8e82e7a SHA512 e84f35f50dbffae42c2986e34f7b13b496d5f44ecadb2b1241682e0281356286cf88868d770fe6ac2a31f91ba2851b0f04970d595463988b44074d90c6babca3
+AUX trinity-memfd.patch 2092 BLAKE2B a29485126afbb6966969284977032bc63634afa0922206d487b1801d017bcae8990ee46f06f7cb63eaea957cb7b469f48a0a222a240efbe73f79fc8923157313 SHA512 ea9b77c5a37d53f329bb185cf6b33c6d26c27c4feead29c7c9e2999818ea5783ef92185ef9aa1676fced1dc24bbf1da9ef3a14056ee56f73baff4886da474bd9
+AUX trinity-net-protocols.patch 449 BLAKE2B ccc3f26e0c27d145a16463cb7573c79c2ebb3b6368b3fb4b63df4e053b8b4edf12e53174b7e967f138e0b8ae4d3c93ca727f8cb18e0ab1a56373550d37b8d93e SHA512 e52a7be4004472ee323e4c51cff65ecbad4464642abc8bee4ec94b588770ac49d814c0db6bce5c932a13fb6bffbe2491c80948d1f2f57835824253ce336319e5
DIST trinity-1.8.tar.xz 213984 BLAKE2B 56f664023e2bc3648e941e4a3cb20e450cdcad3556289e201513d1755267eb013da2be035e81c87b3f1d1b0b1e12cb041c6bb345f7a84ee4c5c12f20a8e87f55 SHA512 686076dab2346cf9b5d8a20b14db31f460a352fa72eeadbe005a7423941918f5afef08b4987bb68cbbf4218d0cb620adb85f8036294d8df5ab5262e0031a44e4
-EBUILD trinity-1.8.ebuild 824 BLAKE2B d98c9332cbdd60749c0a1bf3dd1277842fa543100e9681b5721f3477b24d4d70f7d9c6dd7e3ced2743a0bb743bf8fbd3f7adda5c41b8e9eb6f3ca907f11a215a SHA512 defbdf6d43dd3458fbf52bf4fbf9fc9b518ef0186f7f6662bea0014240dd0331db45563a9062c8b45adcaa021994ef28f2bada65c2e12c4cf71f6720b5db0f97
-EBUILD trinity-9999.ebuild 804 BLAKE2B 446dab373eaa541bcb57b407e64f737a4117f8ebc130bb83cd11f0e75ee85d9a60fc534208ff60efdee531b89691d5d8ba27d1b7c9d387355e95bad3d1c876fc SHA512 6183f9cba7341792b559fddc183027a7d80fdc7a5531ee26c94aa04ca82663492827b2ee1fb1986d136c69826e1a79183f6c2c6e9ee9b4c018d6af8fdb44c384
+EBUILD trinity-1.8.ebuild 1000 BLAKE2B 10318476f98c42d5239e17ae0f6811d048a9b6a5cffa457b5e5cfeafe235ae9d44225931a46955bd658a1b41d8fe1d7a5cb81508224e268a443acbe47d8ab08a SHA512 0a922df41ffe9246f99b751abc4b19ec2b3592c9aa066ac73cdab125c41e2b895ae0b6a792b3a7a9b9a6427ca9727c9d1585e3dd5b6c08fe97ab01a6f217b79a
+EBUILD trinity-9999.ebuild 800 BLAKE2B dc34511a94c365dc6f49b9e9465effd96da1e685065316cfb4a1eb4e3c7a10096c749fadc5be7ac5942ed13d41e63982deb4c0c72d4415b426a3b88c31493239 SHA512 dcb2c5cfdcffa77b9deb1f9abf85619f5d4d1a2a8b1279748335829b325549ab0a9ce3e5356f67924e003955517b9b877dcc6368f6254b8a5560903c0f6b207a
MISC metadata.xml 253 BLAKE2B e7d65a21b41d6fee02d2ca3ed68a52450a11debfcdf7e029100f010f6bab26aded65447d29bf374ee41d224f8105b57a8b2b6b0400f8ee4844900e6f2025a5cb SHA512 c6d2490fa32bc6e044a6b051ba21210f47d7545271a7437b9ed16f49924837e1c88dffc33efb94557b818a508e068e1405fae056c881078c37a001e30947aa25
diff --git a/dev-util/trinity/files/trinity-autofs.patch b/dev-util/trinity/files/trinity-autofs.patch
new file mode 100644
index 000000000000..b8a6c9fdbd51
--- /dev/null
+++ b/dev-util/trinity/files/trinity-autofs.patch
@@ -0,0 +1,53 @@
+--- a/configure.orig 2017-11-03 09:14:07.000000000 -0600
++++ b/configure 2017-11-18 14:25:52.095495407 -0700
+@@ -47,6 +47,29 @@ check_header()
+ echo "[*] Checking system headers."
+
+ #############################################################################################
++# Does auto_fs4 define AUTOFS_IOC_EXPIRE_(IN)DIRECT?
++echo -n "[*] Checking autofs headers ... "
++rm -f "$TMP" || exit 1
++
++cat >"$TMP.c" << EOF
++#include <linux/auto_fs4.h>
++
++int main()
++{
++ return AUTOFS_IOC_EXPIRE_INDIRECT + AUTOFS_IOC_EXPIRE_DIRECT;
++}
++EOF
++
++${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
++if [ ! -x "$TMP" ]; then
++ echo $RED "[NO]" $COL_RESET
++ MISSING_DEFS=1
++else
++ echo $GREEN "[YES]" $COL_RESET
++ echo "#define USE_AUTOFS_EXPIRE 1" >> $CONFIGH
++fi
++
++#############################################################################################
+ # Are ipv6 headers usable ?
+ [ -z "$IPV6" ] && IPV6=yes
+ if [[ "$IPV6" == "yes" ]]; then
+@@ -290,6 +313,7 @@ fi
+
+ #############################################################################################
+
++check_header linux/auto_fs4.h USE_AUTOFS_EXPIRE
+ check_header linux/caif/caif_socket.h USE_CAIF
+ check_header linux/fsmap.h USE_FSMAP
+ check_header linux/if_alg.h USE_IF_ALG
+--- a/ioctls/autofs.c.orig 2017-11-03 09:14:07.000000000 -0600
++++ b/ioctls/autofs.c 2017-11-18 14:21:14.487774564 -0700
+@@ -238,8 +238,10 @@ static const struct ioctl autofs_ioctls[
+ IOCTL(AUTOFS_IOC_SETTIMEOUT),
+ IOCTL(AUTOFS_IOC_EXPIRE),
+ IOCTL(AUTOFS_IOC_EXPIRE_MULTI),
++#ifdef PRE_4_14_KERNEL
+ IOCTL(AUTOFS_IOC_EXPIRE_INDIRECT),
+ IOCTL(AUTOFS_IOC_EXPIRE_DIRECT),
++#endif
+ IOCTL(AUTOFS_IOC_PROTOSUBVER),
+ IOCTL(AUTOFS_IOC_ASKUMOUNT),
+
diff --git a/dev-util/trinity/files/trinity-irda.patch b/dev-util/trinity/files/trinity-irda.patch
new file mode 100644
index 000000000000..eb298fd99d80
--- /dev/null
+++ b/dev-util/trinity/files/trinity-irda.patch
@@ -0,0 +1,47 @@
+--- a/configure.orig 2017-11-18 14:25:52.095495407 -0700
++++ b/configure 2018-07-21 11:44:59.235072132 -0600
+@@ -317,6 +317,7 @@ check_header linux/auto_fs4.h USE_AUTOFS
+ check_header linux/caif/caif_socket.h USE_CAIF
+ check_header linux/fsmap.h USE_FSMAP
+ check_header linux/if_alg.h USE_IF_ALG
++check_header linux/irda.h USE_IRDA
+ check_header linux/rds.h USE_RDS
+ check_header linux/vfio.h USE_VFIO
+ check_header drm/drm.h USE_DRM
+--- a/net/protocols.c.orig 2017-11-03 09:14:07.000000000 -0600
++++ b/net/protocols.c 2018-07-21 11:48:09.065940013 -0600
+@@ -26,7 +26,9 @@ const struct protoptr net_protocols[TRIN
+ #ifdef USE_RDS
+ [PF_RDS] = { .proto = &proto_rds },
+ #endif
++#ifdef USE_IRDA
+ [PF_IRDA] = { .proto = &proto_irda },
++#endif
+ [PF_LLC] = { .proto = &proto_llc },
+ [PF_CAN] = { .proto = &proto_can },
+ [PF_TIPC] = { .proto = &proto_tipc },
+--- a/net/proto-irda.c.orig 2017-11-03 09:14:07.000000000 -0600
++++ b/net/proto-irda.c 2018-07-21 11:45:34.330047712 -0600
+@@ -4,13 +4,15 @@
+ #include <sys/un.h>
+ /* old irda.h does not include something which defines sa_family_t */
+ #include <netinet/in.h>
+-#include <linux/irda.h>
+ #include <stdlib.h>
+ #include "net.h"
+ #include "random.h"
+ #include "utils.h" // RAND_ARRAY
+ #include "compat.h"
+
++#ifdef USE_IRDA
++#include <linux/irda.h>
++
+ static void irda_gen_sockaddr(struct sockaddr **addr, socklen_t *addrlen)
+ {
+ struct sockaddr_irda *irda;
+@@ -53,3 +55,5 @@ const struct netproto proto_irda = {
+ .valid_triplets = irda_triplets,
+ .nr_triplets = ARRAY_SIZE(irda_triplets),
+ };
++
++#endif
diff --git a/dev-util/trinity/files/trinity-memfd.patch b/dev-util/trinity/files/trinity-memfd.patch
new file mode 100644
index 000000000000..d333aac2941e
--- /dev/null
+++ b/dev-util/trinity/files/trinity-memfd.patch
@@ -0,0 +1,79 @@
+commit c93bb184ce996c4d77eefbae2ab0bf74f396ec45
+Author: Baruch Siach <baruch@tkos.co.il>
+Date: Tue Mar 13 06:53:06 2018 +0200
+
+ memfd: fix build with glibc 2.27
+
+ glibc 2.27 added a wrapper for memfd_create(). This causes build
+ failure:
+
+ fds/memfd.c:19:12: error: static declaration of 'memfd_create' follows non-static declaration
+ static int memfd_create(__unused__ const char *uname, __unused__ unsigned int flag)
+ ^~~~~~~~~~~~
+
+ Don't use the local definition when the libc provides one.
+
+ Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+
+diff --git a/configure b/configure
+index dc0a87d8c1ad..c0166af33048 100755
+--- a/configure
++++ b/configure
+@@ -289,6 +289,29 @@ else
+ fi
+
+ #############################################################################################
++# Does glibc provide memfd_create() syscall wrapper
++#
++echo -n "[*] Checking if glibc provides memfd_create.. "
++rm -f "$TMP" || exit 1
++
++cat >"$TMP.c" << EOF
++#include <sys/mman.h>
++
++void main()
++{
++ memfd_create();
++}
++EOF
++
++${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
++if [ ! -x "$TMP" ]; then
++ echo $RED "[NO]" $COL_RESET
++else
++ echo $GREEN "[YES]" $COL_RESET
++ echo "#define USE_MEMFD_CREATE 1" >> $CONFIGH
++fi
++
++#############################################################################################
+
+ check_header linux/caif/caif_socket.h USE_CAIF
+ check_header linux/fsmap.h USE_FSMAP
+diff --git a/fds/memfd.c b/fds/memfd.c
+index 210678e4571c..aaaac2f78f54 100644
+--- a/fds/memfd.c
++++ b/fds/memfd.c
+@@ -5,6 +5,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <sys/mman.h>
+
+ #include "fd.h"
+ #include "memfd.h"
+@@ -16,6 +17,7 @@
+ #include "trinity.h"
+ #include "udp.h"
+
++#ifndef USE_MEMFD_CREATE
+ static int memfd_create(__unused__ const char *uname, __unused__ unsigned int flag)
+ {
+ #ifdef SYS_memfd_create
+@@ -24,6 +26,7 @@ static int memfd_create(__unused__ const char *uname, __unused__ unsigned int fl
+ return -ENOSYS;
+ #endif
+ }
++#endif
+
+ static void memfd_destructor(struct object *obj)
+ {
diff --git a/dev-util/trinity/files/trinity-net-protocols.patch b/dev-util/trinity/files/trinity-net-protocols.patch
new file mode 100644
index 000000000000..d2583b56ebd6
--- /dev/null
+++ b/dev-util/trinity/files/trinity-net-protocols.patch
@@ -0,0 +1,11 @@
+--- a/syscalls/setsockopt.c.orig 2017-11-03 09:14:07.000000000 -0600
++++ b/syscalls/setsockopt.c 2017-11-18 13:44:19.283946230 -0700
+@@ -90,7 +90,7 @@ static void do_random_sso(struct sockopt
+ retry:
+ switch (rnd() % 4) {
+ case 0: /* do a random protocol, even if it doesn't match this socket. */
+- i = rnd() % PF_MAX;
++ i = rnd() % TRINITY_PF_MAX;
+ proto = net_protocols[i].proto;
+ if (proto != NULL) {
+ if (proto->setsockopt != NULL) {
diff --git a/dev-util/trinity/trinity-1.8.ebuild b/dev-util/trinity/trinity-1.8.ebuild
index 1072988366ec..2cb2ae2a86e1 100644
--- a/dev-util/trinity/trinity-1.8.ebuild
+++ b/dev-util/trinity/trinity-1.8.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=6
+EAPI=7
inherit toolchain-funcs
DESCRIPTION="A Linux system call fuzz tester"
@@ -14,9 +14,18 @@ KEYWORDS="~amd64 ~x86"
IUSE="examples"
# We need newer headers to avoid compilation failures in the BPF stuff.
-DEPEND="app-arch/xz-utils
+DEPEND="
>=sys-kernel/linux-headers-4.8
"
+RDEPEND=""
+
+PATCHES=(
+ # Fixes from Fedora and Debian
+ "${FILESDIR}"/${PN}-autofs.patch
+ "${FILESDIR}"/${PN}-irda.patch
+ "${FILESDIR}"/${PN}-memfd.patch
+ "${FILESDIR}"/${PN}-net-protocols.patch
+)
src_configure() {
tc-export CC
diff --git a/dev-util/trinity/trinity-9999.ebuild b/dev-util/trinity/trinity-9999.ebuild
index 2e263c788cee..4245b613481a 100644
--- a/dev-util/trinity/trinity-9999.ebuild
+++ b/dev-util/trinity/trinity-9999.ebuild
@@ -1,8 +1,7 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=6
-
+EAPI=7
inherit toolchain-funcs git-r3
EGIT_REPO_URI="https://github.com/kernelslacker/trinity.git"