+++ /dev/null
-From ac38a49a18e337fb3bc7ac8e06097e28e1e3b3f7 Mon Sep 17 00:00:00 2001
-From: Baruch Siach <baruch@tkos.co.il>
-Date: Fri, 14 Apr 2017 07:43:04 +0300
-Subject: [PATCH] configure: fix cross compile detection of broken ipv6 headers
-
-Checking the content of the host ipv6.h headers is incompatible with cross
-compilation. Target headers may not be the same as the host. Do direct build
-test instead using the ${CC} (cross) compiler to detect headers issues.
-
-Define _GNU_SOURCE to make sure glibc ipv6 definitions are exposed.
-
-Signed-off-by: Baruch Siach <baruch@tkos.co.il>
----
-Patch status: submitted upstream
-
- configure | 17 +++++++++++++++--
- 1 file changed, 15 insertions(+), 2 deletions(-)
-
-diff --git a/configure b/configure
-index aa3f7f334971..8639a38eba96 100755
---- a/configure
-+++ b/configure
-@@ -51,8 +51,21 @@ echo "[*] Checking system headers."
- [ -z "$IPV6" ] && IPV6=yes
- if [[ "$IPV6" == "yes" ]]; then
- echo -n "[*] Checking ipv6 headers ... "
-- RET=$(grep __UAPI_DEF_IN6_PKTINFO /usr/include/linux/ipv6.h)
-- if [ -z "$RET" ]; then
-+ rm -f "$TMP" || exit 1
-+
-+ cat >"$TMP.c" << EOF
-+#include <netinet/in.h>
-+#include <netinet/ip6.h>
-+#include <linux/in6.h>
-+#include <linux/ipv6.h>
-+
-+int main()
-+{
-+ struct in6_addr test;
-+}
-+EOF
-+ ${CC} ${CFLAGS} -D_GNU_SOURCE "$TMP.c" -o "$TMP" &>"$TMP.log"
-+ if [ ! -x "$TMP" ]; then
- echo $RED "[BROKEN]" $COL_RESET "See https://patchwork.ozlabs.org/patch/425881/"
- else
- echo $GREEN "[OK]" $COL_RESET
---
-2.11.0
-
--- /dev/null
+From b0e66a2d084ffc210bc1fc247efb4d177e9f7e3d Mon Sep 17 00:00:00 2001
+From: Dave Jones <davej@codemonkey.org.uk>
+Date: Mon, 5 Dec 2016 12:46:14 -0500
+Subject: [PATCH] use userspace headers for ax25 instead of kernel.
+
+This should solve https://bugzilla.redhat.com/show_bug.cgi?id=1400720
+
+[Upstream commit: https://github.com/kernelslacker/trinity/commit/b0e66a2d084ffc210bc1fc247efb4d177e9f7e3d]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ net/proto-rose.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/net/proto-rose.c b/net/proto-rose.c
+index ccbf294f..b277f839 100644
+--- a/net/proto-rose.c
++++ b/net/proto-rose.c
+@@ -6,7 +6,7 @@
+ #include <sys/un.h>
+ #include <netinet/in.h>
+ #include <bits/sockaddr.h>
+-#include <linux/ax25.h> /* for ax25_address in rose.h */
++#include <netax25/ax25.h> /* for ax25_address in rose.h */
+ #include <netrose/rose.h>
+ #include <stdlib.h>
+ #include "net.h"
--- /dev/null
+From f447db18b389050ecc5e66dbf549d5953633e23e Mon Sep 17 00:00:00 2001
+From: Jan Stancek <jstancek@redhat.com>
+Date: Mon, 7 Nov 2016 12:50:27 +0100
+Subject: [PATCH] fix build when USE_BPF is not defined
+
+net/bpf.o: In function `bpf_gen_filter': bpf.c:852: undefined reference to `get_rand_bpf_fd'
+
+Signed-off-by: Jan Stancek <jstancek@redhat.com>
+[Upstream commit: https://github.com/kernelslacker/trinity/commit/f447db18b389050ecc5e66dbf549d5953633e23e]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ net/bpf.c | 3 +++
+ syscalls/prctl.c | 4 +++-
+ syscalls/setsockopt.c | 2 ++
+ 3 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/net/bpf.c b/net/bpf.c
+index 4fe94173..d6ca14bd 100644
+--- a/net/bpf.c
++++ b/net/bpf.c
+@@ -8,6 +8,7 @@
+ #include <string.h>
+
+ #include "bpf.h"
++#include "config.h"
+ #include "debug.h"
+ #include "log.h"
+ #include "net.h"
+@@ -17,6 +18,7 @@
+ #include "utils.h"
+ #include "compat.h"
+
++#ifdef USE_BPF
+ /**
+ * BPF filters are used in networking such as in pf_packet, but also
+ * in seccomp for application sand-boxing. Additionally, with arch
+@@ -885,3 +887,4 @@ void bpf_gen_filter(unsigned long **addr, unsigned long *addrlen)
+ if (dump_bpf)
+ bpf_disasm_all(bpf->filter, bpf->len);
+ }
++#endif
+diff --git a/syscalls/prctl.c b/syscalls/prctl.c
+index 02d2dbc6..cdbcdc21 100644
+--- a/syscalls/prctl.c
++++ b/syscalls/prctl.c
+@@ -45,9 +45,11 @@ static int prctl_opts[] = {
+ #ifdef USE_SECCOMP
+ static void do_set_seccomp(struct syscallrecord *rec)
+ {
+- unsigned long *optval = NULL, optlen = 0;
++ unsigned long *optval = NULL, __unused__ optlen = 0;
+
++#ifdef USE_BPF
+ bpf_gen_seccomp(&optval, &optlen);
++#endif
+
+ rec->a2 = SECCOMP_MODE_FILTER;
+ rec->a3 = (unsigned long) optval;
+diff --git a/syscalls/setsockopt.c b/syscalls/setsockopt.c
+index 8189b7a8..d395e54e 100644
+--- a/syscalls/setsockopt.c
++++ b/syscalls/setsockopt.c
+@@ -48,7 +48,9 @@ static void socket_setsockopt(struct sockopt *so, __unused__ struct socket_tripl
+ case SO_ATTACH_FILTER: {
+ unsigned long *optval = NULL, optlen = 0;
+
++#ifdef USE_BPF
+ bpf_gen_filter(&optval, &optlen);
++#endif
+
+ so->optval = (unsigned long) optval;
+ so->optlen = optlen;
--- /dev/null
+From 87427256640f806710dd97fc807a9a896147c617 Mon Sep 17 00:00:00 2001
+From: Vinson Lee <vlee@freedesktop.org>
+Date: Sat, 12 Nov 2016 00:55:35 +0000
+Subject: [PATCH] Check for bpf_attr map_flags.
+
+map_flags is not available until Linux 4.6.
+
+Signed-off-by: Vinson Lee <vlee@freedesktop.org>
+[Upstream commit: https://github.com/kernelslacker/trinity/commit/87427256640f806710dd97fc807a9a896147c617]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ configure | 28 +++++++++++++++++++++++++++-
+ 1 file changed, 27 insertions(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index ca37e4ef..18d9df73 100755
+--- a/configure
++++ b/configure
+@@ -222,6 +222,33 @@ else
+ fi
+
+ #############################################################################################
++# is /usr/include/linux/bpf.h new enough to feature bpf
++#
++echo -n "[*] Checking if bpf_attr can use map_flags.. "
++rm -f "$TMP" || exit 1
++
++cat >"$TMP.c" << EOF
++#include <stdio.h>
++#include <linux/bpf.h>
++
++void main()
++{
++ union bpf_attr attr = {
++ .map_flags = 0,
++ };
++}
++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_BPF 1" >> $CONFIGH
++fi
++
++#############################################################################################
+
+ check_header linux/caif/caif_socket.h USE_CAIF
+ check_header linux/if_alg.h USE_IF_ALG
+@@ -239,7 +266,6 @@ check_header execinfo.h USE_BACKTRACE
+ check_header netatalk/at.h USE_APPLETALK
+ check_header netrom/netrom.h USE_NETROM
+ check_header netrose/rose.h USE_ROSE
+-check_header linux/bpf.h USE_BPF
+
+ rm -f "$TMP" "$TMP.log" "$TMP.c"
+
--- /dev/null
+From 1d9af9d07ae111c253c92112fb50000adac47a0c Mon Sep 17 00:00:00 2001
+From: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
+Date: Thu, 29 Jun 2017 12:24:10 +0200
+Subject: [PATCH] get_syscall_entry: remove SYSCALL_OFFSET
+
+0-based syscall numbers are used throughout the application and the
+SYSCALL_OFFSET is only added when invoking the syscall. It is therefore
+wrong to substract the offset in get_syscall_entry, as it leads to
+dereferencing array entries at negative offsets and segfaults.
+
+Tested on MIPS32/LE.
+This change effectively reverts cc5108ff ('make get_syscall_entry take
+SYSCALL_OFFSET into account')
+
+Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
+[Upstream commit: https://github.com/kernelslacker/trinity/commit/1d9af9d07ae111c253c92112fb50000adac47a0c]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ tables.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/tables.c b/tables.c
+index e7dab85d..8090146a 100644
+--- a/tables.c
++++ b/tables.c
+@@ -673,15 +673,14 @@ int munge_tables(void)
+ */
+ struct syscallentry * get_syscall_entry(unsigned int callno, bool do32)
+ {
+- unsigned int offset = callno - SYSCALL_OFFSET;
+ if (biarch == FALSE)
+- return syscalls[offset].entry;
++ return syscalls[callno].entry;
+
+ /* biarch case */
+ if (do32 == TRUE)
+- return syscalls_32bit[offset].entry;
++ return syscalls_32bit[callno].entry;
+ else
+- return syscalls_64bit[offset].entry;
++ return syscalls_64bit[callno].entry;
+ }
+
+ /*
--- /dev/null
+From ac38a49a18e337fb3bc7ac8e06097e28e1e3b3f7 Mon Sep 17 00:00:00 2001
+From: Baruch Siach <baruch@tkos.co.il>
+Date: Fri, 14 Apr 2017 07:43:04 +0300
+Subject: [PATCH] configure: fix cross compile detection of broken ipv6 headers
+
+Checking the content of the host ipv6.h headers is incompatible with cross
+compilation. Target headers may not be the same as the host. Do direct build
+test instead using the ${CC} (cross) compiler to detect headers issues.
+
+Define _GNU_SOURCE to make sure glibc ipv6 definitions are exposed.
+
+Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+---
+Patch status: submitted upstream
+
+ configure | 17 +++++++++++++++--
+ 1 file changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index aa3f7f334971..8639a38eba96 100755
+--- a/configure
++++ b/configure
+@@ -51,8 +51,21 @@ echo "[*] Checking system headers."
+ [ -z "$IPV6" ] && IPV6=yes
+ if [[ "$IPV6" == "yes" ]]; then
+ echo -n "[*] Checking ipv6 headers ... "
+- RET=$(grep __UAPI_DEF_IN6_PKTINFO /usr/include/linux/ipv6.h)
+- if [ -z "$RET" ]; then
++ rm -f "$TMP" || exit 1
++
++ cat >"$TMP.c" << EOF
++#include <netinet/in.h>
++#include <netinet/ip6.h>
++#include <linux/in6.h>
++#include <linux/ipv6.h>
++
++int main()
++{
++ struct in6_addr test;
++}
++EOF
++ ${CC} ${CFLAGS} -D_GNU_SOURCE "$TMP.c" -o "$TMP" &>"$TMP.log"
++ if [ ! -x "$TMP" ]; then
+ echo $RED "[BROKEN]" $COL_RESET "See https://patchwork.ozlabs.org/patch/425881/"
+ else
+ echo $GREEN "[OK]" $COL_RESET
+--
+2.11.0
+
# Locally calculated
sha256 4cb2bd4049ce523fdf47490c4c18b8eb713c720d4b3b13d6ec2ae246aac908ad trinity-1.7.tar.xz
-sha256 5601474b10973b99f6f4ecc67c8ac54000754d7110553cc81c7648bd7e73c810 b0e66a2d084ffc210bc1fc247efb4d177e9f7e3d.patch
-sha256 1974e473113b4e79fb2ff820e2b03f475a538e43343c24ca077a04214b9e0418 f447db18b389050ecc5e66dbf549d5953633e23e.patch
-sha256 9f9846a9c257b7df7e944c8b3ea956a8e8166bba67b3ea6c231382f095753312 87427256640f806710dd97fc807a9a896147c617.patch
-sha256 e6e47e813424f6b92b5a2e8f56bbd3bae63db47b76ece81a934a9390e194cbfc 1d9af9d07ae111c253c92112fb50000adac47a0c.patch
TRINITY_LICENSE = GPL-2.0
TRINITY_LICENSE_FILES = COPYING
-TRINITY_PATCH = https://github.com/kernelslacker/trinity/commit/b0e66a2d084ffc210bc1fc247efb4d177e9f7e3d.patch \
- https://github.com/kernelslacker/trinity/commit/f447db18b389050ecc5e66dbf549d5953633e23e.patch \
- https://github.com/kernelslacker/trinity/commit/87427256640f806710dd97fc807a9a896147c617.patch \
- https://github.com/kernelslacker/trinity/commit/1d9af9d07ae111c253c92112fb50000adac47a0c.patch
-
ifeq ($(BR2_PACKAGE_BTRFS_PROGS),y)
TRINITY_DEPENDENCIES += btrfs-progs
endif