summaryrefslogtreecommitdiffstats
path: root/import-layers/yocto-poky/meta/recipes-devtools/strace/strace
diff options
context:
space:
mode:
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-devtools/strace/strace')
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-Move-gcc-compat-macros-to-gcc_compat.h.patch176
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-arc-metag-nios2-or1k-tile-fix-build.patch117
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-scm_rights-fd.test-rewrite-without-fork.patch198
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-introduce-libtests.patch306
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-scm_rights.c-use-libtests.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/disable-git-version-gen.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/more-robust-test-for-m32-mx32-compile-support.patch46
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-devtools/strace/strace/run-ptest2
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/update-gawk-paths.patch118
-rw-r--r--import-layers/yocto-poky/meta/recipes-devtools/strace/strace/use-asm-sgidefs.h.patch51
11 files changed, 1141 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-Move-gcc-compat-macros-to-gcc_compat.h.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-Move-gcc-compat-macros-to-gcc_compat.h.patch
new file mode 100644
index 000000000..aa61e15c8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-Move-gcc-compat-macros-to-gcc_compat.h.patch
@@ -0,0 +1,176 @@
+From f32126ba790dd4e61d43a2140b24f02426297bb6 Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Thu, 31 Dec 2015 14:19:41 +0000
+Subject: [PATCH] Move gcc compat macros to gcc_compat.h
+
+* defs.h: Include "gcc_compat.h".
+(GNUC_PREREQ, ATTRIBUTE_NORETURN, ATTRIBUTE_FORMAT,
+ATTRIBUTE_ALIGNED, ATTRIBUTE_PACKED, ATTRIBUTE_MALLOC,
+ATTRIBUTE_NOINLINE, ATTRIBUTE_ALLOC_SIZE): Move ...
+* gcc_compat.h: ... here.
+* Makefile.am (strace_SOURCES): Add gcc_compat.h.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+
+ Makefile.am | 1 +
+ defs.h | 43 +----------------------------------
+ gcc_compat.h | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 75 insertions(+), 42 deletions(-)
+ create mode 100644 gcc_compat.h
+
+diff --git a/Makefile.am b/Makefile.am
+index ab52778..d43608d 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -97,6 +97,7 @@ strace_SOURCES = \
+ flock.c \
+ flock.h \
+ futex.c \
++ gcc_compat.h \
+ get_robust_list.c \
+ getcpu.c \
+ getcwd.c \
+diff --git a/defs.h b/defs.h
+index 283ab1f..bae212c 100644
+--- a/defs.h
++++ b/defs.h
+@@ -55,6 +55,7 @@
+ #include <sys/syscall.h>
+
+ #include "mpers_type.h"
++#include "gcc_compat.h"
+
+ #ifndef HAVE_STRERROR
+ const char *strerror(int);
+@@ -68,48 +69,6 @@ const char *strerror(int);
+ extern char *stpcpy(char *dst, const char *src);
+ #endif
+
+-#if defined __GNUC__ && defined __GNUC_MINOR__
+-# define GNUC_PREREQ(maj, min) \
+- ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+-#else
+-# define __attribute__(x) /* empty */
+-# define GNUC_PREREQ(maj, min) 0
+-#endif
+-
+-#if GNUC_PREREQ(2, 5)
+-# define ATTRIBUTE_NORETURN __attribute__((__noreturn__))
+-#else
+-# define ATTRIBUTE_NORETURN /* empty */
+-#endif
+-
+-#if GNUC_PREREQ(2, 7)
+-# define ATTRIBUTE_FORMAT(args) __attribute__((__format__ args))
+-# define ATTRIBUTE_ALIGNED(arg) __attribute__((__aligned__(arg)))
+-# define ATTRIBUTE_PACKED __attribute__((__packed__))
+-#else
+-# define ATTRIBUTE_FORMAT(args) /* empty */
+-# define ATTRIBUTE_ALIGNED(arg) /* empty */
+-# define ATTRIBUTE_PACKED /* empty */
+-#endif
+-
+-#if GNUC_PREREQ(3, 0)
+-# define ATTRIBUTE_MALLOC __attribute__((__malloc__))
+-#else
+-# define ATTRIBUTE_MALLOC /* empty */
+-#endif
+-
+-#if GNUC_PREREQ(3, 1)
+-# define ATTRIBUTE_NOINLINE __attribute__((__noinline__))
+-#else
+-# define ATTRIBUTE_NOINLINE /* empty */
+-#endif
+-
+-#if GNUC_PREREQ(4, 3)
+-# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
+-#else
+-# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */
+-#endif
+-
+ #ifndef offsetof
+ # define offsetof(type, member) \
+ (((char *) &(((type *) NULL)->member)) - ((char *) (type *) NULL))
+diff --git a/gcc_compat.h b/gcc_compat.h
+new file mode 100644
+index 0000000..1f2c835
+--- /dev/null
++++ b/gcc_compat.h
+@@ -0,0 +1,73 @@
++/*
++ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#ifndef GCC_COMPAT_H_
++#define GCC_COMPAT_H_
++
++#if defined __GNUC__ && defined __GNUC_MINOR__
++# define GNUC_PREREQ(maj, min) \
++ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
++#else
++# define __attribute__(x) /* empty */
++# define GNUC_PREREQ(maj, min) 0
++#endif
++
++#if GNUC_PREREQ(2, 5)
++# define ATTRIBUTE_NORETURN __attribute__((__noreturn__))
++#else
++# define ATTRIBUTE_NORETURN /* empty */
++#endif
++
++#if GNUC_PREREQ(2, 7)
++# define ATTRIBUTE_FORMAT(args) __attribute__((__format__ args))
++# define ATTRIBUTE_ALIGNED(arg) __attribute__((__aligned__(arg)))
++# define ATTRIBUTE_PACKED __attribute__((__packed__))
++#else
++# define ATTRIBUTE_FORMAT(args) /* empty */
++# define ATTRIBUTE_ALIGNED(arg) /* empty */
++# define ATTRIBUTE_PACKED /* empty */
++#endif
++
++#if GNUC_PREREQ(3, 0)
++# define ATTRIBUTE_MALLOC __attribute__((__malloc__))
++#else
++# define ATTRIBUTE_MALLOC /* empty */
++#endif
++
++#if GNUC_PREREQ(3, 1)
++# define ATTRIBUTE_NOINLINE __attribute__((__noinline__))
++#else
++# define ATTRIBUTE_NOINLINE /* empty */
++#endif
++
++#if GNUC_PREREQ(4, 3)
++# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
++#else
++# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */
++#endif
++
++#endif
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-arc-metag-nios2-or1k-tile-fix-build.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-arc-metag-nios2-or1k-tile-fix-build.patch
new file mode 100644
index 000000000..a9d32037b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-arc-metag-nios2-or1k-tile-fix-build.patch
@@ -0,0 +1,117 @@
+From dd1a80c8d213eed95fe55b7ebcb07ee165dd8e4b Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Thu, 24 Dec 2015 15:40:55 +0000
+Subject: [PATCH] arc, metag, nios2, or1k, tile: fix build
+
+Fix build regression introduced by commit
+34683e3926d8c2daa368afb805da422ee7043396.
+
+* linux/32/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap.
+* linux/arc/syscallent.h: Add sys_ prefix to ARCH_mmap and mmap_pgoff.
+* linux/nios2/syscallent.h: Likewise.
+* linux/or1k/syscallent.h: Likewise.
+* linux/tile/syscallent1.h: Add sys_ prefix to ARCH_mmap and sys_mmap_4koff.
+* pathtrace.c (pathtrace_match): Handle SEN_ARCH_mmap.
+* NEWS: Mention this build fix.
+
+Reported-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Backport
+---
+ NEWS | 3 +++
+ linux/32/syscallent.h | 6 +++---
+ linux/arc/syscallent.h | 2 +-
+ linux/nios2/syscallent.h | 2 +-
+ linux/or1k/syscallent.h | 2 +-
+ linux/tile/syscallent1.h | 2 +-
+ pathtrace.c | 1 +
+ 7 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index fe40ca4..09263eb 100644
+--- a/NEWS
++++ b/NEWS
+@@ -1,3 +1,9 @@
++Noteworthy changes in release ?.?? (????-??-??)
++===============================================
++
++* Bug fixes
++ * Fixed build on arc, metag, nios2, or1k, and tile architectures.
++
+ Noteworthy changes in release 4.11 (2015-12-21)
+ ===============================================
+
+diff --git a/linux/32/syscallent.h b/linux/32/syscallent.h
+index 5f997e7..e6f895c 100644
+--- a/linux/32/syscallent.h
++++ b/linux/32/syscallent.h
+@@ -1,5 +1,5 @@
+-#ifndef ARCH_mmap
+-# define ARCH_mmap mmap
++#ifndef sys_ARCH_mmap
++# define sys_ARCH_mmap sys_mmap
+ #endif
+ [ 0] = { 2, 0, SEN(io_setup), "io_setup" },
+ [ 1] = { 1, 0, SEN(io_destroy), "io_destroy" },
+@@ -276,5 +276,5 @@
+ [283] = { 2, 0, SEN(membarrier), "membarrier", },
+ [284] = { 3, TM, SEN(mlock2), "mlock2" },
+
+-#undef ARCH_mmap
++#undef sys_ARCH_mmap
+ #undef ARCH_WANT_SYNC_FILE_RANGE2
+diff --git a/linux/arc/syscallent.h b/linux/arc/syscallent.h
+index 5847dc4..1100008 100644
+--- a/linux/arc/syscallent.h
++++ b/linux/arc/syscallent.h
+@@ -1,4 +1,4 @@
+-#define ARCH_mmap mmap_pgoff
++#define sys_ARCH_mmap sys_mmap_pgoff
+ #include "32/syscallent.h"
+ [244] = { 3, 0, SEN(printargs), "arc_cacheflush"},
+ [245] = { 1, 0, SEN(printargs), "arc_settls" },
+diff --git a/linux/nios2/syscallent.h b/linux/nios2/syscallent.h
+index 8a4b70e..01efe3a 100644
+--- a/linux/nios2/syscallent.h
++++ b/linux/nios2/syscallent.h
+@@ -1,4 +1,4 @@
+-#define ARCH_mmap mmap_pgoff
++#define sys_ARCH_mmap sys_mmap_pgoff
+ #include "32/syscallent.h"
+ [244] = {4, 0, SEN(cacheflush), "cacheflush"},
+ [245 ... 259] = { },
+diff --git a/linux/or1k/syscallent.h b/linux/or1k/syscallent.h
+index ed84b3b..351fe25 100644
+--- a/linux/or1k/syscallent.h
++++ b/linux/or1k/syscallent.h
+@@ -1,4 +1,4 @@
+-#define ARCH_mmap mmap_pgoff
++#define sys_ARCH_mmap sys_mmap_pgoff
+ #include "32/syscallent.h"
+ [244] = { 3, NF, SEN(or1k_atomic), "or1k_atomic" },
+ [245 ... 259] = { },
+diff --git a/linux/tile/syscallent1.h b/linux/tile/syscallent1.h
+index c86f059..28dbab4 100644
+--- a/linux/tile/syscallent1.h
++++ b/linux/tile/syscallent1.h
+@@ -1,4 +1,4 @@
+-#define ARCH_mmap mmap_4koff
++#define sys_ARCH_mmap sys_mmap_4koff
+ #define ARCH_WANT_SYNC_FILE_RANGE2 1
+ #include "32/syscallent.h"
+ [244] = { 1, 0, SEN(printargs), "cmpxchg_badaddr" },
+diff --git a/pathtrace.c b/pathtrace.c
+index d530ec2..e72cdf7 100644
+--- a/pathtrace.c
++++ b/pathtrace.c
+@@ -216,6 +216,7 @@ pathtrace_match(struct tcb *tcp)
+ case SEN_mmap:
+ case SEN_mmap_4koff:
+ case SEN_mmap_pgoff:
++ case SEN_ARCH_mmap:
+ /* x, x, x, x, fd */
+ return fdmatch(tcp, tcp->u_arg[4]);
+
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-scm_rights-fd.test-rewrite-without-fork.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-scm_rights-fd.test-rewrite-without-fork.patch
new file mode 100644
index 000000000..c4e645b81
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-scm_rights-fd.test-rewrite-without-fork.patch
@@ -0,0 +1,198 @@
+From 3fdcdd47c6a67585123a0a0c8fffabcc9f79a3a2 Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Tue, 12 Jan 2016 14:47:12 +0000
+Subject: [PATCH] scm_rights-fd.test: rewrite without fork
+
+* tests/scm_rights.c (main): Rewrite without fork.
+Place all objects passed to sendmsg and recvmsg at the end
+of memory pages followed by inaccessible pages.
+* tests/scm_rights-fd.test: Update.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+
+ tests/scm_rights-fd.test | 12 ++---
+ tests/scm_rights.c | 122 ++++++++++++++++++++++-------------------------
+ 2 files changed, 63 insertions(+), 71 deletions(-)
+
+diff --git a/tests/scm_rights-fd.test b/tests/scm_rights-fd.test
+index a32ef36..48c5028 100755
+--- a/tests/scm_rights-fd.test
++++ b/tests/scm_rights-fd.test
+@@ -49,18 +49,18 @@ touch -- "$file" ||
+ framework_skip_ 'failed to create a file'
+
+ run_prog ./scm_rights /dev/zero
+-run_strace_merge -y -x -enetwork $args "$file"
++run_strace -y -x -enetwork $args "$file"
+
++sample='\\xf1\\xf2\\xf3\\xf4\\xf5\\xf6\\xf7\\xf8\\xf9\\xfa\\xfb\\xfc\\xfd\\xfe\\xff'
+ n='[1-9][0-9]*'
+-msg='\{msg_name\(0\)=NULL, msg_iov\(1\)=\[\{"\\x00\\x00\\x00\\x00[^"]*", '"$n"'\}\], msg_controllen='"$n"
+-rights='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, \[3</dev/null>, 4</dev/zero>, 5</[^}>]*/(A\\n){127}Z>\]\}'
++msg='\{msg_name\(0\)=NULL, msg_iov\(1\)=\[\{"'"$sample"'", 15\}\], msg_controllen='"$n"
++rights='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, \[4</dev/null>, 5</dev/zero>, 6</[^}>]*/(A\\n){127}Z>\]\}'
+ creds='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS, \{pid='"$n"', uid=[0-9]+, gid=[0-9]+\}\}'
+-prefix='[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +'
+ EXPECTED="$LOG.expected"
+
+ cat > "$EXPECTED" << __EOF__
+-${prefix}sendmsg\\(1<socket:\\[[0-9]+\\]>, $msg, \\[$rights\\], msg_flags=0\\}, 0\\) += $n
+-${prefix}recvmsg\\(0<socket:\\[[0-9]+\\]>, $msg, \\[$creds, $rights\\], msg_flags=0\\}, 0\\) += $n
++sendmsg\\(3<socket:\\[[0-9]+\\]>, $msg, \\[$rights\\], msg_flags=0\\}, 0\\) = 15
++recvmsg\\(0<socket:\\[[0-9]+\\]>, $msg, \\[$creds, $rights\\], msg_flags=0\\}, 0\\) = 15
+ __EOF__
+
+ match_grep "$LOG" "$EXPECTED"
+diff --git a/tests/scm_rights.c b/tests/scm_rights.c
+index 1e5e850..00af4d5 100644
+--- a/tests/scm_rights.c
++++ b/tests/scm_rights.c
+@@ -27,26 +27,39 @@
+
+ #include "tests.h"
+ #include <assert.h>
+-#include <string.h>
+-#include <stdlib.h>
+-#include <unistd.h>
+ #include <errno.h>
+ #include <fcntl.h>
++#include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
+ #include <sys/socket.h>
+-#include <sys/wait.h>
+
+ int main(int ac, const char **av)
+ {
+- int i;
+- int data = 0;
+- struct iovec iov = {
+- .iov_base = &data,
+- .iov_len = sizeof(iov)
+- };
++ assert(ac > 0);
++ int fds[ac];
++
++ static const char sample[] =
++ "\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
++ const unsigned int data_size = sizeof(sample) - 1;
++ void *data = tail_alloc(data_size);
++ memcpy(data, sample, data_size);
++
++ struct iovec *iov = tail_alloc(sizeof(struct iovec));
++ iov->iov_base = data;
++ iov->iov_len = data_size;
+
+- while ((i = open("/dev/null", O_RDWR)) < 3)
++ struct msghdr *mh = tail_alloc(sizeof(struct msghdr));
++ memset(mh, 0, sizeof(*mh));
++ mh->msg_iov = iov;
++ mh->msg_iovlen = 1;
++
++ int i;
++ while ((i = open("/dev/null", O_RDWR)) <= ac + 2)
+ assert(i >= 0);
+- (void) close(3);
++ while (i > 2)
++ assert(close(i--) == 0);
++ assert(close(0) == 0);
+
+ int sv[2];
+ if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv))
+@@ -55,60 +68,39 @@ int main(int ac, const char **av)
+ if (setsockopt(sv[0], SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)))
+ perror_msg_and_skip("setsockopt");
+
+- pid_t pid = fork();
+- if (pid < 0)
+- perror_msg_and_fail("fork");
+-
+- if (pid) {
+- assert(close(sv[0]) == 0);
+- assert(dup2(sv[1], 1) == 1);
+- assert(close(sv[1]) == 0);
+-
+- int fds[ac];
+- assert((fds[0] = open("/dev/null", O_RDWR)) == 3);
+- for (i = 1; i < ac; ++i)
+- assert((fds[i] = open(av[i], O_RDONLY)) == i + 3);
+-
+- union {
+- struct cmsghdr cmsg;
+- char buf[CMSG_LEN(sizeof(fds))];
+- } control;
+-
+- control.cmsg.cmsg_level = SOL_SOCKET;
+- control.cmsg.cmsg_type = SCM_RIGHTS;
+- control.cmsg.cmsg_len = CMSG_LEN(sizeof(fds));
+- memcpy(CMSG_DATA(&control.cmsg), fds, sizeof(fds));
+-
+- struct msghdr mh = {
+- .msg_iov = &iov,
+- .msg_iovlen = 1,
+- .msg_control = &control,
+- .msg_controllen = sizeof(control)
+- };
+-
+- assert(sendmsg(1, &mh, 0) == sizeof(iov));
+- assert(close(1) == 0);
+-
+- int status;
+- assert(waitpid(pid, &status, 0) == pid);
+- assert(status == 0);
+- } else {
+- assert(close(sv[1]) == 0);
+- assert(dup2(sv[0], 0) == 0);
+- assert(close(sv[0]) == 0);
+-
+- struct cmsghdr control[4 + ac * sizeof(int) / sizeof(struct cmsghdr)];
+-
+- struct msghdr mh = {
+- .msg_iov = &iov,
+- .msg_iovlen = 1,
+- .msg_control = control,
+- .msg_controllen = sizeof(control)
+- };
+-
+- assert(recvmsg(0, &mh, 0) == sizeof(iov));
+- assert(close(0) == 0);
++ assert((fds[0] = open("/dev/null", O_RDWR)) == 4);
++ for (i = 1; i < ac; ++i)
++ assert((fds[i] = open(av[i], O_RDONLY)) == i + 4);
++
++ unsigned int cmsg_size = CMSG_SPACE(sizeof(fds));
++ struct cmsghdr *cmsg = tail_alloc(cmsg_size);
++ memset(cmsg, 0, cmsg_size);
++ cmsg->cmsg_level = SOL_SOCKET;
++ cmsg->cmsg_type = SCM_RIGHTS;
++ cmsg->cmsg_len = CMSG_LEN(sizeof(fds));
++ memcpy(CMSG_DATA(cmsg), fds, sizeof(fds));
++
++ mh->msg_control = cmsg;
++ mh->msg_controllen = cmsg_size;
++
++ assert(sendmsg(sv[1], mh, 0) == (int) data_size);
++
++ assert(close(sv[1]) == 0);
++ assert(open("/dev/null", O_RDWR) == sv[1]);
++
++ for (i = 0; i < ac; ++i) {
++ assert(close(fds[i]) == 0);
++ fds[i] = 0;
+ }
+
++ cmsg_size += CMSG_SPACE(sizeof(struct ucred));
++ cmsg = tail_alloc(cmsg_size);
++ memset(cmsg, 0, cmsg_size);
++ mh->msg_control = cmsg;
++ mh->msg_controllen = cmsg_size;
++
++ assert(recvmsg(0, mh, 0) == (int) data_size);
++ assert(close(0) == 0);
++
+ return 0;
+ }
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-introduce-libtests.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-introduce-libtests.patch
new file mode 100644
index 000000000..1575ecd22
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-introduce-libtests.patch
@@ -0,0 +1,306 @@
+From 87e6b230fff800eb768b68b2e5173ebbe83fd3ef Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Sat, 2 Jan 2016 12:05:14 +0000
+Subject: [PATCH] tests: introduce libtests
+
+Introduce tests/libtests.a with common functions for use in tests.
+
+* tests/tests.h: New file.
+* tests/error_msg.c: Likewise.
+* tests/tail_alloc.c: Likewise.
+* tests/get_page_size.c: Likewise.
+* tests/Makefile.am (libtests_a_SOURCES, libtests_a_CPPFLAGS,
+check_LIBRARIES, LDADD): New variables.
+(clock_xettime_LDADD, filter_unavailable_LDADD, mq_LDADD,
+pc_LDADD, times_LDADD): Add $(LDADD).
+* tests/.gitignore: Add libtests.a.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+
+ tests/.gitignore | 1 +
+ tests/Makefile.am | 20 ++++++++++----
+ tests/error_msg.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ tests/get_page_size.c | 13 +++++++++
+ tests/tail_alloc.c | 52 ++++++++++++++++++++++++++++++++++++
+ tests/tests.h | 62 ++++++++++++++++++++++++++++++++++++++++++
+ 6 files changed, 217 insertions(+), 5 deletions(-)
+ create mode 100644 tests/error_msg.c
+ create mode 100644 tests/get_page_size.c
+ create mode 100644 tests/tail_alloc.c
+ create mode 100644 tests/tests.h
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 386a2c2..62d0e56 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -40,6 +40,16 @@ AM_CPPFLAGS = $(ARCH_MFLAGS) \
+ -I$(top_srcdir)
+ AM_LDFLAGS = $(ARCH_MFLAGS)
+
++libtests_a_SOURCES = \
++ get_page_size.c \
++ error_msg.c \
++ tail_alloc.c \
++ tests.h \
++ # end of libtests_a_SOURCES
++libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
++check_LIBRARIES = libtests.a
++LDADD = libtests.a
++
+ check_PROGRAMS = \
+ _newselect \
+ adjtimex \
+@@ -146,19 +156,19 @@ check_PROGRAMS = \
+ xettimeofday \
+ # end of check_PROGRAMS
+
+-clock_xettime_LDADD = -lrt
+-filter_unavailable_LDADD = -lpthread
++clock_xettime_LDADD = -lrt $(LDADD)
++filter_unavailable_LDADD = -lpthread $(LDADD)
+ fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+-mq_LDADD = -lrt
++mq_LDADD = -lrt $(LDADD)
+ newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+-pc_LDADD = $(dl_LIBS)
++pc_LDADD = $(dl_LIBS) $(LDADD)
+ stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+-times_LDADD = -lrt
++times_LDADD = -lrt $(LDADD)
+ truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64
+ stack_fcall_SOURCES = stack-fcall.c \
+diff --git a/tests/error_msg.c b/tests/error_msg.c
+new file mode 100644
+index 0000000..3fd3411
+--- /dev/null
++++ b/tests/error_msg.c
+@@ -0,0 +1,74 @@
++/*
++ * Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#include "tests.h"
++#include <errno.h>
++#include <stdarg.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++void
++perror_msg_and_fail(const char *fmt, ...)
++{
++ int err_no = errno;
++ va_list p;
++
++ va_start(p, fmt);
++ vfprintf(stderr, fmt, p);
++ if (err_no)
++ fprintf(stderr, ": %s\n", strerror(err_no));
++ else
++ putc('\n', stderr);
++ exit(1);
++}
++
++void
++error_msg_and_skip(const char *fmt, ...)
++{
++ va_list p;
++
++ va_start(p, fmt);
++ vfprintf(stderr, fmt, p);
++ putc('\n', stderr);
++ exit(77);
++}
++
++void
++perror_msg_and_skip(const char *fmt, ...)
++{
++ int err_no = errno;
++ va_list p;
++
++ va_start(p, fmt);
++ vfprintf(stderr, fmt, p);
++ if (err_no)
++ fprintf(stderr, ": %s\n", strerror(err_no));
++ else
++ putc('\n', stderr);
++ exit(77);
++}
+diff --git a/tests/get_page_size.c b/tests/get_page_size.c
+new file mode 100644
+index 0000000..aeea861
+--- /dev/null
++++ b/tests/get_page_size.c
+@@ -0,0 +1,13 @@
++#include "tests.h"
++#include <unistd.h>
++
++size_t
++get_page_size(void)
++{
++ static size_t page_size;
++
++ if (!page_size)
++ page_size = sysconf(_SC_PAGESIZE);
++
++ return page_size;
++}
+diff --git a/tests/tail_alloc.c b/tests/tail_alloc.c
+new file mode 100644
+index 0000000..2b8b14e
+--- /dev/null
++++ b/tests/tail_alloc.c
+@@ -0,0 +1,52 @@
++/*
++ * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#include "tests.h"
++#include <string.h>
++#include <sys/mman.h>
++
++void *
++tail_alloc(const size_t size)
++{
++ const size_t page_size = get_page_size();
++ const size_t len = (size + page_size - 1) & -page_size;
++ const size_t alloc_size = len + 2 * page_size;
++
++ void *p = mmap(NULL, alloc_size, PROT_READ | PROT_WRITE,
++ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
++ if (MAP_FAILED == p)
++ perror_msg_and_fail("mmap(%zu)", alloc_size);
++
++ void *start_work = p + page_size;
++ void *tail_guard = start_work + len;
++
++ if (munmap(p, page_size) || munmap(tail_guard, page_size))
++ perror_msg_and_fail("munmap");
++
++ memset(start_work, 0xff, len);
++ return tail_guard - size;
++}
+diff --git a/tests/tests.h b/tests/tests.h
+new file mode 100644
+index 0000000..91fa24e
+--- /dev/null
++++ b/tests/tests.h
+@@ -0,0 +1,62 @@
++/*
++ * Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#ifndef TESTS_H_
++# define TESTS_H_
++
++# ifdef HAVE_CONFIG_H
++# include "config.h"
++# endif
++
++# include <sys/types.h>
++# include "gcc_compat.h"
++
++/* Cached sysconf(_SC_PAGESIZE). */
++size_t get_page_size(void);
++
++/* Print message and strerror(errno) to stderr, then exit(1). */
++void perror_msg_and_fail(const char *, ...)
++ ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
++/* Print message to stderr, then exit(77). */
++void error_msg_and_skip(const char *, ...)
++ ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
++/* Print message and strerror(errno) to stderr, then exit(77). */
++void perror_msg_and_skip(const char *, ...)
++ ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
++
++/*
++ * Allocate memory that ends on the page boundary.
++ * Pages allocated by this call are preceeded by an unmapped page
++ * and followed also by an unmapped page.
++ */
++void *tail_alloc(const size_t)
++ ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1));
++
++# define SKIP_MAIN_UNDEFINED(arg) \
++ int main(void) { error_msg_and_skip("undefined: %s", arg); }
++
++#endif
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-scm_rights.c-use-libtests.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-scm_rights.c-use-libtests.patch
new file mode 100644
index 000000000..3fbab8b66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/0001-tests-scm_rights.c-use-libtests.patch
@@ -0,0 +1,54 @@
+From 339a15b619b479c63cafba21d5fc359e613d9ee8 Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Mon, 4 Jan 2016 23:53:31 +0000
+Subject: [PATCH] tests/scm_rights.c: use libtests
+
+* tests/scm_rights.c (main): Use perror_msg_and_fail and perror_msg_and_skip.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+
+ tests/scm_rights.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/tests/scm_rights.c b/tests/scm_rights.c
+index c41444f..1e5e850 100644
+--- a/tests/scm_rights.c
++++ b/tests/scm_rights.c
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
++ * Copyright (c) 2014-2016 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+@@ -25,6 +25,7 @@
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#include "tests.h"
+ #include <assert.h>
+ #include <string.h>
+ #include <stdlib.h>
+@@ -48,12 +49,15 @@ int main(int ac, const char **av)
+ (void) close(3);
+
+ int sv[2];
+- assert(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0);
++ if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv))
++ perror_msg_and_skip("socketpair");
+ int one = 1;
+- assert(setsockopt(sv[0], SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)) == 0);
++ if (setsockopt(sv[0], SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)))
++ perror_msg_and_skip("setsockopt");
+
+ pid_t pid = fork();
+- assert(pid >= 0);
++ if (pid < 0)
++ perror_msg_and_fail("fork");
+
+ if (pid) {
+ assert(close(sv[0]) == 0);
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch
new file mode 100644
index 000000000..824031e86
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch
@@ -0,0 +1,53 @@
+strace: Add ptest
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Gabriel Barbu <gabriel.barbu@enea.com>
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ configure.ac | 2 +-
+ tests/Makefile.am | 18 ++++++++++++++++++
+ 2 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0209bac..b969e25 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -36,7 +36,7 @@ AC_INIT([strace],
+ AC_CONFIG_SRCDIR([strace.c])
+ AC_CONFIG_AUX_DIR([.])
+ AC_CONFIG_HEADERS([config.h])
+-AM_INIT_AUTOMAKE([foreign nostdinc dist-xz no-dist-gzip silent-rules parallel-tests])
++AM_INIT_AUTOMAKE([foreign nostdinc dist-xz no-dist-gzip silent-rules serial-tests])
+ AM_MAINTAINER_MODE
+ AC_CANONICAL_HOST
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 0f23b4b..429f7e9 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -332,3 +332,21 @@ ksysent.h: $(srcdir)/ksysent.sed
+
+ BUILT_SOURCES = ksysent.h
+ CLEANFILES = ksysent.h $(TESTS:=.tmp)
++
++buildtest-TESTS: $(check_PROGRAMS) $(TESTS)
++
++install-ptest:
++ install $(BUILDDIR)/strace $(DESTDIR)
++ install $(srcdir)/../strace-log-merge $(DESTDIR)
++ install -d $(DESTDIR)/$(TESTDIR)
++ cp $(BUILDDIR)/$(TESTDIR)/Makefile $(DESTDIR)/$(TESTDIR)
++ sed -i -e 's/^Makefile:/_Makefile:/' $(DESTDIR)/$(TESTDIR)/Makefile
++ sed -i -e 's/bash/sh/' $(DESTDIR)/$(TESTDIR)/Makefile
++ for file in $(check_PROGRAMS); do \
++ install $(BUILDDIR)/$(TESTDIR)/$$file $(DESTDIR)/$(TESTDIR); \
++ done
++ for file in $(EXTRA_DIST); do \
++ install $(srcdir)/$$file $(DESTDIR)/$(TESTDIR); \
++ sed -i -e 's/$${srcdir=.}/./g' $(DESTDIR)/$(TESTDIR)/$$file; \
++ done
++ for i in net net-fd scm_rights-fd sigaction; do sed -i -e 's/$$srcdir/./g' $(DESTDIR)/$(TESTDIR)/$$i.test; done
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/disable-git-version-gen.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/disable-git-version-gen.patch
new file mode 100644
index 000000000..7bc143635
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/disable-git-version-gen.patch
@@ -0,0 +1,20 @@
+The git-version-gen script is not included in tarball releases,
+so we need to avoid attempts to call it when running autoreconf.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+
+Index: strace-4.10/configure.ac
+===================================================================
+--- strace-4.10.orig/configure.ac
++++ strace-4.10/configure.ac
+@@ -1,7 +1,7 @@
+ dnl Process this file with autoconf to create configure. Use autoreconf.
+ AC_PREREQ(2.57)
+ AC_INIT([strace],
+- m4_esyscmd([./git-version-gen .tarball-version]),
++ m4_esyscmd_s([cat .tarball-version]),
+ [strace-devel@lists.sourceforge.net])
+ AC_CONFIG_SRCDIR([strace.c])
+ AC_CONFIG_AUX_DIR([.])
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/more-robust-test-for-m32-mx32-compile-support.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/more-robust-test-for-m32-mx32-compile-support.patch
new file mode 100644
index 000000000..756cd8bb8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/more-robust-test-for-m32-mx32-compile-support.patch
@@ -0,0 +1,46 @@
+From 154af50ed7ed8b91838d713052ebf29b0b14f765 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Mon, 18 Jan 2016 11:00:00 -0800
+Subject: [PATCH] mpers.m4: more robust test for -m32/-mx32 compile support
+
+When using the default OE toolchain for x86-64, the basic checks for
+-m32 and -mx32 compile support in mpers.m4 pass but later attempts to
+actually use the toolchain with -m32 fail, e.g.
+
+ | In file included from /home/andre/build/tmp/sysroots/qemux86-64/usr/include/sys/syscall.h:31:0,
+ | from ../strace-4.11/defs.h:55,
+ | from mpers-m32/kernel_dirent.c:32:
+ | /home/andre/build/tmp/sysroots/qemux86-64/usr/include/bits/syscall.h:41:29: fatal error: bits/syscall-32.h: No such file or directory
+
+Make the mpers.m4 tests more robust so that configure correctly
+detects the limitations of the OE toolchain.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ m4/mpers.m4 | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/m4/mpers.m4 b/m4/mpers.m4
+index 1fe8a8e..d72c717 100644
+--- a/m4/mpers.m4
++++ b/m4/mpers.m4
+@@ -53,12 +53,14 @@ case "$arch" in
+ CFLAGS="$CFLAGS CFLAG $IFLAG"
+ AC_CACHE_CHECK([for CFLAG compile support], [st_cv_cc],
+ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdint.h>
++ #include <sys/syscall.h>
+ int main(){return 0;}]])],
+ [st_cv_cc=yes],
+ [st_cv_cc=no])])
+ if test $st_cv_cc = yes; then
+ AC_CACHE_CHECK([for CFLAG runtime support], [st_cv_runtime],
+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdint.h>
++ #include <sys/syscall.h>
+ int main(){return 0;}]])],
+ [st_cv_runtime=yes],
+ [st_cv_runtime=no],
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/run-ptest b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/run-ptest
new file mode 100755
index 000000000..133cf92d0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -C tests -k runtest-TESTS
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/update-gawk-paths.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/update-gawk-paths.patch
new file mode 100644
index 000000000..bfc7f3441
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/update-gawk-paths.patch
@@ -0,0 +1,118 @@
+From 3836518c46bd5bb3e71371b1b18274bf2d487133 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Mon, 18 Jan 2016 11:01:00 -0800
+Subject: [PATCH] update gawk paths, /bin/gawk -> /usr/bin/gawk
+
+The default path to gawk is /usr/bin/gawk, so update test scripts etc
+from #!/bin/gawk to #!/usr/bin/gawk. Fixes missing RDPENDS QA tests:
+
+ WARNING: QA Issue: /usr/lib/strace/ptest/tests/unix-yy-accept.awk_strace-ptest contained in package strace-ptest requires /bin/gawk, but no providers found in its RDEPENDS [file-rdeps]
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ mpers.awk | 2 +-
+ tests/caps.awk | 2 +-
+ tests/match.awk | 2 +-
+ tests/net-yy-accept.awk | 2 +-
+ tests/net-yy-connect.awk | 2 +-
+ tests/sigaction.awk | 2 +-
+ tests/uid.awk | 2 +-
+ tests/unix-yy-accept.awk | 2 +-
+ tests/unix-yy-connect.awk | 2 +-
+ 9 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/mpers.awk b/mpers.awk
+index 73bf0b0..50e6c16 100644
+--- a/mpers.awk
++++ b/mpers.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ # Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+diff --git a/tests/caps.awk b/tests/caps.awk
+index bad8b0f..845f37c 100644
+--- a/tests/caps.awk
++++ b/tests/caps.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ # All rights reserved.
+diff --git a/tests/match.awk b/tests/match.awk
+index abfbae9..f2740bf 100644
+--- a/tests/match.awk
++++ b/tests/match.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ # All rights reserved.
+diff --git a/tests/net-yy-accept.awk b/tests/net-yy-accept.awk
+index fed3e30..e916ab0 100644
+--- a/tests/net-yy-accept.awk
++++ b/tests/net-yy-accept.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+diff --git a/tests/net-yy-connect.awk b/tests/net-yy-connect.awk
+index f4dcf91..b3cec8c 100644
+--- a/tests/net-yy-connect.awk
++++ b/tests/net-yy-connect.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+diff --git a/tests/sigaction.awk b/tests/sigaction.awk
+index 5c6b6d0..3e14464 100644
+--- a/tests/sigaction.awk
++++ b/tests/sigaction.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ # All rights reserved.
+diff --git a/tests/uid.awk b/tests/uid.awk
+index a56c5be..67b0749 100644
+--- a/tests/uid.awk
++++ b/tests/uid.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ # All rights reserved.
+diff --git a/tests/unix-yy-accept.awk b/tests/unix-yy-accept.awk
+index 4ed60e4..2a9d9c0 100644
+--- a/tests/unix-yy-accept.awk
++++ b/tests/unix-yy-accept.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+diff --git a/tests/unix-yy-connect.awk b/tests/unix-yy-connect.awk
+index 262bf2e..c809dfa 100644
+--- a/tests/unix-yy-connect.awk
++++ b/tests/unix-yy-connect.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/use-asm-sgidefs.h.patch b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/use-asm-sgidefs.h.patch
new file mode 100644
index 000000000..db83d1130
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-devtools/strace/strace/use-asm-sgidefs.h.patch
@@ -0,0 +1,51 @@
+From 2995245d7e3f46e8b3995002995ebd28beca7d55 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Fri, 5 Feb 2016 14:00:00 -0800
+Subject: [PATCH] use <asm/sgidefs.h>
+
+Build fix for MIPS with musl libc.
+
+The MIPS specific header <sgidefs.h> is provided by glibc and uclibc
+but not by musl. Regardless of the libc, the kernel headers provide
+<asm/sgidefs.h> which provides the same definitions, so use that
+instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ configure.ac | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 1524b9b..287e03d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -196,20 +196,20 @@ AC_SUBST(arch_mx32)
+ if test "$arch" = mips; then
+ AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM],
+ [AC_COMPUTE_INT([st_cv__MIPS_SIM], [_MIPS_SIM],
+- [#include <sgidefs.h>],
++ [#include <asm/sgidefs.h>],
+ [AC_MSG_ERROR([_MIPS_SIM cannot be determined])])])
+
+ AC_CACHE_CHECK([for MIPS ABI], [st_cv_mips_abi],
+ [AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([[#include <sgidefs.h>]],
++ [AC_LANG_PROGRAM([[#include <asm/sgidefs.h>]],
+ [[int i[_MIPS_SIM == _MIPS_SIM_ABI32 ? 1 : - 1];]])],
+ [st_cv_mips_abi=o32],
+ [AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([[#include <sgidefs.h>]],
++ [AC_LANG_PROGRAM([[#include <asm/sgidefs.h>]],
+ [[int i[_MIPS_SIM == _MIPS_SIM_NABI32 ? 1 : - 1];]])],
+ [st_cv_mips_abi=n32],
+ [AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([[#include <sgidefs.h>]],
++ [AC_LANG_PROGRAM([[#include <asm/sgidefs.h>]],
+ [[int i[_MIPS_SIM == _MIPS_SIM_ABI64 ? 1 : - 1];]])],
+ [st_cv_mips_abi=n64],
+ [st_cv_mips_abi=unknown])])])])
+--
+1.9.1
+
OpenPOWER on IntegriCloud