summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
Diffstat (limited to 'patches')
-rw-r--r--patches/binutils/2.25.1/120-sh-conf.patch33
-rw-r--r--patches/binutils/2.25.1/300-001_ld_makefile_patch.patch26
-rw-r--r--patches/binutils/2.25.1/300-012_check_ldrunpath_length.patch22
-rw-r--r--patches/binutils/2.25.1/avr/0001-AVR-only-support-C-for-AVR-memory-usage.patch536
-rw-r--r--patches/ltrace/0.7.3/001-avoid-libstdc++.patch43
-rw-r--r--patches/ltrace/0.7.3/002-printf-p.patch18
-rw-r--r--patches/ltrace/0.7.3/003-alpha-debug.h.patch17
-rw-r--r--patches/ltrace/0.7.3/004-compile-warning.patch28
-rw-r--r--patches/ltrace/0.7.3/005-sparc-ftbfs.patch31
-rw-r--r--patches/ltrace/0.7.3/006-unexpected-breakpoint.patch22
-rw-r--r--patches/ltrace/0.7.3/007-gcc-5.patch (renamed from patches/ltrace/0.7.3/110-ltrace.git-8c3674c86688a79a8689772c3d0c84d6e7aaa118.patch)0
-rw-r--r--patches/ltrace/0.7.3/100-ltrace.git-a77b267abb870c935f9b4187ca31409fa5eb9dcb.patch42
-rw-r--r--patches/strace/4.10/001_aarch64_rt_sigreturn.patch21
-rw-r--r--patches/strace/4.10/002_arm_mmap2.patch22
-rw-r--r--patches/strace/4.10/003_aarch64_arch_regs.patch25
-rw-r--r--patches/strace/4.10/004_stat64-v.test.patch87
-rw-r--r--patches/strace/4.10/005_select_test.patch48
-rw-r--r--patches/strace/4.10/006_fix_aarch64_ioctl_decoding.patch39
-rw-r--r--patches/strace/4.10/007_fix_bexecve64_test.patch18
-rw-r--r--patches/strace/4.10/008_decode_mips_indirect_syscall.patch64
20 files changed, 1100 insertions, 42 deletions
diff --git a/patches/binutils/2.25.1/120-sh-conf.patch b/patches/binutils/2.25.1/120-sh-conf.patch
new file mode 100644
index 0000000..c12a023
--- /dev/null
+++ b/patches/binutils/2.25.1/120-sh-conf.patch
@@ -0,0 +1,33 @@
+r10231 | lethal | 2005-05-02 09:58:00 -0400 (Mon, 02 May 2005) | 13 lines
+
+Likewise, binutils has no idea about any of these new targets either, so we
+fix that up too.. now we're able to actually build a real toolchain for
+sh2a_nofpu- and other more ineptly named toolchains (and yes, there are more
+inept targets than that one, really. Go look, I promise).
+
+diff --git a/configure b/configure
+index 87677bc..2d916f1 100755
+--- a/configure
++++ b/configure
+@@ -3812,7 +3812,7 @@ case "${target}" in
+ or1k*-*-*)
+ noconfigdirs="$noconfigdirs gdb"
+ ;;
+- sh-*-* | sh64-*-*)
++ sh*-*-* | sh64-*-*)
+ case "${target}" in
+ sh*-*-elf)
+ ;;
+diff --git a/configure.ac b/configure.ac
+index 8fe0eca..b10a99f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1140,7 +1140,7 @@ case "${target}" in
+ or1k*-*-*)
+ noconfigdirs="$noconfigdirs gdb"
+ ;;
+- sh-*-* | sh64-*-*)
++ sh*-*-* | sh64-*-*)
+ case "${target}" in
+ sh*-*-elf)
+ ;;
diff --git a/patches/binutils/2.25.1/300-001_ld_makefile_patch.patch b/patches/binutils/2.25.1/300-001_ld_makefile_patch.patch
new file mode 100644
index 0000000..2a1320c
--- /dev/null
+++ b/patches/binutils/2.25.1/300-001_ld_makefile_patch.patch
@@ -0,0 +1,26 @@
+diff --git a/ld/Makefile.am b/ld/Makefile.am
+index 9575f1f..84df0bf 100644
+--- a/ld/Makefile.am
++++ b/ld/Makefile.am
+@@ -54,7 +54,7 @@ endif
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+
+ EMUL = @EMUL@
+ EMULATION_OFILES = @EMULATION_OFILES@
+diff --git a/ld/Makefile.in b/ld/Makefile.in
+index 9f56ca1..272860f 100644
+--- a/ld/Makefile.in
++++ b/ld/Makefile.in
+@@ -388,7 +388,7 @@ AM_CFLAGS = $(WARN_CFLAGS)
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+ BASEDIR = $(srcdir)/..
+ BFDDIR = $(BASEDIR)/bfd
+ INCDIR = $(BASEDIR)/include
diff --git a/patches/binutils/2.25.1/300-012_check_ldrunpath_length.patch b/patches/binutils/2.25.1/300-012_check_ldrunpath_length.patch
new file mode 100644
index 0000000..f1f31af
--- /dev/null
+++ b/patches/binutils/2.25.1/300-012_check_ldrunpath_length.patch
@@ -0,0 +1,22 @@
+diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
+index 137446f..bb8391a 100644
+--- a/ld/emultempl/elf32.em
++++ b/ld/emultempl/elf32.em
+@@ -1195,6 +1195,8 @@ fragment <<EOF
+ && command_line.rpath == NULL)
+ {
+ lib_path = (const char *) getenv ("LD_RUN_PATH");
++ if ((lib_path) && (strlen (lib_path) == 0))
++ lib_path = NULL;
+ if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
+ force))
+ break;
+@@ -1458,6 +1460,8 @@ gld${EMULATION_NAME}_before_allocation (void)
+ rpath = command_line.rpath;
+ if (rpath == NULL)
+ rpath = (const char *) getenv ("LD_RUN_PATH");
++ if ((rpath) && (*rpath == '\0'))
++ rpath = NULL;
+
+ for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
+ if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
diff --git a/patches/binutils/2.25.1/avr/0001-AVR-only-support-C-for-AVR-memory-usage.patch b/patches/binutils/2.25.1/avr/0001-AVR-only-support-C-for-AVR-memory-usage.patch
new file mode 100644
index 0000000..32fc1a4
--- /dev/null
+++ b/patches/binutils/2.25.1/avr/0001-AVR-only-support-C-for-AVR-memory-usage.patch
@@ -0,0 +1,536 @@
+From 55e9a09c2249f3d5bbc09d718679365604436aac Mon Sep 17 00:00:00 2001
+From: Erico Nunes <nunes.erico@gmail.com>
+Date: Sat, 13 Jun 2015 00:53:25 -0300
+Subject: [PATCH] AVR only; support -C for AVR memory usage
+
+Source: http://git.makehackvoid.com/cgi-bin/gitweb.cgi?p=mhvavrtools.git;a=blob_plain;f=mhvavrtools/patches/binutils-001-avr-size.patch;h=e80d28eae46217551d996a2253256c97d10aa4b5;hb=refs/heads/master
+
+Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
+---
+ binutils/size.c | 414 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
+ 1 file changed, 394 insertions(+), 20 deletions(-)
+
+diff --git a/binutils/size.c b/binutils/size.c
+index 0937de5..486ddde 100644
+--- a/binutils/size.c
++++ b/binutils/size.c
+@@ -36,10 +36,31 @@
+ #include "getopt.h"
+ #include "bucomm.h"
+
+-#ifndef BSD_DEFAULT
+-#define BSD_DEFAULT 1
++typedef enum
++{
++ format_sysv = 0,
++ format_bsd = 1,
++ format_avr = 2,
++} format_type_t;
++
++
++/* Set the default format. */
++#define FORMAT_DEFAULT_SYSV 0
++#define FORMAT_DEFAULT_BSD 1
++#define FORMAT_DEFAULT_AVR 0
++
++#if FORMAT_DEFAULT_SYSV
++ #define FORMAT_DEFAULT format_sysv
++ #define FORMAT_NAME "sysv"
++#elif FORMAT_DEFAULT_BSD
++ #define FORMAT_DEFAULT format_bsd
++ #define FORMAT_NAME "berkeley"
++#elif FORMAT_DEFAULT_AVR
++ #define FORMAT_DEFAULT format_avr
++ #define FORMAT_NAME "avr"
+ #endif
+
++
+ /* Program options. */
+
+ static enum
+@@ -48,9 +69,8 @@ static enum
+ }
+ radix = decimal;
+
+-/* 0 means use AT&T-style output. */
+-static int berkeley_format = BSD_DEFAULT;
+
++format_type_t format = FORMAT_DEFAULT;
+ static int show_version = 0;
+ static int show_help = 0;
+ static int show_totals = 0;
+@@ -64,6 +84,246 @@ static bfd_size_type total_textsize;
+ /* Program exit status. */
+ static int return_code = 0;
+
++
++/* AVR Size specific stuff */
++
++#define AVR64 64UL
++#define AVR128 128UL
++#define AVR256 256UL
++#define AVR512 512UL
++#define AVR1K 1024UL
++#define AVR2K 2048UL
++#define AVR4K 4096UL
++#define AVR8K 8192UL
++#define AVR16K 16384UL
++#define AVR20K 20480UL
++#define AVR24K 24576UL
++#define AVR32K 32768UL
++#define AVR36K 36864UL
++#define AVR40K 40960UL
++#define AVR64K 65536UL
++#define AVR68K 69632UL
++#define AVR128K 131072UL
++#define AVR136K 139264UL
++#define AVR200K 204800UL
++#define AVR256K 262144UL
++#define AVR264K 270336UL
++
++typedef struct
++{
++ char *name;
++ long flash;
++ long ram;
++ long eeprom;
++} avr_device_t;
++
++avr_device_t avr[] =
++{
++ {"atxmega256a3", AVR264K, AVR16K, AVR4K},
++ {"atxmega256a3b", AVR264K, AVR16K, AVR4K},
++ {"atxmega256d3", AVR264K, AVR16K, AVR4K},
++
++ {"atmega2560", AVR256K, AVR8K, AVR4K},
++ {"atmega2561", AVR256K, AVR8K, AVR4K},
++
++ {"atxmega192a3", AVR200K, AVR16K, AVR2K},
++ {"atxmega192d3", AVR200K, AVR16K, AVR2K},
++
++ {"atxmega128a1", AVR136K, AVR8K, AVR2K},
++ {"atxmega128a1u", AVR136K, AVR8K, AVR2K},
++ {"atxmega128a3", AVR136K, AVR8K, AVR2K},
++ {"atxmega128d3", AVR136K, AVR8K, AVR2K},
++
++ {"at43usb320", AVR128K, 608UL, 0UL},
++ {"at90can128", AVR128K, AVR4K, AVR4K},
++ {"at90usb1286", AVR128K, AVR8K, AVR4K},
++ {"at90usb1287", AVR128K, AVR8K, AVR4K},
++ {"atmega128", AVR128K, AVR4K, AVR4K},
++ {"atmega1280", AVR128K, AVR8K, AVR4K},
++ {"atmega1281", AVR128K, AVR8K, AVR4K},
++ {"atmega1284p", AVR128K, AVR16K, AVR4K},
++ {"atmega128rfa1", AVR128K, AVR16K, AVR4K},
++ {"atmega103", AVR128K, 4000UL, AVR4K},
++
++ {"atxmega64a1", AVR68K, AVR4K, AVR2K},
++ {"atxmega64a1u", AVR68K, AVR4K, AVR2K},
++ {"atxmega64a3", AVR68K, AVR4K, AVR2K},
++ {"atxmega64d3", AVR68K, AVR4K, AVR2K},
++
++ {"at90can64", AVR64K, AVR4K, AVR2K},
++ {"at90scr100", AVR64K, AVR4K, AVR2K},
++ {"at90usb646", AVR64K, AVR4K, AVR2K},
++ {"at90usb647", AVR64K, AVR4K, AVR2K},
++ {"atmega64", AVR64K, AVR4K, AVR2K},
++ {"atmega640", AVR64K, AVR8K, AVR4K},
++ {"atmega644", AVR64K, AVR4K, AVR2K},
++ {"atmega644a", AVR64K, AVR4K, AVR2K},
++ {"atmega644p", AVR64K, AVR4K, AVR2K},
++ {"atmega644pa", AVR64K, AVR4K, AVR2K},
++ {"atmega645", AVR64K, AVR4K, AVR2K},
++ {"atmega645a", AVR64K, AVR4K, AVR2K},
++ {"atmega645p", AVR64K, AVR4K, AVR2K},
++ {"atmega6450", AVR64K, AVR4K, AVR2K},
++ {"atmega6450a", AVR64K, AVR4K, AVR2K},
++ {"atmega6450p", AVR64K, AVR4K, AVR2K},
++ {"atmega649", AVR64K, AVR4K, AVR2K},
++ {"atmega649a", AVR64K, AVR4K, AVR2K},
++ {"atmega649p", AVR64K, AVR4K, AVR2K},
++ {"atmega6490", AVR64K, AVR4K, AVR2K},
++ {"atmega6490a", AVR64K, AVR4K, AVR2K},
++ {"atmega6490p", AVR64K, AVR4K, AVR2K},
++ {"atmega64c1", AVR64K, AVR4K, AVR2K},
++ {"atmega64hve", AVR64K, AVR4K, AVR1K},
++ {"atmega64m1", AVR64K, AVR4K, AVR2K},
++ {"m3000", AVR64K, AVR4K, 0UL},
++
++ {"atmega406", AVR40K, AVR2K, AVR512},
++
++ {"atxmega32a4", AVR36K, AVR4K, AVR1K},
++ {"atxmega32d4", AVR36K, AVR4K, AVR1K},
++
++ {"at90can32", AVR32K, AVR2K, AVR1K},
++ {"at94k", AVR32K, AVR4K, 0UL},
++ {"atmega32", AVR32K, AVR2K, AVR1K},
++ {"atmega323", AVR32K, AVR2K, AVR1K},
++ {"atmega324a", AVR32K, AVR2K, AVR1K},
++ {"atmega324p", AVR32K, AVR2K, AVR1K},
++ {"atmega324pa", AVR32K, AVR2K, AVR1K},
++ {"atmega325", AVR32K, AVR2K, AVR1K},
++ {"atmega325a", AVR32K, AVR2K, AVR1K},
++ {"atmega325p", AVR32K, AVR2K, AVR1K},
++ {"atmega3250", AVR32K, AVR2K, AVR1K},
++ {"atmega3250a", AVR32K, AVR2K, AVR1K},
++ {"atmega3250p", AVR32K, AVR2K, AVR1K},
++ {"atmega328", AVR32K, AVR2K, AVR1K},
++ {"atmega328p", AVR32K, AVR2K, AVR1K},
++ {"atmega329", AVR32K, AVR2K, AVR1K},
++ {"atmega329a", AVR32K, AVR2K, AVR1K},
++ {"atmega329p", AVR32K, AVR2K, AVR1K},
++ {"atmega329pa", AVR32K, AVR2K, AVR1K},
++ {"atmega3290", AVR32K, AVR2K, AVR1K},
++ {"atmega3290a", AVR32K, AVR2K, AVR1K},
++ {"atmega3290p", AVR32K, AVR2K, AVR1K},
++ {"atmega32hvb", AVR32K, AVR2K, AVR1K},
++ {"atmega32c1", AVR32K, AVR2K, AVR1K},
++ {"atmega32hvb", AVR32K, AVR2K, AVR1K},
++ {"atmega32m1", AVR32K, AVR2K, AVR1K},
++ {"atmega32u2", AVR32K, AVR1K, AVR1K},
++ {"atmega32u4", AVR32K, 2560UL, AVR1K},
++ {"atmega32u6", AVR32K, 2560UL, AVR1K},
++
++ {"at43usb355", AVR24K, 1120UL, 0UL},
++
++ {"atxmega16a4", AVR20K, AVR2K, AVR1K},
++ {"atxmega16d4", AVR20K, AVR2K, AVR1K},
++
++ {"at76c711", AVR16K, AVR2K, 0UL},
++ {"at90pwm216", AVR16K, AVR1K, AVR512},
++ {"at90pwm316", AVR16K, AVR1K, AVR512},
++ {"at90usb162", AVR16K, AVR512, AVR512},
++ {"atmega16", AVR16K, AVR1K, AVR512},
++ {"atmega16a", AVR16K, AVR1K, AVR512},
++ {"atmega161", AVR16K, AVR1K, AVR512},
++ {"atmega162", AVR16K, AVR1K, AVR512},
++ {"atmega163", AVR16K, AVR1K, AVR512},
++ {"atmega164", AVR16K, AVR1K, AVR512},
++ {"atmega164a", AVR16K, AVR1K, AVR512},
++ {"atmega164p", AVR16K, AVR1K, AVR512},
++ {"atmega165a", AVR16K, AVR1K, AVR512},
++ {"atmega165", AVR16K, AVR1K, AVR512},
++ {"atmega165p", AVR16K, AVR1K, AVR512},
++ {"atmega168", AVR16K, AVR1K, AVR512},
++ {"atmega168a", AVR16K, AVR1K, AVR512},
++ {"atmega168p", AVR16K, AVR1K, AVR512},
++ {"atmega169", AVR16K, AVR1K, AVR512},
++ {"atmega169a", AVR16K, AVR1K, AVR512},
++ {"atmega169p", AVR16K, AVR1K, AVR512},
++ {"atmega169pa", AVR16K, AVR1K, AVR512},
++ {"atmega16hva", AVR16K, 768UL, AVR256},
++ {"atmega16hva2", AVR16K, AVR1K, AVR256},
++ {"atmega16hvb", AVR16K, AVR1K, AVR512},
++ {"atmega16m1", AVR16K, AVR1K, AVR512},
++ {"atmega16u2", AVR16K, AVR512, AVR512},
++ {"atmega16u4", AVR16K, 1280UL, AVR512},
++ {"attiny167", AVR16K, AVR512, AVR512},
++
++ {"at90c8534", AVR8K, 352UL, AVR512},
++ {"at90pwm1", AVR8K, AVR512, AVR512},
++ {"at90pwm2", AVR8K, AVR512, AVR512},
++ {"at90pwm2b", AVR8K, AVR512, AVR512},
++ {"at90pwm3", AVR8K, AVR512, AVR512},
++ {"at90pwm3b", AVR8K, AVR512, AVR512},
++ {"at90pwm81", AVR8K, AVR256, AVR512},
++ {"at90s8515", AVR8K, AVR512, AVR512},
++ {"at90s8535", AVR8K, AVR512, AVR512},
++ {"at90usb82", AVR8K, AVR512, AVR512},
++ {"ata6289", AVR8K, AVR512, 320UL},
++ {"atmega8", AVR8K, AVR1K, AVR512},
++ {"atmega8515", AVR8K, AVR512, AVR512},
++ {"atmega8535", AVR8K, AVR512, AVR512},
++ {"atmega88", AVR8K, AVR1K, AVR512},
++ {"atmega88a", AVR8K, AVR1K, AVR512},
++ {"atmega88p", AVR8K, AVR1K, AVR512},
++ {"atmega88pa", AVR8K, AVR1K, AVR512},
++ {"atmega8hva", AVR8K, 768UL, AVR256},
++ {"atmega8u2", AVR8K, AVR512, AVR512},
++ {"attiny84", AVR8K, AVR512, AVR512},
++ {"attiny84a", AVR8K, AVR512, AVR512},
++ {"attiny85", AVR8K, AVR512, AVR512},
++ {"attiny861", AVR8K, AVR512, AVR512},
++ {"attiny861a", AVR8K, AVR512, AVR512},
++ {"attiny87", AVR8K, AVR512, AVR512},
++ {"attiny88", AVR8K, AVR512, AVR64},
++
++ {"at90s4414", AVR4K, 352UL, AVR256},
++ {"at90s4433", AVR4K, AVR128, AVR256},
++ {"at90s4434", AVR4K, 352UL, AVR256},
++ {"atmega48", AVR4K, AVR512, AVR256},
++ {"atmega48a", AVR4K, AVR512, AVR256},
++ {"atmega48p", AVR4K, AVR512, AVR256},
++ {"attiny4313", AVR4K, AVR256, AVR256},
++ {"attiny43u", AVR4K, AVR256, AVR64},
++ {"attiny44", AVR4K, AVR256, AVR256},
++ {"attiny44a", AVR4K, AVR256, AVR256},
++ {"attiny45", AVR4K, AVR256, AVR256},
++ {"attiny461", AVR4K, AVR256, AVR256},
++ {"attiny461a", AVR4K, AVR256, AVR256},
++ {"attiny48", AVR4K, AVR256, AVR64},
++
++ {"at86rf401", AVR2K, 224UL, AVR128},
++ {"at90s2313", AVR2K, AVR128, AVR128},
++ {"at90s2323", AVR2K, AVR128, AVR128},
++ {"at90s2333", AVR2K, 224UL, AVR128},
++ {"at90s2343", AVR2K, AVR128, AVR128},
++ {"attiny20", AVR2K, AVR128, 0UL},
++ {"attiny22", AVR2K, 224UL, AVR128},
++ {"attiny2313", AVR2K, AVR128, AVR128},
++ {"attiny2313a", AVR2K, AVR128, AVR128},
++ {"attiny24", AVR2K, AVR128, AVR128},
++ {"attiny24a", AVR2K, AVR128, AVR128},
++ {"attiny25", AVR2K, AVR128, AVR128},
++ {"attiny26", AVR2K, AVR128, AVR128},
++ {"attiny261", AVR2K, AVR128, AVR128},
++ {"attiny261a", AVR2K, AVR128, AVR128},
++ {"attiny28", AVR2K, 0UL, 0UL},
++ {"attiny40", AVR2K, AVR256, 0UL},
++
++ {"at90s1200", AVR1K, 0UL, AVR64},
++ {"attiny9", AVR1K, 32UL, 0UL},
++ {"attiny10", AVR1K, 32UL, 0UL},
++ {"attiny11", AVR1K, 0UL, AVR64},
++ {"attiny12", AVR1K, 0UL, AVR64},
++ {"attiny13", AVR1K, AVR64, AVR64},
++ {"attiny13a", AVR1K, AVR64, AVR64},
++ {"attiny15", AVR1K, 0UL, AVR64},
++
++ {"attiny4", AVR512, 32UL, 0UL},
++ {"attiny5", AVR512, 32UL, 0UL},
++};
++
++static char *avrmcu = NULL;
++
++
+ static char *target = NULL;
+
+ /* Forward declarations. */
+@@ -79,7 +339,8 @@ usage (FILE *stream, int status)
+ fprintf (stream, _(" Displays the sizes of sections inside binary files\n"));
+ fprintf (stream, _(" If no input file(s) are specified, a.out is assumed\n"));
+ fprintf (stream, _(" The options are:\n\
+- -A|-B --format={sysv|berkeley} Select output style (default is %s)\n\
++ -A|-B|-C --format={sysv|berkeley|avr} Select output style (default is %s)\n\
++ --mcu=<avrmcu> MCU name for AVR format only\n\
+ -o|-d|-x --radix={8|10|16} Display numbers in octal, decimal or hex\n\
+ -t --totals Display the total sizes (Berkeley only)\n\
+ --common Display total size for *COM* syms\n\
+@@ -88,11 +349,7 @@ usage (FILE *stream, int status)
+ -h --help Display this information\n\
+ -v --version Display the program's version\n\
+ \n"),
+-#if BSD_DEFAULT
+- "berkeley"
+-#else
+- "sysv"
+-#endif
++FORMAT_NAME
+ );
+ list_supported_targets (program_name, stream);
+ if (REPORT_BUGS_TO[0] && status == 0)
+@@ -103,6 +360,7 @@ usage (FILE *stream, int status)
+ #define OPTION_FORMAT (200)
+ #define OPTION_RADIX (OPTION_FORMAT + 1)
+ #define OPTION_TARGET (OPTION_RADIX + 1)
++#define OPTION_MCU (OPTION_TARGET + 1)
+
+ static struct option long_options[] =
+ {
+@@ -110,6 +368,7 @@ static struct option long_options[] =
+ {"format", required_argument, 0, OPTION_FORMAT},
+ {"radix", required_argument, 0, OPTION_RADIX},
+ {"target", required_argument, 0, OPTION_TARGET},
++ {"mcu", required_argument, 0, 203},
+ {"totals", no_argument, &show_totals, 1},
+ {"version", no_argument, &show_version, 1},
+ {"help", no_argument, &show_help, 1},
+@@ -141,7 +400,7 @@ main (int argc, char **argv)
+ bfd_init ();
+ set_default_bfd_target ();
+
+- while ((c = getopt_long (argc, argv, "ABHhVvdfotx", long_options,
++ while ((c = getopt_long (argc, argv, "ABCHhVvdfotx", long_options,
+ (int *) 0)) != EOF)
+ switch (c)
+ {
+@@ -150,11 +409,15 @@ main (int argc, char **argv)
+ {
+ case 'B':
+ case 'b':
+- berkeley_format = 1;
++ format = format_bsd;
+ break;
+ case 'S':
+ case 's':
+- berkeley_format = 0;
++ format = format_sysv;
++ break;
++ case 'A':
++ case 'a':
++ format = format_avr;
+ break;
+ default:
+ non_fatal (_("invalid argument to --format: %s"), optarg);
+@@ -162,6 +425,10 @@ main (int argc, char **argv)
+ }
+ break;
+
++ case OPTION_MCU:
++ avrmcu = optarg;
++ break;
++
+ case OPTION_TARGET:
+ target = optarg;
+ break;
+@@ -190,11 +457,14 @@ main (int argc, char **argv)
+ break;
+
+ case 'A':
+- berkeley_format = 0;
++ format = format_sysv;
+ break;
+ case 'B':
+- berkeley_format = 1;
++ format = format_bsd;
+ break;
++ case 'C':
++ format = format_avr;
++ break;
+ case 'v':
+ case 'V':
+ show_version = 1;
+@@ -240,7 +510,7 @@ main (int argc, char **argv)
+ for (; optind < argc;)
+ display_file (argv[optind++]);
+
+- if (show_totals && berkeley_format)
++ if (show_totals && format == format_bsd)
+ {
+ bfd_size_type total = total_textsize + total_datasize + total_bsssize;
+
+@@ -599,13 +869,117 @@ print_sysv_format (bfd *file)
+ printf ("\n\n");
+ }
+
++
++static avr_device_t *
++avr_find_device (void)
++{
++ unsigned int i;
++ if (avrmcu != NULL)
++ {
++ for (i = 0; i < sizeof(avr) / sizeof(avr[0]); i++)
++ {
++ if (strcmp(avr[i].name, avrmcu) == 0)
++ {
++ /* Match found */
++ return (&avr[i]);
++ }
++ }
++ }
++ return (NULL);
++}
++
++
++
++static void
++print_avr_format (bfd *file)
++{
++ char *avr_name = "Unknown";
++ int flashmax = 0;
++ int rammax = 0;
++ int eeprommax = 0;
++ asection *section;
++ bfd_size_type my_datasize = 0;
++ bfd_size_type my_textsize = 0;
++ bfd_size_type my_bsssize = 0;
++ bfd_size_type bootloadersize = 0;
++ bfd_size_type noinitsize = 0;
++ bfd_size_type eepromsize = 0;
++
++ avr_device_t *avrdevice = avr_find_device();
++ if (avrdevice != NULL)
++ {
++ avr_name = avrdevice->name;
++ flashmax = avrdevice->flash;
++ rammax = avrdevice->ram;
++ eeprommax = avrdevice->eeprom;
++ }
++
++ if ((section = bfd_get_section_by_name (file, ".data")) != NULL)
++ my_datasize = bfd_section_size (file, section);
++ if ((section = bfd_get_section_by_name (file, ".text")) != NULL)
++ my_textsize = bfd_section_size (file, section);
++ if ((section = bfd_get_section_by_name (file, ".bss")) != NULL)
++ my_bsssize = bfd_section_size (file, section);
++ if ((section = bfd_get_section_by_name (file, ".bootloader")) != NULL)
++ bootloadersize = bfd_section_size (file, section);
++ if ((section = bfd_get_section_by_name (file, ".noinit")) != NULL)
++ noinitsize = bfd_section_size (file, section);
++ if ((section = bfd_get_section_by_name (file, ".eeprom")) != NULL)
++ eepromsize = bfd_section_size (file, section);
++
++ bfd_size_type text = my_textsize + my_datasize + bootloadersize;
++ bfd_size_type data = my_datasize + my_bsssize + noinitsize;
++ bfd_size_type eeprom = eepromsize;
++
++ printf ("AVR Memory Usage\n"
++ "----------------\n"
++ "Device: %s\n\n", avr_name);
++
++ /* Text size */
++ printf ("Program:%8ld bytes", text);
++ if (flashmax > 0)
++ {
++ printf (" (%2.1f%% Full)", ((float)text / flashmax) * 100);
++ }
++ printf ("\n(.text + .data + .bootloader)\n\n");
++
++ /* Data size */
++ printf ("Data: %8ld bytes", data);
++ if (rammax > 0)
++ {
++ printf (" (%2.1f%% Full)", ((float)data / rammax) * 100);
++ }
++ printf ("\n(.data + .bss + .noinit)\n\n");
++
++ /* EEPROM size */
++ if (eeprom > 0)
++ {
++ printf ("EEPROM: %8ld bytes", eeprom);
++ if (eeprommax > 0)
++ {
++ printf (" (%2.1f%% Full)", ((float)eeprom / eeprommax) * 100);
++ }
++ printf ("\n(.eeprom)\n\n");
++ }
++}
++
++
+ static void
+ print_sizes (bfd *file)
+ {
+ if (show_common)
+ calculate_common_size (file);
+- if (berkeley_format)
+- print_berkeley_format (file);
+- else
+- print_sysv_format (file);
++ switch (format)
++ {
++ case format_sysv:
++ print_sysv_format (file);
++ break;
++ case format_bsd:
++ print_berkeley_format (file);
++ break;
++ case format_avr:
++ default:
++ print_avr_format (file);
++ break;
++ }
+ }
+--
+2.4.1
+
diff --git a/patches/ltrace/0.7.3/001-avoid-libstdc++.patch b/patches/ltrace/0.7.3/001-avoid-libstdc++.patch
new file mode 100644
index 0000000..9cbf557
--- /dev/null
+++ b/patches/ltrace/0.7.3/001-avoid-libstdc++.patch
@@ -0,0 +1,43 @@
+From: Juan Cespedes <cespedes@debian.org>
+Description: avoid warning from dpkg-shlibdeps:
+ package could avoid a useless dependency if ltrace was not
+ linked against libstdc++.so.6 (it uses none of the library's symbols)
+Last-Update: 2013-12-30
+
+
+--- a/configure.ac 2013-09-17 01:04:28.000000000 +0200
++++ b/configure.ac 2013-12-30 12:24:20.000000000 +0100
+@@ -113,6 +113,15 @@
+ libstdcxx_LIBS=""])
+ AC_SUBST(libstdcxx_LIBS)
+
++if test "x$liberty_LIBS" != "x"
++then
++ libsupcxx_LIBS=""
++ libstdcxx_LIBS=""
++elif test "x$libsupcxx_LIBS" != "x"
++then
++ libstdcxx_LIBS=""
++fi
++
+
+ dnl Check security_get_boolean_active availability.
+ AC_CHECK_HEADERS(selinux/selinux.h)
+--- a/configure 2013-09-17 01:07:46.000000000 +0100
++++ b/configure 2013-12-30 12:34:23.000000000 +0100
+@@ -11826,6 +11826,15 @@
+
+
+
++if test "x$liberty_LIBS" != "x"
++then
++ libsupcxx_LIBS=""
++ libstdcxx_LIBS=""
++elif test "x$libsupcxx_LIBS" != "x"
++then
++ libstdcxx_LIBS=""
++fi
++
+
+ for ac_header in selinux/selinux.h
+ do :
diff --git a/patches/ltrace/0.7.3/002-printf-p.patch b/patches/ltrace/0.7.3/002-printf-p.patch
new file mode 100644
index 0000000..10631d9
--- /dev/null
+++ b/patches/ltrace/0.7.3/002-printf-p.patch
@@ -0,0 +1,18 @@
+From: Juan Cespedes <cespedes@debian.org>
+Description: Prevent freeing static-alloc'd memory for %p and %n in printf
+Bug-Debian: http://bugs.debian.org/614994
+Forwarded: http://lists.alioth.debian.org/pipermail/ltrace-devel/2013-September/000953.html
+Last-Update: 2014-01-02
+
+
+--- ltrace-0.7.3.orig/printf.c
++++ ltrace-0.7.3/printf.c
+@@ -168,7 +168,7 @@ form_next_param(struct param_enum *self,
+ type_init_pointer(infop, array, 1);
+
+ } else if (format_type == ARGTYPE_POINTER) {
+- type_init_pointer(infop, elt_info, 1);
++ type_init_pointer(infop, elt_info, 0);
+
+ } else {
+ *infop = *type_get_simple(format_type);
diff --git a/patches/ltrace/0.7.3/003-alpha-debug.h.patch b/patches/ltrace/0.7.3/003-alpha-debug.h.patch
new file mode 100644
index 0000000..237026d
--- /dev/null
+++ b/patches/ltrace/0.7.3/003-alpha-debug.h.patch
@@ -0,0 +1,17 @@
+From: Juan Cespedes <cespedes@debian.org>
+Description: fixed FTBFS on alpha
+ don't include "debug.h" twice
+Last-Update: 2014-01-02
+Bug-Debian: http://bugs.debian.org/678721
+
+
+--- ltrace-0.7.3.orig/sysdeps/linux-gnu/alpha/trace.c
++++ ltrace-0.7.3/sysdeps/linux-gnu/alpha/trace.c
+@@ -29,7 +29,6 @@
+
+ #include "proc.h"
+ #include "common.h"
+-#include "debug.h"
+
+ #if (!defined(PTRACE_PEEKUSER) && defined(PTRACE_PEEKUSR))
+ # define PTRACE_PEEKUSER PTRACE_PEEKUSR
diff --git a/patches/ltrace/0.7.3/004-compile-warning.patch b/patches/ltrace/0.7.3/004-compile-warning.patch
new file mode 100644
index 0000000..ad65829
--- /dev/null
+++ b/patches/ltrace/0.7.3/004-compile-warning.patch
@@ -0,0 +1,28 @@
+From: Juan Cespedes <cespedes@debian.org>
+Description: Fix compile warning
+Last-Update: 2014-01-02
+Forwarded: not-needed
+
+
+--- ltrace-0.7.3.orig/value.c
++++ ltrace-0.7.3/value.c
+@@ -284,7 +284,7 @@ value_init_deref(struct value *ret_val,
+
+ /* We need "long" to be long enough to hold platform
+ * pointers. */
+- typedef char assert__long_enough_long[-(sizeof(l) < sizeof(void *))];
++ (void)sizeof(char[1 - 2*(sizeof(l) < sizeof(void *))]);
+
+ value_common_init(ret_val, valp->inferior, valp,
+ valp->type->u.ptr_info.info, 0);
+--- ltrace-0.7.3.orig/lens_default.c
++++ ltrace-0.7.3/lens_default.c
+@@ -344,7 +344,7 @@ format_array(FILE *stream, struct value
+ {
+ /* We need "long" to be long enough to cover the whole address
+ * space. */
+- typedef char assert__long_enough_long[-(sizeof(long) < sizeof(void *))];
++ (void)sizeof(char[1 - 2*(sizeof(long) < sizeof(void *))]);
+ long l;
+ if (expr_eval_word(length, value, arguments, &l) < 0)
+ return -1;
diff --git a/patches/ltrace/0.7.3/005-sparc-ftbfs.patch b/patches/ltrace/0.7.3/005-sparc-ftbfs.patch
new file mode 100644
index 0000000..266a8e6
--- /dev/null
+++ b/patches/ltrace/0.7.3/005-sparc-ftbfs.patch
@@ -0,0 +1,31 @@
+From: Juan Cespedes <cespedes@debian.org>
+Description: fixes compilation on sparc
+Last-Update: 2014-01-02
+
+
+--- ltrace-0.7.3.orig/sysdeps/linux-gnu/sparc/plt.c
++++ ltrace-0.7.3/sysdeps/linux-gnu/sparc/plt.c
+@@ -19,8 +19,9 @@
+ */
+
+ #include <gelf.h>
++
+ #include "proc.h"
+-#include "common.h"
++#include "library.h"
+
+ GElf_Addr
+ arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela) {
+--- ltrace-0.7.3.orig/sysdeps/linux-gnu/sparc/trace.c
++++ ltrace-0.7.3/sysdeps/linux-gnu/sparc/trace.c
+@@ -26,8 +26,10 @@
+ #include <sys/wait.h>
+ #include <signal.h>
+ #include <string.h>
++
+ #include "ptrace.h"
+ #include "proc.h"
++#include "backend.h"
+ #include "common.h"
+
+ void
diff --git a/patches/ltrace/0.7.3/006-unexpected-breakpoint.patch b/patches/ltrace/0.7.3/006-unexpected-breakpoint.patch
new file mode 100644
index 0000000..443bee4
--- /dev/null
+++ b/patches/ltrace/0.7.3/006-unexpected-breakpoint.patch
@@ -0,0 +1,22 @@
+From: Juan Cespedes <cespedes@debian.org>
+Description: continue after unexpected breakpoint
+ (instead of decrementing PC and execute int3 again and again)
+Last-Update: 2014-01-03
+
+
+--- ltrace-0.7.3.orig/handle_event.c
++++ ltrace-0.7.3/handle_event.c
+@@ -656,9 +656,12 @@ handle_breakpoint(Event *event)
+
+ if ((sbp = address2bpstruct(leader, brk_addr)) != NULL)
+ breakpoint_on_hit(sbp, event->proc);
+- else if (event->proc->state != STATE_IGNORED)
++ else if (event->proc->state != STATE_IGNORED) {
+ output_line(event->proc,
+ "unexpected breakpoint at %p", brk_addr);
++ continue_process(event->proc->pid);
++ return;
++ }
+
+ /* breakpoint_on_hit may delete its own breakpoint, so we have
+ * to look it up again. */
diff --git a/patches/ltrace/0.7.3/110-ltrace.git-8c3674c86688a79a8689772c3d0c84d6e7aaa118.patch b/patches/ltrace/0.7.3/007-gcc-5.patch
index 4c62f85..4c62f85 100644
--- a/patches/ltrace/0.7.3/110-ltrace.git-8c3674c86688a79a8689772c3d0c84d6e7aaa118.patch
+++ b/patches/ltrace/0.7.3/007-gcc-5.patch
diff --git a/patches/ltrace/0.7.3/100-ltrace.git-a77b267abb870c935f9b4187ca31409fa5eb9dcb.patch b/patches/ltrace/0.7.3/100-ltrace.git-a77b267abb870c935f9b4187ca31409fa5eb9dcb.patch
deleted file mode 100644
index 64691ce..0000000
--- a/patches/ltrace/0.7.3/100-ltrace.git-a77b267abb870c935f9b4187ca31409fa5eb9dcb.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From a77b267abb870c935f9b4187ca31409fa5eb9dcb Mon Sep 17 00:00:00 2001
-From: Peter Wu <lekensteyn@gmail.com>
-Date: Thu, 26 Sep 2013 00:55:55 +0200
-Subject: [PATCH] Fix compile warning about unused typedef
-
-Switch assertion to style as used by the Linux kernel (BUILD_BUG_ON)
-
-Signed-off-by: Peter Wu <lekensteyn@gmail.com>
----
- lens_default.c | 2 +-
- value.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/lens_default.c b/lens_default.c
-index e0c0566..84b74ea 100644
---- a/lens_default.c
-+++ b/lens_default.c
-@@ -345,7 +345,7 @@ format_array(FILE *stream, struct value *value, struct value_dict *arguments,
- {
- /* We need "long" to be long enough to cover the whole address
- * space. */
-- typedef char assert__long_enough_long[-(sizeof(long) < sizeof(void *))];
-+ (void)sizeof(char[1 - 2*(sizeof(long) < sizeof(void *))]);
- long l;
- if (expr_eval_word(length, value, arguments, &l) < 0)
- return -1;
-diff --git a/value.c b/value.c
-index d18db17..8caf98c 100644
---- a/value.c
-+++ b/value.c
-@@ -284,7 +284,7 @@ value_init_deref(struct value *ret_val, struct value *valp)
-
- /* We need "long" to be long enough to hold platform
- * pointers. */
-- typedef char assert__long_enough_long[-(sizeof(l) < sizeof(void *))];
-+ (void)sizeof(char[1 - 2*(sizeof(l) < sizeof(void *))]);
-
- value_common_init(ret_val, valp->inferior, valp,
- valp->type->u.ptr_info.info, 0);
---
-1.8.5.2
-
diff --git a/patches/strace/4.10/001_aarch64_rt_sigreturn.patch b/patches/strace/4.10/001_aarch64_rt_sigreturn.patch
new file mode 100644
index 0000000..6b7bbe3
--- /dev/null
+++ b/patches/strace/4.10/001_aarch64_rt_sigreturn.patch
@@ -0,0 +1,21 @@
+commit d76d3069526c348e6fe5d40bbbceb2ae4a928d16
+Author: Dmitry V. Levin <ldv@altlinux.org>
+Date: Wed Mar 11 14:32:25 2015 +0000
+
+ aarch64: fix rt_sigreturn decoding
+
+ * sigreturn.c (sys_sigreturn) [AARCH64]: Fix personality check.
+
+diff --git a/sigreturn.c b/sigreturn.c
+index 648bd0a..c253a0c 100644
+--- a/sigreturn.c
++++ b/sigreturn.c
+@@ -23,7 +23,7 @@ sys_sigreturn(struct tcb *tcp)
+ # define OFFSETOF_STRUCT_UCONTEXT_UC_SIGMASK (5 * 4 + SIZEOF_STRUCT_SIGCONTEXT)
+ const long addr =
+ # ifdef AARCH64
+- current_personality == 0 ?
++ current_personality == 1 ?
+ (*aarch64_sp_ptr + SIZEOF_STRUCT_SIGINFO +
+ offsetof(struct ucontext, uc_sigmask)) :
+ # endif
diff --git a/patches/strace/4.10/002_arm_mmap2.patch b/patches/strace/4.10/002_arm_mmap2.patch
new file mode 100644
index 0000000..41953e2
--- /dev/null
+++ b/patches/strace/4.10/002_arm_mmap2.patch
@@ -0,0 +1,22 @@
+commit dbadf7bcc8995612d5ef737047b909e868387e37
+Author: Andreas Schwab <schwab@suse.de>
+Date: Mon Mar 9 16:55:06 2015 +0100
+
+ Fix decoding of mmap2 for arm
+
+ * syscallent.h (mmap2): Decode with sys_mmap_4koff, not
+ sys_mmap_pgoff.
+
+diff --git a/linux/arm/syscallent.h b/linux/arm/syscallent.h
+index 52aed9e..b66a5a2 100644
+--- a/linux/arm/syscallent.h
++++ b/linux/arm/syscallent.h
+@@ -218,7 +218,7 @@
+ [189] = { 5, 0, sys_putpmsg, "putpmsg" },
+ [190] = { 0, TP, sys_vfork, "vfork" },
+ [191] = { 2, 0, sys_getrlimit, "ugetrlimit" },
+-[192] = { 6, TD|TM|SI, sys_mmap_pgoff, "mmap2" },
++[192] = { 6, TD|TM|SI, sys_mmap_4koff, "mmap2" },
+ [193] = { 4, TF, sys_truncate64, "truncate64" },
+ [194] = { 4, TD, sys_ftruncate64, "ftruncate64" },
+ [195] = { 2, TF, sys_stat64, "stat64" },
diff --git a/patches/strace/4.10/003_aarch64_arch_regs.patch b/patches/strace/4.10/003_aarch64_arch_regs.patch
new file mode 100644
index 0000000..e5153b5
--- /dev/null
+++ b/patches/strace/4.10/003_aarch64_arch_regs.patch
@@ -0,0 +1,25 @@
+commit 64fc9cedc475b2fc0d940509dc4232b02b5f83ec
+Author: Andreas Schwab <schwab@suse.de>
+Date: Thu Mar 12 11:54:08 2015 +0100
+
+ Distribute linux/aarch64/arch_regs.h
+
+ * Makefile.am (EXTRA_DIST): Add linux/aarch64/arch_regs.h.
+
+diff --git a/Makefile.am b/Makefile.am
+index 2030f9b..48fe1d7 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -164,6 +164,7 @@ EXTRA_DIST = \
+ linux/32/syscallent.h \
+ linux/64/ioctls_inc.h \
+ linux/64/syscallent.h \
++ linux/aarch64/arch_regs.h \
+ linux/aarch64/errnoent1.h \
+ linux/aarch64/ioctls_arch0.h \
+ linux/aarch64/ioctls_arch1.h \
+--- a/linux/aarch64/arch_regs.h 2015-06-09 03:27:46.170000000 +0000
++++ b/linux/aarch64/arch_regs.h 2015-07-01 21:23:17.025202308 +0000
+@@ -0,0 +1,2 @@
++extern uint64_t *const aarch64_sp_ptr;
++extern uint32_t *const arm_sp_ptr;
diff --git a/patches/strace/4.10/004_stat64-v.test.patch b/patches/strace/4.10/004_stat64-v.test.patch
new file mode 100644
index 0000000..53383e3
--- /dev/null
+++ b/patches/strace/4.10/004_stat64-v.test.patch
@@ -0,0 +1,87 @@
+commit f79252f072a193bdff435afeaa6b6cd6d5c79947
+Author: Dmitry V. Levin <ldv@altlinux.org>
+Date: Mon Mar 16 17:18:40 2015 +0000
+
+ stat64-v.test: add newfstatat syscall support
+
+ Newer architectures have no stat syscall, so stat() is implemented there
+ using newfstatat syscall.
+
+ * tests/stat.c (STAT_FNAME): Rename to STAT_PREFIX. Update callers.
+ [_FILE_OFFSET_BITS == 64] (STAT_PREFIX): Add newfstatat support.
+ (main) [!NR_stat]: Add newfstatat support.
+
+ Reported-by: Andreas Schwab <schwab@suse.de>
+
+diff --git a/tests/stat.c b/tests/stat.c
+index 21e37fb..2b04010 100644
+--- a/tests/stat.c
++++ b/tests/stat.c
+@@ -14,22 +14,22 @@
+ # include <sys/types.h>
+ #endif
+
+-#undef STAT_FNAME
++#undef STAT_PREFIX
+ #undef NR_stat
+
+ #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+ # include <sys/stat.h>
+-# define STAT_FNAME "stat(64)?"
++# define STAT_PREFIX "(stat(64)?\\(|newfstatat\\(AT_FDCWD, )"
+ #else
+ # include <sys/syscall.h>
+ # if defined __NR_stat
+ # define NR_stat __NR_stat
+-# define STAT_FNAME "stat"
++# define STAT_PREFIX "stat\\("
+ # elif defined __NR_newstat
+ # define NR_stat __NR_newstat
+-# define STAT_FNAME "newstat"
++# define STAT_PREFIX "newstat\\("
+ # endif
+-# ifdef STAT_FNAME
++# ifdef STAT_PREFIX
+ /* for S_IFMT */
+ # define stat libc_stat
+ # define stat64 libc_stat64
+@@ -57,10 +57,10 @@
+ # define off_t __kernel_off_t
+ # define loff_t __kernel_loff_t
+ # include <asm/stat.h>
+-# endif /* STAT_FNAME */
++# endif /* STAT_PREFIX */
+ #endif /* _FILE_OFFSET_BITS */
+
+-#ifdef STAT_FNAME
++#ifdef STAT_PREFIX
+
+ static void
+ print_ftype(unsigned int mode)
+@@ -115,7 +115,7 @@ main(int ac, const char **av)
+ assert(stat(av[1], &stb) == 0);
+ #endif
+
+- printf(STAT_FNAME "\\(\"%s\", \\{", av[1]);
++ printf(STAT_PREFIX "\"%s\", \\{", av[1]);
+ printf("st_dev=makedev\\(%u, %u\\)",
+ (unsigned int) major(stb.st_dev),
+ (unsigned int) minor(stb.st_dev));
+@@ -159,11 +159,15 @@ main(int ac, const char **av)
+ printf("(, st_flags=[0-9]+)?");
+ printf("(, st_fstype=[^,]*)?");
+ printf("(, st_gen=[0-9]+)?");
+- printf("\\}\\) += 0\n");
++ printf("\\}");
++#ifndef NR_stat
++ printf("(, 0)?");
++#endif
++ printf("\\) += 0\n");
+ return 0;
+ }
+
+-#else /* !STAT_FNAME */
++#else /* !STAT_PREFIX */
+ int main(void)
+ {
+ return 77;
diff --git a/patches/strace/4.10/005_select_test.patch b/patches/strace/4.10/005_select_test.patch
new file mode 100644
index 0000000..cb56ec6
--- /dev/null
+++ b/patches/strace/4.10/005_select_test.patch
@@ -0,0 +1,48 @@
+commit 95336102eb836ba69a2b51a3bbe733abd63bbe77
+Author: Andreas Schwab <schwab@suse.de>
+Date: Thu Mar 12 16:47:38 2015 +0100
+
+ tests/select.test: handle architectures using pselect6 syscall
+
+ * tests/select.awk (BEGIN): Update regexps to match both select
+ and pselect6 syscalls.
+ * tests/select.test: Probe for both select and pselect6 syscall.
+
+diff --git a/tests/select.awk b/tests/select.awk
+index 142504a..688cefe 100644
+--- a/tests/select.awk
++++ b/tests/select.awk
+@@ -1,7 +1,7 @@
+ BEGIN {
+- r[1] = "^select\\(2, \\[0 1\\], \\[0 1\\], \\[0 1\\], NULL\\) += 1 \\(\\)$"
+- r[2] = "^select\\(-1, NULL, 0x[0-9a-f]+, NULL, NULL\\) += -1 "
+- r[3] = "^select\\(1025, \\[0\\], \\[\\], NULL, \\{0, 100\\}\\) += 0 \\(Timeout\\)$"
++ r[1] = "^p?select6?\\(2, \\[0 1\\], \\[0 1\\], \\[0 1\\], NULL(, 0)?\\) += 1 \\(\\)$"
++ r[2] = "^p?select6?\\(-1, NULL, 0x[0-9a-f]+, NULL, NULL(, 0)?\\) += -1 "
++ r[3] = "^p?select6?\\(1025, \\[0\\], \\[\\], NULL, \\{0, 100(000)?\\}(, 0)?\\) += 0 \\(Timeout\\)$"
+ r[4] = "^\\+\\+\\+ exited with 0 \\+\\+\\+$"
+ lines = 4
+ fail = 0
+diff --git a/tests/select.test b/tests/select.test
+index bd3066b..5d5fe54 100755
+--- a/tests/select.test
++++ b/tests/select.test
+@@ -6,13 +6,16 @@
+
+ check_prog awk
+
+-$STRACE -eselect -h > /dev/null ||
++syscall=
++$STRACE -epselect6 -h > /dev/null && syscall=$syscall,pselect6
++$STRACE -eselect -h > /dev/null && syscall=$syscall,select
++test -n "$syscall" ||
+ skip_ 'select syscall is not supported on this architecture'
+
+ ./select ||
+ framework_skip_ 'select syscall does not behave as expected'
+
+-args='-eselect ./select'
++args="-e$syscall ./select"
+ $STRACE -o "$LOG" $args || {
+ cat "$LOG"
+ fail_ "$STRACE $args failed"
diff --git a/patches/strace/4.10/006_fix_aarch64_ioctl_decoding.patch b/patches/strace/4.10/006_fix_aarch64_ioctl_decoding.patch
new file mode 100644
index 0000000..a270349
--- /dev/null
+++ b/patches/strace/4.10/006_fix_aarch64_ioctl_decoding.patch
@@ -0,0 +1,39 @@
+commit 0e3811d7914f209858cf4e445221fd65644cc94b
+Author: Andreas Schwab <schwab@suse.de>
+Date: Thu Mar 12 18:07:00 2015 +0100
+
+ aarch64: fix ioctl decoding
+
+ * linux/aarch64/ioctls_inc0.h: Rename from ioctls_inc1.h.
+ * linux/aarch64/ioctls_inc1.h: Rename from ioctls_inc0.h.
+ * linux/aarch64/ioctls_arch0.h: Rename from ioctls_arch1.h.
+ * linux/aarch64/ioctls_arch1.h: Rename from ioctls_arch0.h.
+
+diff --git a/linux/aarch64/ioctls_arch0.h b/linux/aarch64/ioctls_arch0.h
+index 6a674cc..b722d22 100644
+--- a/linux/aarch64/ioctls_arch0.h
++++ b/linux/aarch64/ioctls_arch0.h
+@@ -1 +1 @@
+-/* Generated by ioctls_gen.sh from definitions found in $linux/arch/arm64/include/ tree. */
++#include "arm/ioctls_arch0.h"
+diff --git a/linux/aarch64/ioctls_arch1.h b/linux/aarch64/ioctls_arch1.h
+index b722d22..6a674cc 100644
+--- a/linux/aarch64/ioctls_arch1.h
++++ b/linux/aarch64/ioctls_arch1.h
+@@ -1 +1 @@
+-#include "arm/ioctls_arch0.h"
++/* Generated by ioctls_gen.sh from definitions found in $linux/arch/arm64/include/ tree. */
+diff --git a/linux/aarch64/ioctls_inc0.h b/linux/aarch64/ioctls_inc0.h
+index f9939fa..46c11b1 100644
+--- a/linux/aarch64/ioctls_inc0.h
++++ b/linux/aarch64/ioctls_inc0.h
+@@ -1 +1 @@
+-#include "64/ioctls_inc.h"
++#include "arm/ioctls_inc0.h"
+diff --git a/linux/aarch64/ioctls_inc1.h b/linux/aarch64/ioctls_inc1.h
+index 46c11b1..f9939fa 100644
+--- a/linux/aarch64/ioctls_inc1.h
++++ b/linux/aarch64/ioctls_inc1.h
+@@ -1 +1 @@
+-#include "arm/ioctls_inc0.h"
++#include "64/ioctls_inc.h"
diff --git a/patches/strace/4.10/007_fix_bexecve64_test.patch b/patches/strace/4.10/007_fix_bexecve64_test.patch
new file mode 100644
index 0000000..09cd8ad
--- /dev/null
+++ b/patches/strace/4.10/007_fix_bexecve64_test.patch
@@ -0,0 +1,18 @@
+--- a/tests/bexecve.test
++++ b/tests/bexecve.test
+@@ -24,13 +24,14 @@
+ }
+
+ pattern='Process [1-9][0-9]* detached'
++pattern_personality='\[ Process PID=[1-9][0-9]* runs in .* mode. \]'
+
+ LC_ALL=C grep -x "$pattern" "$LOG" > /dev/null || {
+ cat "$LOG"
+ fail_ "$what: unexpected output"
+ }
+
+-if LC_ALL=C grep -v -x "$pattern" "$LOG" > /dev/null; then
++if LC_ALL=C grep -E -v -x "($pattern|$pattern_personality)" "$LOG" > /dev/null; then
+ cat "$LOG"
+ fail_ "$what: unexpected output"
+ fi
diff --git a/patches/strace/4.10/008_decode_mips_indirect_syscall.patch b/patches/strace/4.10/008_decode_mips_indirect_syscall.patch
new file mode 100644
index 0000000..de0004c
--- /dev/null
+++ b/patches/strace/4.10/008_decode_mips_indirect_syscall.patch
@@ -0,0 +1,64 @@
+Index: strace-4.10/linux/mips/syscallent-o32.h
+===================================================================
+--- strace-4.10.orig/linux/mips/syscallent-o32.h
++++ strace-4.10/linux/mips/syscallent-o32.h
+@@ -1,6 +1,6 @@
+ #if defined LINUX_MIPSO32
+ /* For an O32 strace, decode the o32 syscalls. */
+-[4000] = { MA, 0, printargs, "syscall" }, /* start of Linux o32 */
++[4000] = { MA, 0, sys_syscall, "syscall" }, /* start of Linux o32 */
+ [4001] = { 1, TP|SE, sys_exit, "exit" },
+ [4002] = { 0, TP, sys_fork, "fork" },
+ [4003] = { 3, TD, sys_read, "read" },
+Index: strace-4.10/syscall.c
+===================================================================
+--- strace-4.10.orig/syscall.c
++++ strace-4.10/syscall.c
+@@ -606,6 +606,25 @@ decode_ipc_subcall(struct tcb *tcp)
+ }
+ #endif
+
++#ifdef LINUX_MIPSO32
++static void
++decode_mips_subcall(struct tcb *tcp)
++{
++ if (!SCNO_IS_VALID(tcp->u_arg[0]))
++ return;
++ tcp->scno = tcp->u_arg[0];
++ tcp->qual_flg = qual_flags[tcp->scno];
++ tcp->s_ent = &sysent[tcp->scno];
++ memmove(&tcp->u_arg[0], &tcp->u_arg[1],
++ sizeof(tcp->u_arg) - sizeof(tcp->u_arg[0]));
++}
++
++int sys_syscall(struct tcb *tcp)
++{
++ return printargs(tcp);
++}
++#endif
++
+ int
+ printargs(struct tcb *tcp)
+ {
+@@ -1774,6 +1793,11 @@ trace_syscall_entering(struct tcb *tcp)
+ goto ret;
+ }
+
++#ifdef LINUX_MIPSO32
++ if (sys_syscall == tcp->s_ent->sys_func)
++ decode_mips_subcall(tcp);
++#endif
++
+ if ( sys_execve == tcp->s_ent->sys_func
+ # if defined(SPARC) || defined(SPARC64)
+ || sys_execv == tcp->s_ent->sys_func
+--- strace-4.10.orig/linux/syscall.h 2015-02-06 01:23:05.000000000 +0000
++++ strace-4.10/linux/syscall.h 2015-07-09 14:36:49.372494628 +0100
+@@ -277,6 +277,7 @@
+ int sys_symlinkat();
+ int sys_sync_file_range();
+ int sys_sync_file_range2();
++int sys_syscall();
+ int sys_sysctl();
+ int sys_sysinfo();
+ int sys_syslog();