summaryrefslogtreecommitdiff
path: root/patches/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'patches/gcc')
-rw-r--r--patches/gcc/4.9.3/840-microblaze-enable-dwarf-eh-support.patch169
-rw-r--r--patches/gcc/4.9.3/850-libstdcxx-uclibc-c99.patch255
-rw-r--r--patches/gcc/4.9.3/920-libgcc-remove-unistd-header.patch12
-rw-r--r--patches/gcc/4.9.4/001-gcc_bug_62231.patch (renamed from patches/gcc/4.9.3/001_gcc_bug_62231.patch)0
-rw-r--r--patches/gcc/4.9.4/002-gcc_bug_62231.patch (renamed from patches/gcc/4.9.3/002_gcc_bug_62231.patch)0
-rw-r--r--patches/gcc/4.9.4/100-uclibc-conf.patch (renamed from patches/gcc/4.9.3/100-uclibc-conf.patch)0
-rw-r--r--patches/gcc/4.9.4/1000-powerpc-link-with-math-lib.patch.conditional (renamed from patches/gcc/4.9.3/1000-powerpc-link-with-math-lib.patch.conditional)28
-rw-r--r--patches/gcc/4.9.4/111-pr65730.patch (renamed from patches/gcc/4.9.3/111-pr65730.patch)9
-rw-r--r--patches/gcc/4.9.4/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch26
-rw-r--r--patches/gcc/4.9.4/130-pr43538.patch (renamed from patches/gcc/4.9.3/130-pr43538.patch)0
-rw-r--r--patches/gcc/4.9.4/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch (renamed from patches/gcc/4.9.3/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch)0
-rw-r--r--patches/gcc/4.9.4/140-sanitizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch37
-rw-r--r--patches/gcc/4.9.4/301-missing-execinfo_h.patch (renamed from patches/gcc/4.9.3/301-missing-execinfo_h.patch)0
-rw-r--r--patches/gcc/4.9.4/810-arm-softfloat-libgcc.patch (renamed from patches/gcc/6.1.0/810-arm-softfloat-libgcc.patch)0
-rw-r--r--patches/gcc/4.9.4/830-arm_unbreak_armv4t.patch (renamed from patches/gcc/4.9.3/830-arm_unbreak_armv4t.patch)0
-rw-r--r--patches/gcc/4.9.4/840-microblaze-enable-dwarf-eh-support.patch (renamed from patches/gcc/6.1.0/840-microblaze-enable-dwarf-eh-support.patch)14
-rw-r--r--patches/gcc/4.9.4/850-libstdcxx-uclibc-c99.patch274
-rw-r--r--patches/gcc/4.9.4/860-cilk-wchar.patch (renamed from patches/gcc/4.9.3/860-cilk-wchar.patch)0
-rw-r--r--patches/gcc/4.9.4/870-xtensa-add-mauto-litpools-option.patch (renamed from patches/gcc/4.9.3/870-xtensa-add-mauto-litpools-option.patch)61
-rw-r--r--patches/gcc/4.9.4/871-xtensa-reimplement-register-spilling.patch (renamed from patches/gcc/4.9.3/871-xtensa-reimplement-register-spilling.patch)0
-rw-r--r--patches/gcc/4.9.4/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch (renamed from patches/gcc/4.9.3/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch)0
-rw-r--r--patches/gcc/4.9.4/873-xtensa-fix-_Unwind_GetCFA.patch (renamed from patches/gcc/4.9.3/873-xtensa-fix-_Unwind_GetCFA.patch)0
-rw-r--r--patches/gcc/4.9.4/874-xtensa-add-uclinux-support.patch169
-rw-r--r--patches/gcc/4.9.4/880-nios2_legitimize_address.patch49
-rw-r--r--patches/gcc/4.9.4/890-fix-m68k-compile.patch15
-rw-r--r--patches/gcc/4.9.4/891-fix-m68k-uclinux.patch18
-rw-r--r--patches/gcc/4.9.4/900-musl-support.patch (renamed from patches/gcc/4.9.3/900-musl-support.patch)16
-rw-r--r--patches/gcc/4.9.4/901-microblaze-uclibc.patch21
-rw-r--r--patches/gcc/4.9.4/930-libgcc-disable-split-stack-nothreads.patch14
-rw-r--r--patches/gcc/4.9.4/940-uclinux-enable-threads.patch20
-rw-r--r--patches/gcc/5.4.0/875-xtensa-fix-xtensa_fallback_frame_state-for-call0-ABI.patch108
-rw-r--r--patches/gcc/5.4.0/876-xtensa-fix-libgcc-build-with-text-section-literals.patch67
-rw-r--r--patches/gcc/5.4.0/877-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch62
-rw-r--r--patches/gcc/5.4.0/878-xtensa-Fix-PR-target-78603.patch35
-rw-r--r--patches/gcc/6.2.0/100-uclibc-conf.patch (renamed from patches/gcc/6.1.0/100-uclibc-conf.patch)0
-rw-r--r--patches/gcc/6.2.0/301-missing-execinfo_h.patch (renamed from patches/gcc/6.1.0/301-missing-execinfo_h.patch)0
-rw-r--r--patches/gcc/6.2.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch (renamed from patches/gcc/6.1.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch)0
-rw-r--r--patches/gcc/6.2.0/380-gcc-plugin-POSIX-include-sys-select-h.patch (renamed from patches/gcc/6.1.0/380-gcc-plugin-POSIX-include-sys-select-h.patch)0
-rw-r--r--patches/gcc/6.2.0/810-arm-softfloat-libgcc.patch (renamed from patches/gcc/4.9.3/810-arm-softfloat-libgcc.patch)14
-rw-r--r--patches/gcc/6.2.0/830-arm_unbreak_armv4t.patch (renamed from patches/gcc/6.1.0/830-arm_unbreak_armv4t.patch)0
-rw-r--r--patches/gcc/6.2.0/831-ARM-PR-target-70473-Reduce-size-of-Cortex-A8-automat.patch69
-rw-r--r--patches/gcc/6.2.0/860-cilk-wchar.patch (renamed from patches/gcc/6.1.0/860-cilk-wchar.patch)0
-rw-r--r--patches/gcc/6.2.0/870-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch62
-rw-r--r--patches/gcc/6.2.0/871-xtensa-Fix-PR-target-78118.patch318
-rw-r--r--patches/gcc/6.2.0/872-xtensa-Fix-PR-target-78603.patch35
-rw-r--r--patches/gcc/6.2.0/890-fix-m68k-compile.patch15
-rw-r--r--patches/gcc/6.2.0/891-fix-m68k-uclinux.patch18
-rw-r--r--patches/gcc/6.2.0/892-libgcc-mkmap-symver-support-skip_underscore.patch60
-rw-r--r--patches/gcc/6.2.0/893-libgcc-config-bfin-use-the-generic-linker-version-in.patch1944
-rw-r--r--patches/gcc/6.2.0/894-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch59
-rw-r--r--patches/gcc/6.2.0/895-bfin-define-REENTRANT.patch17
-rw-r--r--patches/gcc/6.2.0/910-nios2-bad-multilib-default.patch28
-rw-r--r--patches/gcc/6.2.0/930-libgcc-disable-split-stack-nothreads.patch14
-rw-r--r--patches/gcc/6.2.0/940-uclinux-enable-threads.patch19
54 files changed, 3641 insertions, 510 deletions
diff --git a/patches/gcc/4.9.3/840-microblaze-enable-dwarf-eh-support.patch b/patches/gcc/4.9.3/840-microblaze-enable-dwarf-eh-support.patch
deleted file mode 100644
index e116e2b..0000000
--- a/patches/gcc/4.9.3/840-microblaze-enable-dwarf-eh-support.patch
+++ /dev/null
@@ -1,169 +0,0 @@
-Fetched from Xilinx gcc git at https://github.com/Xilinx/gcc
-
-From 23c35173490ac2d6348a668dfc9c1a6eb62171f2 Mon Sep 17 00:00:00 2001
-From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
-Date: Mon, 18 Jun 2012 20:18:13 +0200
-Subject: [PATCH] [Patch, microblaze]: Enable DWARF exception handling support.
-
-Changelog
-
-2013-03-18 Edgar E. Iglesias <edgar.iglesias@xilinx.com>
- David Holsgrove <david.holsgrove@xilinx.com>
-
- * common/config/microblaze/microblaze-common.c: Remove
- TARGET_EXCEPT_UNWIND_INFO definition.
- * config/microblaze/microblaze-protos.h: Add
- microblaze_eh_return prototype.
- * gcc/config/microblaze/microblaze.c: (microblaze_must_save_register,
- microblaze_expand_epilogue, microblaze_return_addr): Handle
- calls_eh_return
- (microblaze_eh_return): New function.
- * gcc/config/microblaze/microblaze.h: Define RETURN_ADDR_OFFSET,
- EH_RETURN_DATA_REGNO, MB_EH_STACKADJ_REGNUM, EH_RETURN_STACKADJ_RTX,
- ASM_PREFERRED_EH_DATA_FORMAT
- * gcc/config/microblaze/microblaze.md: Define eh_return pattern.
-
-Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
-Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
----
- gcc/common/config/microblaze/microblaze-common.c | 3 ---
- gcc/config/microblaze/microblaze-protos.h | 1 +
- gcc/config/microblaze/microblaze.c | 29 ++++++++++++++++++++----
- gcc/config/microblaze/microblaze.h | 15 ++++++++++++
- gcc/config/microblaze/microblaze.md | 11 +++++++++
- 5 files changed, 52 insertions(+), 7 deletions(-)
-
-diff --git a/gcc/common/config/microblaze/microblaze-common.c b/gcc/common/config/microblaze/microblaze-common.c
-index 5835acc..85e6a53 100644
---- a/gcc/common/config/microblaze/microblaze-common.c
-+++ b/gcc/common/config/microblaze/microblaze-common.c
-@@ -39,7 +39,4 @@ static const struct default_options microblaze_option_optimization_table[] =
- #undef TARGET_OPTION_OPTIMIZATION_TABLE
- #define TARGET_OPTION_OPTIMIZATION_TABLE microblaze_option_optimization_table
-
--#undef TARGET_EXCEPT_UNWIND_INFO
--#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
--
- struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
-diff --git a/gcc/config/microblaze/microblaze-protos.h b/gcc/config/microblaze/microblaze-protos.h
-index c30ec72..260f4e4 100644
---- a/gcc/config/microblaze/microblaze-protos.h
-+++ b/gcc/config/microblaze/microblaze-protos.h
-@@ -56,6 +56,7 @@ extern bool microblaze_tls_referenced_p (rtx);
- extern int symbol_mentioned_p (rtx);
- extern int label_mentioned_p (rtx);
- extern bool microblaze_cannot_force_const_mem (enum machine_mode, rtx);
-+extern void microblaze_eh_return (rtx op0);
- #endif /* RTX_CODE */
-
- /* Declare functions in microblaze-c.c. */
-diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
-index fe61fce..15166d3 100644
---- a/gcc/config/microblaze/microblaze.c
-+++ b/gcc/config/microblaze/microblaze.c
-@@ -1999,6 +1999,11 @@ microblaze_must_save_register (int regno)
- if (frame_pointer_needed && (regno == HARD_FRAME_POINTER_REGNUM))
- return 1;
-
-+ if (crtl->calls_eh_return
-+ && regno == MB_ABI_SUB_RETURN_ADDR_REGNUM) {
-+ return 1;
-+ }
-+
- if (!crtl->is_leaf)
- {
- if (regno == MB_ABI_SUB_RETURN_ADDR_REGNUM)
-@@ -2026,6 +2031,13 @@ microblaze_must_save_register (int regno)
- return 1;
- }
-
-+ if (crtl->calls_eh_return
-+ && (regno == EH_RETURN_DATA_REGNO (0)
-+ || regno == EH_RETURN_DATA_REGNO (1)))
-+ {
-+ return 1;
-+ }
-+
- return 0;
- }
-
-@@ -3131,6 +3143,12 @@ microblaze_expand_epilogue (void)
- emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, fsiz_rtx));
- }
-
-+ if (crtl->calls_eh_return)
-+ emit_insn (gen_addsi3 (stack_pointer_rtx,
-+ stack_pointer_rtx,
-+ gen_rtx_raw_REG (SImode,
-+ MB_EH_STACKADJ_REGNUM)));
-+
- emit_jump_insn (gen_return_internal (gen_rtx_REG (Pmode, GP_REG_FIRST +
- MB_ABI_SUB_RETURN_ADDR_REGNUM)));
- }
-@@ -3427,10 +3445,13 @@ microblaze_return_addr (int count, rtx frame ATTRIBUTE_UNUSED)
- if (count != 0)
- return NULL_RTX;
-
-- return gen_rtx_PLUS (Pmode,
-- get_hard_reg_initial_val (Pmode,
-- MB_ABI_SUB_RETURN_ADDR_REGNUM),
-- GEN_INT (8));
-+ return get_hard_reg_initial_val (Pmode,
-+ MB_ABI_SUB_RETURN_ADDR_REGNUM);
-+}
-+
-+void microblaze_eh_return (rtx op0)
-+{
-+ emit_insn (gen_movsi(gen_rtx_MEM(Pmode, stack_pointer_rtx), op0));
- }
-
- /* Queue an .ident string in the queue of top-level asm statements.
-diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
-index 4072283..5e9f49c 100644
---- a/gcc/config/microblaze/microblaze.h
-+++ b/gcc/config/microblaze/microblaze.h
-@@ -184,6 +184,21 @@ extern enum pipeline_type microblaze_pipe;
- #define INCOMING_RETURN_ADDR_RTX \
- gen_rtx_REG (VOIDmode, GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM)
-
-+/* Specifies the offset from INCOMING_RETURN_ADDR_RTX and the actual return PC. */
-+#define RETURN_ADDR_OFFSET (8)
-+
-+/* Describe how we implement __builtin_eh_return. */
-+#define EH_RETURN_DATA_REGNO(N) (((N) < 2) ? MB_ABI_FIRST_ARG_REGNUM + (N) : INVALID_REGNUM)
-+
-+#define MB_EH_STACKADJ_REGNUM MB_ABI_INT_RETURN_VAL2_REGNUM
-+#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, MB_EH_STACKADJ_REGNUM)
-+
-+/* Select a format to encode pointers in exception handling data. CODE
-+ is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
-+ true if the symbol may be affected by dynamic relocations. */
-+#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
-+ ((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr)
-+
- /* Use DWARF 2 debugging information by default. */
- #define DWARF2_DEBUGGING_INFO
- #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
-diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
-index ed6131a..dc2405f 100644
---- a/gcc/config/microblaze/microblaze.md
-+++ b/gcc/config/microblaze/microblaze.md
-@@ -2327,4 +2327,15 @@
- (set_attr "mode" "SI")
- (set_attr "length" "4")])
-
-+; This is used in compiling the unwind routines.
-+(define_expand "eh_return"
-+ [(use (match_operand 0 "general_operand" ""))]
-+ ""
-+ "
-+{
-+ microblaze_eh_return(operands[0]);
-+ DONE;
-+}")
-+
- (include "sync.md")
-+
---
-1.8.3.2
-
diff --git a/patches/gcc/4.9.3/850-libstdcxx-uclibc-c99.patch b/patches/gcc/4.9.3/850-libstdcxx-uclibc-c99.patch
deleted file mode 100644
index d103af1..0000000
--- a/patches/gcc/4.9.3/850-libstdcxx-uclibc-c99.patch
+++ /dev/null
@@ -1,255 +0,0 @@
-Allow C99-depending features of libstdc++ with uClibc
-
-The libstdc++ code is fairly restrictive on how it checks for C99
-compatibility: it requires *complete* C99 support to enable certain
-features. For example, uClibc provides a good number of C99 features,
-but not C99 complex number support. For this reason, libstdc++
-completely disables many the standard C++ methods that can in fact
-work because uClibc provides the necessary functions.
-
-This patch is similar and highly inspired from
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58393, but implemented in
-a way that doesn't involve changing the configure.ac script, as
-autoreconfiguring gcc is complicated. It simply relies on the fact
-that uClibc defines the __UCLIBC__ definition.
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-[Gustavo: update for 4.9.3]
-
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/config/locale/generic/c_locale.h gcc-4.9.3/libstdc++-v3/config/locale/generic/c_locale.h
---- gcc-4.9.3.orig/libstdc++-v3/config/locale/generic/c_locale.h 2014-01-02 19:30:10.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/config/locale/generic/c_locale.h 2015-06-27 06:46:04.420022179 -0300
-@@ -70,7 +70,7 @@
- __builtin_va_list __args;
- __builtin_va_start(__args, __fmt);
-
--#ifdef _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
- const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
- #else
- const int __ret = __builtin_vsprintf(__out, __fmt, __args);
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/config/locale/gnu/c_locale.h gcc-4.9.3/libstdc++-v3/config/locale/gnu/c_locale.h
---- gcc-4.9.3.orig/libstdc++-v3/config/locale/gnu/c_locale.h 2014-01-02 19:30:10.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/config/locale/gnu/c_locale.h 2015-06-27 06:46:04.465023743 -0300
-@@ -88,7 +88,7 @@
- __builtin_va_list __args;
- __builtin_va_start(__args, __fmt);
-
--#ifdef _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
- const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
- #else
- const int __ret = __builtin_vsprintf(__out, __fmt, __args);
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/bits/basic_string.h gcc-4.9.3/libstdc++-v3/include/bits/basic_string.h
---- gcc-4.9.3.orig/libstdc++-v3/include/bits/basic_string.h 2015-05-28 13:27:46.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/include/bits/basic_string.h 2015-06-27 06:49:04.741284648 -0300
-@@ -2844,7 +2844,7 @@
- _GLIBCXX_END_NAMESPACE_VERSION
- } // namespace
-
--#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99)
-+#if __cplusplus >= 201103L && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__))
-
- #include <ext/string_conversions.h>
-
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/bits/locale_facets_nonio.tcc gcc-4.9.3/libstdc++-v3/include/bits/locale_facets_nonio.tcc
---- gcc-4.9.3.orig/libstdc++-v3/include/bits/locale_facets_nonio.tcc 2014-01-02 19:30:10.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/include/bits/locale_facets_nonio.tcc 2015-06-27 06:46:04.466023777 -0300
-@@ -572,7 +572,7 @@
- {
- const locale __loc = __io.getloc();
- const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
--#ifdef _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
- // First try a buffer perhaps big enough.
- int __cs_size = 64;
- char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/bits/locale_facets.tcc gcc-4.9.3/libstdc++-v3/include/bits/locale_facets.tcc
---- gcc-4.9.3.orig/libstdc++-v3/include/bits/locale_facets.tcc 2014-01-02 19:30:10.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/include/bits/locale_facets.tcc 2015-06-27 06:46:04.466023777 -0300
-@@ -987,7 +987,7 @@
- char __fbuf[16];
- __num_base::_S_format_float(__io, __fbuf, __mod);
-
--#ifdef _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
- // First try a buffer perhaps big enough (most probably sufficient
- // for non-ios_base::fixed outputs)
- int __cs_size = __max_digits * 3;
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_compatibility/math.h gcc-4.9.3/libstdc++-v3/include/c_compatibility/math.h
---- gcc-4.9.3.orig/libstdc++-v3/include/c_compatibility/math.h 2014-01-02 19:30:10.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/include/c_compatibility/math.h 2015-06-27 06:46:04.466023777 -0300
-@@ -56,7 +56,7 @@
- using std::floor;
- using std::fmod;
-
--#if _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
- using std::fpclassify;
- using std::isfinite;
- using std::isinf;
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.9.3/libstdc++-v3/include/c_compatibility/wchar.h
---- gcc-4.9.3.orig/libstdc++-v3/include/c_compatibility/wchar.h 2014-01-02 19:30:10.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/include/c_compatibility/wchar.h 2015-06-27 06:46:04.466023777 -0300
-@@ -103,7 +103,7 @@
- using std::wmemset;
- using std::wcsftime;
-
--#if _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
- using std::wcstold;
- using std::wcstoll;
- using std::wcstoull;
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_global/cstdio gcc-4.9.3/libstdc++-v3/include/c_global/cstdio
---- gcc-4.9.3.orig/libstdc++-v3/include/c_global/cstdio 2014-01-23 18:17:15.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/include/c_global/cstdio 2015-06-27 06:46:04.481024298 -0300
-@@ -146,7 +146,7 @@
- using ::vsprintf;
- } // namespace
-
--#if _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
-
- #undef snprintf
- #undef vfscanf
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_global/cstdlib gcc-4.9.3/libstdc++-v3/include/c_global/cstdlib
---- gcc-4.9.3.orig/libstdc++-v3/include/c_global/cstdlib 2014-01-02 19:30:10.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/include/c_global/cstdlib 2015-06-27 06:46:04.466023777 -0300
-@@ -182,7 +182,7 @@
- _GLIBCXX_END_NAMESPACE_VERSION
- } // namespace
-
--#if _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
-
- #undef _Exit
- #undef llabs
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_global/cwchar gcc-4.9.3/libstdc++-v3/include/c_global/cwchar
---- gcc-4.9.3.orig/libstdc++-v3/include/c_global/cwchar 2014-01-02 19:30:10.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/include/c_global/cwchar 2015-06-27 06:46:04.466023777 -0300
-@@ -232,7 +232,7 @@
- _GLIBCXX_END_NAMESPACE_VERSION
- } // namespace
-
--#if _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
-
- #undef wcstold
- #undef wcstoll
-@@ -289,7 +289,7 @@
- using std::vwscanf;
- #endif
-
--#if _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
- using std::wcstold;
- using std::wcstoll;
- using std::wcstoull;
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_std/cstdio gcc-4.9.3/libstdc++-v3/include/c_std/cstdio
---- gcc-4.9.3.orig/libstdc++-v3/include/c_std/cstdio 2014-01-02 19:30:10.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/include/c_std/cstdio 2015-06-27 06:46:04.480024263 -0300
-@@ -144,7 +144,7 @@
- using ::vsprintf;
- } // namespace std
-
--#if _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
-
- #undef snprintf
- #undef vfscanf
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_std/cstdlib gcc-4.9.3/libstdc++-v3/include/c_std/cstdlib
---- gcc-4.9.3.orig/libstdc++-v3/include/c_std/cstdlib 2014-01-02 19:30:10.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/include/c_std/cstdlib 2015-06-27 06:46:04.480024263 -0300
-@@ -180,7 +180,7 @@
- _GLIBCXX_END_NAMESPACE_VERSION
- } // namespace
-
--#if _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
-
- #undef _Exit
- #undef llabs
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_std/cwchar gcc-4.9.3/libstdc++-v3/include/c_std/cwchar
---- gcc-4.9.3.orig/libstdc++-v3/include/c_std/cwchar 2014-01-02 19:30:10.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/include/c_std/cwchar 2015-06-27 06:46:04.480024263 -0300
-@@ -228,7 +228,7 @@
- _GLIBCXX_END_NAMESPACE_VERSION
- } // namespace
-
--#if _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
-
- #undef wcstold
- #undef wcstoll
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/ext/vstring.h gcc-4.9.3/libstdc++-v3/include/ext/vstring.h
---- gcc-4.9.3.orig/libstdc++-v3/include/ext/vstring.h 2014-01-02 19:30:10.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/include/ext/vstring.h 2015-06-27 06:46:04.480024263 -0300
-@@ -2680,7 +2680,7 @@
- _GLIBCXX_END_NAMESPACE_VERSION
- } // namespace
-
--#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99))
-+#if ((__cplusplus >= 201103L) && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)))
-
- #include <ext/string_conversions.h>
-
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/tr1/cstdio gcc-4.9.3/libstdc++-v3/include/tr1/cstdio
---- gcc-4.9.3.orig/libstdc++-v3/include/tr1/cstdio 2014-01-02 19:30:10.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/include/tr1/cstdio 2015-06-27 06:46:04.480024263 -0300
-@@ -33,7 +33,7 @@
-
- #include <cstdio>
-
--#if _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
-
- namespace std _GLIBCXX_VISIBILITY(default)
- {
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/tr1/cstdlib gcc-4.9.3/libstdc++-v3/include/tr1/cstdlib
---- gcc-4.9.3.orig/libstdc++-v3/include/tr1/cstdlib 2014-01-02 19:30:10.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/include/tr1/cstdlib 2015-06-27 06:46:04.480024263 -0300
-@@ -35,7 +35,7 @@
-
- #if _GLIBCXX_HOSTED
-
--#if _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
-
- namespace std _GLIBCXX_VISIBILITY(default)
- {
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/tr1/cwchar gcc-4.9.3/libstdc++-v3/include/tr1/cwchar
---- gcc-4.9.3.orig/libstdc++-v3/include/tr1/cwchar 2014-01-02 19:30:10.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/include/tr1/cwchar 2015-06-27 06:46:04.480024263 -0300
-@@ -52,7 +52,7 @@
- using std::vwscanf;
- #endif
-
--#if _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
- using std::wcstold;
- using std::wcstoll;
- using std::wcstoull;
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/tr1/stdlib.h gcc-4.9.3/libstdc++-v3/include/tr1/stdlib.h
---- gcc-4.9.3.orig/libstdc++-v3/include/tr1/stdlib.h 2014-01-02 19:30:10.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/include/tr1/stdlib.h 2015-06-27 06:46:04.481024298 -0300
-@@ -33,7 +33,7 @@
-
- #if _GLIBCXX_HOSTED
-
--#if _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
-
- using std::tr1::atoll;
- using std::tr1::strtoll;
-diff -Nura gcc-4.9.3.orig/libstdc++-v3/src/c++11/debug.cc gcc-4.9.3/libstdc++-v3/src/c++11/debug.cc
---- gcc-4.9.3.orig/libstdc++-v3/src/c++11/debug.cc 2014-01-02 19:30:10.000000000 -0300
-+++ gcc-4.9.3/libstdc++-v3/src/c++11/debug.cc 2015-06-27 06:46:04.481024298 -0300
-@@ -788,7 +788,7 @@
- int __n __attribute__ ((__unused__)),
- const char* __fmt, _Tp __s) const throw ()
- {
--#ifdef _GLIBCXX_USE_C99
-+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
- std::snprintf(__buf, __n, __fmt, __s);
- #else
- std::sprintf(__buf, __fmt, __s);
diff --git a/patches/gcc/4.9.3/920-libgcc-remove-unistd-header.patch b/patches/gcc/4.9.3/920-libgcc-remove-unistd-header.patch
deleted file mode 100644
index df5372b..0000000
--- a/patches/gcc/4.9.3/920-libgcc-remove-unistd-header.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-Upstream status: In progress
-
---- a/libgcc/config/nios2/linux-atomic.c
-+++ b/libgcc/config/nios2/linux-atomic.c
-@@ -20,7 +20,6 @@
- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
- <http://www.gnu.org/licenses/>. */
-
--#include <asm/unistd.h>
- #define EFAULT 14
- #define EBUSY 16
- #define ENOSYS 38
diff --git a/patches/gcc/4.9.3/001_gcc_bug_62231.patch b/patches/gcc/4.9.4/001-gcc_bug_62231.patch
index e7c9cf9..e7c9cf9 100644
--- a/patches/gcc/4.9.3/001_gcc_bug_62231.patch
+++ b/patches/gcc/4.9.4/001-gcc_bug_62231.patch
diff --git a/patches/gcc/4.9.3/002_gcc_bug_62231.patch b/patches/gcc/4.9.4/002-gcc_bug_62231.patch
index b970ebc..b970ebc 100644
--- a/patches/gcc/4.9.3/002_gcc_bug_62231.patch
+++ b/patches/gcc/4.9.4/002-gcc_bug_62231.patch
diff --git a/patches/gcc/4.9.3/100-uclibc-conf.patch b/patches/gcc/4.9.4/100-uclibc-conf.patch
index d56bf0a..d56bf0a 100644
--- a/patches/gcc/4.9.3/100-uclibc-conf.patch
+++ b/patches/gcc/4.9.4/100-uclibc-conf.patch
diff --git a/patches/gcc/4.9.3/1000-powerpc-link-with-math-lib.patch.conditional b/patches/gcc/4.9.4/1000-powerpc-link-with-math-lib.patch.conditional
index b7094fe..5e0484f 100644
--- a/patches/gcc/4.9.3/1000-powerpc-link-with-math-lib.patch.conditional
+++ b/patches/gcc/4.9.4/1000-powerpc-link-with-math-lib.patch.conditional
@@ -14,19 +14,19 @@ Forward port to gcc 4.5.1 by Gustavo Zacarias <gustavo@zacarias.com.ar>
libgcc/configure.ac | 21 +++++++++++++++++++++
3 files changed, 56 insertions(+), 1 deletion(-)
-Index: gcc-4.8.0/libgcc/Makefile.in
+Index: b/libgcc/Makefile.in
===================================================================
---- gcc-4.8.0.orig/libgcc/Makefile.in 2013-02-04 20:06:20.000000000 +0100
-+++ gcc-4.8.0/libgcc/Makefile.in 2013-03-24 09:12:43.000000000 +0100
-@@ -41,6 +41,7 @@
- decimal_float = @decimal_float@
+--- a/libgcc/Makefile.in
++++ b/libgcc/Makefile.in
+@@ -42,6 +42,7 @@
+ enable_vtable_verify = @enable_vtable_verify@
enable_decimal_float = @enable_decimal_float@
fixed_point = @fixed_point@
+LIBGCC_LIBM = @LIBGCC_LIBM@
host_noncanonical = @host_noncanonical@
target_noncanonical = @target_noncanonical@
-@@ -927,9 +928,10 @@
+@@ -943,9 +944,10 @@
@multilib_dir@,$(MULTIDIR),$(subst \
@shlib_objs@,$(objects) libgcc.a,$(subst \
@shlib_base_name@,libgcc_s,$(subst \
@@ -38,10 +38,10 @@ Index: gcc-4.8.0/libgcc/Makefile.in
libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
# @multilib_flags@ is still needed because this may use
-Index: gcc-4.8.0/libgcc/configure
+Index: b/libgcc/configure
===================================================================
---- gcc-4.8.0.orig/libgcc/configure 2012-11-05 00:08:42.000000000 +0100
-+++ gcc-4.8.0/libgcc/configure 2013-03-24 09:12:43.000000000 +0100
+--- a/libgcc/configure
++++ b/libgcc/configure
@@ -564,6 +564,7 @@
tmake_file
sfp_machine_header
@@ -50,7 +50,7 @@ Index: gcc-4.8.0/libgcc/configure
set_have_cc_tls
vis_hide
fixed_point
-@@ -4481,6 +4482,37 @@
+@@ -4535,6 +4536,37 @@
fi
fi
@@ -88,11 +88,11 @@ Index: gcc-4.8.0/libgcc/configure
# Conditionalize the makefile for this target machine.
tmake_file_=
-Index: gcc-4.8.0/libgcc/configure.ac
+Index: b/libgcc/configure.ac
===================================================================
---- gcc-4.8.0.orig/libgcc/configure.ac 2012-10-15 15:10:30.000000000 +0200
-+++ gcc-4.8.0/libgcc/configure.ac 2013-03-24 09:12:43.000000000 +0100
-@@ -326,6 +326,27 @@
+--- a/libgcc/configure.ac
++++ b/libgcc/configure.ac
+@@ -357,6 +357,27 @@
fi
AC_SUBST(set_have_cc_tls)
diff --git a/patches/gcc/4.9.3/111-pr65730.patch b/patches/gcc/4.9.4/111-pr65730.patch
index f195e30..8a41fd2 100644
--- a/patches/gcc/4.9.3/111-pr65730.patch
+++ b/patches/gcc/4.9.4/111-pr65730.patch
@@ -16,11 +16,11 @@ Changes to ChangeLog are dropped.
gcc/config/xtensa/xtensa.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
-diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
-index eb039ba..7296e36 100644
+Index: b/gcc/config/xtensa/xtensa.c
+===================================================================
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
-@@ -1461,8 +1461,9 @@ init_alignment_context (struct alignment_context *ac, rtx mem)
+@@ -1436,8 +1436,9 @@
if (ac->shift != NULL_RTX)
{
/* Shift is the byte count, but we need the bitcount. */
@@ -32,6 +32,3 @@ index eb039ba..7296e36 100644
NULL_RTX, 1, OPTAB_DIRECT);
ac->modemask = expand_simple_binop (SImode, ASHIFT,
GEN_INT (GET_MODE_MASK (mode)),
---
-1.8.1.4
-
diff --git a/patches/gcc/4.9.4/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch b/patches/gcc/4.9.4/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch
new file mode 100644
index 0000000..bb77c4b
--- /dev/null
+++ b/patches/gcc/4.9.4/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch
@@ -0,0 +1,26 @@
+From 9bf6066d588632dab9f78932df15b5b4140f31f3 Mon Sep 17 00:00:00 2001
+From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
+Date: Fri, 6 Nov 2015 14:27:23 +0100
+Subject: [PATCH] gcc/config.gcc: fix typo for powerpc e6500 cpu_is_64bit
+
+Otherwise it is not recognized as a 64-bit powerpc and gcc will not generate
+64-bit binaries by default.
+
+Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
+---
+ gcc/config.gcc | 2 +-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+Index: b/gcc/config.gcc
+===================================================================
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -441,7 +441,7 @@
+ extra_headers="ppc-asm.h altivec.h spe.h ppu_intrinsics.h paired.h spu2vmx.h vec_types.h si2vmx.h htmintrin.h htmxlintrin.h"
+ need_64bit_hwint=yes
+ case x$with_cpu in
+- xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345678]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|Xe6500)
++ xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345678]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|xe6500)
+ cpu_is_64bit=yes
+ ;;
+ esac
diff --git a/patches/gcc/4.9.3/130-pr43538.patch b/patches/gcc/4.9.4/130-pr43538.patch
index 19e57bb..19e57bb 100644
--- a/patches/gcc/4.9.3/130-pr43538.patch
+++ b/patches/gcc/4.9.4/130-pr43538.patch
diff --git a/patches/gcc/4.9.3/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch b/patches/gcc/4.9.4/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch
index 1c49fb0..1c49fb0 100644
--- a/patches/gcc/4.9.3/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch
+++ b/patches/gcc/4.9.4/131-mt-ospace-preserve-FLAGS_FOR_TARGET.patch
diff --git a/patches/gcc/4.9.4/140-sanitizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch b/patches/gcc/4.9.4/140-sanitizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch
new file mode 100644
index 0000000..55f3228
--- /dev/null
+++ b/patches/gcc/4.9.4/140-sanitizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch
@@ -0,0 +1,37 @@
+From 3c536954a67a883630f4a7513a27f02a892c3dcb Mon Sep 17 00:00:00 2001
+From: Evgeniy Stepanov <eugeni.stepanov@gmail.com>
+Date: Tue, 21 Oct 2014 21:08:13 +0000
+Subject: [PATCH] [sanitizer] Fix build with _FILE_OFFSET_BITS=64.
+
+Sanitizer source is not affected by _FILE_OFFSET_BITS in general,
+but this one file must be built with 32-bit off_t. More details in the code.
+
+git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220328 91177308-0d34-0410-b5e6-96231b3b80d8
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ lib/sanitizer_common/sanitizer_platform_limits_posix.cc | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
+index bbc1108..fc09522 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
+@@ -13,7 +13,15 @@
+
+ #include "sanitizer_platform.h"
+ #if SANITIZER_LINUX || SANITIZER_MAC
++// Tests in this file assume that off_t-dependent data structures match the
++// libc ABI. For example, struct dirent here is what readdir() function (as
++// exported from libc) returns, and not the user-facing "dirent", which
++// depends on _FILE_OFFSET_BITS setting.
++// To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS below.
++#ifdef _FILE_OFFSET_BITS
++#undef _FILE_OFFSET_BITS
++#endif
+
+ #include "sanitizer_internal_defs.h"
+ #include "sanitizer_platform_limits_posix.h"
+
+--
+2.1.4
+
diff --git a/patches/gcc/4.9.3/301-missing-execinfo_h.patch b/patches/gcc/4.9.4/301-missing-execinfo_h.patch
index 00efda2..00efda2 100644
--- a/patches/gcc/4.9.3/301-missing-execinfo_h.patch
+++ b/patches/gcc/4.9.4/301-missing-execinfo_h.patch
diff --git a/patches/gcc/6.1.0/810-arm-softfloat-libgcc.patch b/patches/gcc/4.9.4/810-arm-softfloat-libgcc.patch
index 5efa7fd..5efa7fd 100644
--- a/patches/gcc/6.1.0/810-arm-softfloat-libgcc.patch
+++ b/patches/gcc/4.9.4/810-arm-softfloat-libgcc.patch
diff --git a/patches/gcc/4.9.3/830-arm_unbreak_armv4t.patch b/patches/gcc/4.9.4/830-arm_unbreak_armv4t.patch
index 37f8f2a..37f8f2a 100644
--- a/patches/gcc/4.9.3/830-arm_unbreak_armv4t.patch
+++ b/patches/gcc/4.9.4/830-arm_unbreak_armv4t.patch
diff --git a/patches/gcc/6.1.0/840-microblaze-enable-dwarf-eh-support.patch b/patches/gcc/4.9.4/840-microblaze-enable-dwarf-eh-support.patch
index 9d29090..03fc47f 100644
--- a/patches/gcc/6.1.0/840-microblaze-enable-dwarf-eh-support.patch
+++ b/patches/gcc/4.9.4/840-microblaze-enable-dwarf-eh-support.patch
@@ -49,10 +49,10 @@ Index: b/gcc/config/microblaze/microblaze-protos.h
===================================================================
--- a/gcc/config/microblaze/microblaze-protos.h
+++ b/gcc/config/microblaze/microblaze-protos.h
-@@ -56,6 +56,7 @@
+@@ -54,6 +54,7 @@
extern int symbol_mentioned_p (rtx);
extern int label_mentioned_p (rtx);
- extern bool microblaze_cannot_force_const_mem (machine_mode, rtx);
+ extern bool microblaze_cannot_force_const_mem (enum machine_mode, rtx);
+extern void microblaze_eh_return (rtx op0);
#endif /* RTX_CODE */
@@ -61,7 +61,7 @@ Index: b/gcc/config/microblaze/microblaze.c
===================================================================
--- a/gcc/config/microblaze/microblaze.c
+++ b/gcc/config/microblaze/microblaze.c
-@@ -1959,6 +1959,11 @@
+@@ -1906,6 +1906,11 @@
if (frame_pointer_needed && (regno == HARD_FRAME_POINTER_REGNUM))
return 1;
@@ -73,7 +73,7 @@ Index: b/gcc/config/microblaze/microblaze.c
if (!crtl->is_leaf)
{
if (regno == MB_ABI_SUB_RETURN_ADDR_REGNUM)
-@@ -1986,6 +1991,13 @@
+@@ -1933,6 +1938,13 @@
return 1;
}
@@ -87,7 +87,7 @@ Index: b/gcc/config/microblaze/microblaze.c
return 0;
}
-@@ -3067,6 +3079,12 @@
+@@ -2962,6 +2974,12 @@
emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, fsiz_rtx));
}
@@ -100,7 +100,7 @@ Index: b/gcc/config/microblaze/microblaze.c
emit_jump_insn (gen_return_internal (gen_rtx_REG (Pmode, GP_REG_FIRST +
MB_ABI_SUB_RETURN_ADDR_REGNUM)));
}
-@@ -3364,10 +3382,13 @@
+@@ -3256,10 +3274,13 @@
if (count != 0)
return NULL_RTX;
@@ -148,7 +148,7 @@ Index: b/gcc/config/microblaze/microblaze.md
===================================================================
--- a/gcc/config/microblaze/microblaze.md
+++ b/gcc/config/microblaze/microblaze.md
-@@ -2272,4 +2272,15 @@
+@@ -2261,4 +2261,15 @@
(set_attr "mode" "SI")
(set_attr "length" "4")])
diff --git a/patches/gcc/4.9.4/850-libstdcxx-uclibc-c99.patch b/patches/gcc/4.9.4/850-libstdcxx-uclibc-c99.patch
new file mode 100644
index 0000000..533d01f
--- /dev/null
+++ b/patches/gcc/4.9.4/850-libstdcxx-uclibc-c99.patch
@@ -0,0 +1,274 @@
+Allow C99-depending features of libstdc++ with uClibc
+
+The libstdc++ code is fairly restrictive on how it checks for C99
+compatibility: it requires *complete* C99 support to enable certain
+features. For example, uClibc provides a good number of C99 features,
+but not C99 complex number support. For this reason, libstdc++
+completely disables many the standard C++ methods that can in fact
+work because uClibc provides the necessary functions.
+
+This patch is similar and highly inspired from
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58393, but implemented in
+a way that doesn't involve changing the configure.ac script, as
+autoreconfiguring gcc is complicated. It simply relies on the fact
+that uClibc defines the __UCLIBC__ definition.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+[Gustavo: update for 4.9.3]
+
+Index: b/libstdc++-v3/config/locale/generic/c_locale.h
+===================================================================
+--- a/libstdc++-v3/config/locale/generic/c_locale.h
++++ b/libstdc++-v3/config/locale/generic/c_locale.h
+@@ -70,7 +70,7 @@
+ __builtin_va_list __args;
+ __builtin_va_start(__args, __fmt);
+
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
+ #else
+ const int __ret = __builtin_vsprintf(__out, __fmt, __args);
+Index: b/libstdc++-v3/config/locale/gnu/c_locale.h
+===================================================================
+--- a/libstdc++-v3/config/locale/gnu/c_locale.h
++++ b/libstdc++-v3/config/locale/gnu/c_locale.h
+@@ -88,7 +88,7 @@
+ __builtin_va_list __args;
+ __builtin_va_start(__args, __fmt);
+
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
+ #else
+ const int __ret = __builtin_vsprintf(__out, __fmt, __args);
+Index: b/libstdc++-v3/include/bits/basic_string.h
+===================================================================
+--- a/libstdc++-v3/include/bits/basic_string.h
++++ b/libstdc++-v3/include/bits/basic_string.h
+@@ -2843,7 +2843,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99)
++#if __cplusplus >= 201103L && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__))
+
+ #include <ext/string_conversions.h>
+
+Index: b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
+===================================================================
+--- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc
++++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
+@@ -572,7 +572,7 @@
+ {
+ const locale __loc = __io.getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ // First try a buffer perhaps big enough.
+ int __cs_size = 64;
+ char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+Index: b/libstdc++-v3/include/bits/locale_facets.tcc
+===================================================================
+--- a/libstdc++-v3/include/bits/locale_facets.tcc
++++ b/libstdc++-v3/include/bits/locale_facets.tcc
+@@ -987,7 +987,7 @@
+ char __fbuf[16];
+ __num_base::_S_format_float(__io, __fbuf, __mod);
+
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ // First try a buffer perhaps big enough (most probably sufficient
+ // for non-ios_base::fixed outputs)
+ int __cs_size = __max_digits * 3;
+Index: b/libstdc++-v3/include/c_compatibility/math.h
+===================================================================
+--- a/libstdc++-v3/include/c_compatibility/math.h
++++ b/libstdc++-v3/include/c_compatibility/math.h
+@@ -56,7 +56,7 @@
+ using std::floor;
+ using std::fmod;
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ using std::fpclassify;
+ using std::isfinite;
+ using std::isinf;
+Index: b/libstdc++-v3/include/c_compatibility/wchar.h
+===================================================================
+--- a/libstdc++-v3/include/c_compatibility/wchar.h
++++ b/libstdc++-v3/include/c_compatibility/wchar.h
+@@ -103,7 +103,7 @@
+ using std::wmemset;
+ using std::wcsftime;
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ using std::wcstold;
+ using std::wcstoll;
+ using std::wcstoull;
+Index: b/libstdc++-v3/include/c_global/cstdio
+===================================================================
+--- a/libstdc++-v3/include/c_global/cstdio
++++ b/libstdc++-v3/include/c_global/cstdio
+@@ -146,7 +146,7 @@
+ using ::vsprintf;
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef snprintf
+ #undef vfscanf
+Index: b/libstdc++-v3/include/c_global/cstdlib
+===================================================================
+--- a/libstdc++-v3/include/c_global/cstdlib
++++ b/libstdc++-v3/include/c_global/cstdlib
+@@ -182,7 +182,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef _Exit
+ #undef llabs
+Index: b/libstdc++-v3/include/c_global/cwchar
+===================================================================
+--- a/libstdc++-v3/include/c_global/cwchar
++++ b/libstdc++-v3/include/c_global/cwchar
+@@ -232,7 +232,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef wcstold
+ #undef wcstoll
+@@ -289,7 +289,7 @@
+ using std::vwscanf;
+ #endif
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ using std::wcstold;
+ using std::wcstoll;
+ using std::wcstoull;
+Index: b/libstdc++-v3/include/c_std/cstdio
+===================================================================
+--- a/libstdc++-v3/include/c_std/cstdio
++++ b/libstdc++-v3/include/c_std/cstdio
+@@ -144,7 +144,7 @@
+ using ::vsprintf;
+ } // namespace std
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef snprintf
+ #undef vfscanf
+Index: b/libstdc++-v3/include/c_std/cstdlib
+===================================================================
+--- a/libstdc++-v3/include/c_std/cstdlib
++++ b/libstdc++-v3/include/c_std/cstdlib
+@@ -180,7 +180,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef _Exit
+ #undef llabs
+Index: b/libstdc++-v3/include/c_std/cwchar
+===================================================================
+--- a/libstdc++-v3/include/c_std/cwchar
++++ b/libstdc++-v3/include/c_std/cwchar
+@@ -228,7 +228,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef wcstold
+ #undef wcstoll
+Index: b/libstdc++-v3/include/ext/vstring.h
+===================================================================
+--- a/libstdc++-v3/include/ext/vstring.h
++++ b/libstdc++-v3/include/ext/vstring.h
+@@ -2680,7 +2680,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99))
++#if ((__cplusplus >= 201103L) && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)))
+
+ #include <ext/string_conversions.h>
+
+Index: b/libstdc++-v3/include/tr1/cstdio
+===================================================================
+--- a/libstdc++-v3/include/tr1/cstdio
++++ b/libstdc++-v3/include/tr1/cstdio
+@@ -33,7 +33,7 @@
+
+ #include <cstdio>
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+Index: b/libstdc++-v3/include/tr1/cstdlib
+===================================================================
+--- a/libstdc++-v3/include/tr1/cstdlib
++++ b/libstdc++-v3/include/tr1/cstdlib
+@@ -35,7 +35,7 @@
+
+ #if _GLIBCXX_HOSTED
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+Index: b/libstdc++-v3/include/tr1/cwchar
+===================================================================
+--- a/libstdc++-v3/include/tr1/cwchar
++++ b/libstdc++-v3/include/tr1/cwchar
+@@ -52,7 +52,7 @@
+ using std::vwscanf;
+ #endif
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ using std::wcstold;
+ using std::wcstoll;
+ using std::wcstoull;
+Index: b/libstdc++-v3/include/tr1/stdlib.h
+===================================================================
+--- a/libstdc++-v3/include/tr1/stdlib.h
++++ b/libstdc++-v3/include/tr1/stdlib.h
+@@ -33,7 +33,7 @@
+
+ #if _GLIBCXX_HOSTED
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ using std::tr1::atoll;
+ using std::tr1::strtoll;
+Index: b/libstdc++-v3/src/c++11/debug.cc
+===================================================================
+--- a/libstdc++-v3/src/c++11/debug.cc
++++ b/libstdc++-v3/src/c++11/debug.cc
+@@ -788,7 +788,7 @@
+ int __n __attribute__ ((__unused__)),
+ const char* __fmt, _Tp __s) const throw ()
+ {
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ std::snprintf(__buf, __n, __fmt, __s);
+ #else
+ std::sprintf(__buf, __fmt, __s);
diff --git a/patches/gcc/4.9.3/860-cilk-wchar.patch b/patches/gcc/4.9.4/860-cilk-wchar.patch
index 1837405..1837405 100644
--- a/patches/gcc/4.9.3/860-cilk-wchar.patch
+++ b/patches/gcc/4.9.4/860-cilk-wchar.patch
diff --git a/patches/gcc/4.9.3/870-xtensa-add-mauto-litpools-option.patch b/patches/gcc/4.9.4/870-xtensa-add-mauto-litpools-option.patch
index aa1376c..98c7b3f 100644
--- a/patches/gcc/4.9.3/870-xtensa-add-mauto-litpools-option.patch
+++ b/patches/gcc/4.9.4/870-xtensa-add-mauto-litpools-option.patch
@@ -48,8 +48,8 @@ Changes to ChangeLogs and documentation are dropped.
gcc/config/xtensa/xtensa.opt | 4 ++++
7 files changed, 54 insertions(+), 20 deletions(-)
-diff --git a/gcc/config/xtensa/constraints.md b/gcc/config/xtensa/constraints.md
-index 30f4c1f..773d4f9 100644
+Index: b/gcc/config/xtensa/constraints.md
+===================================================================
--- a/gcc/config/xtensa/constraints.md
+++ b/gcc/config/xtensa/constraints.md
@@ -111,6 +111,11 @@
@@ -64,11 +64,11 @@ index 30f4c1f..773d4f9 100644
;; Memory constraints. Do not use define_memory_constraint here. Doing so
;; causes reload to force some constants into the constant pool, but since
;; the Xtensa constant pool can only be accessed with L32R instructions, it
-diff --git a/gcc/config/xtensa/elf.h b/gcc/config/xtensa/elf.h
-index e59bede..12056f7 100644
+Index: b/gcc/config/xtensa/elf.h
+===================================================================
--- a/gcc/config/xtensa/elf.h
+++ b/gcc/config/xtensa/elf.h
-@@ -48,7 +48,9 @@ along with GCC; see the file COPYING3. If not see
+@@ -48,7 +48,9 @@
%{mtarget-align:--target-align} \
%{mno-target-align:--no-target-align} \
%{mlongcalls:--longcalls} \
@@ -79,11 +79,11 @@ index e59bede..12056f7 100644
#undef LIB_SPEC
#define LIB_SPEC "-lc -lsim -lc -lhandlers-sim -lhal"
-diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h
-index 675aacf..5b0243a 100644
+Index: b/gcc/config/xtensa/linux.h
+===================================================================
--- a/gcc/config/xtensa/linux.h
+++ b/gcc/config/xtensa/linux.h
-@@ -42,7 +42,9 @@ along with GCC; see the file COPYING3. If not see
+@@ -42,7 +42,9 @@
%{mtarget-align:--target-align} \
%{mno-target-align:--no-target-align} \
%{mlongcalls:--longcalls} \
@@ -94,8 +94,8 @@ index 675aacf..5b0243a 100644
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
-diff --git a/gcc/config/xtensa/predicates.md b/gcc/config/xtensa/predicates.md
-index e02209e..d7dfa11 100644
+Index: b/gcc/config/xtensa/predicates.md
+===================================================================
--- a/gcc/config/xtensa/predicates.md
+++ b/gcc/config/xtensa/predicates.md
@@ -142,7 +142,8 @@
@@ -108,11 +108,11 @@ index e02209e..d7dfa11 100644
&& GET_MODE_SIZE (mode) % UNITS_PER_WORD == 0")))))
;; Accept the floating point constant 1 in the appropriate mode.
-diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
-index eb039ba..206ff80 100644
+Index: b/gcc/config/xtensa/xtensa.c
+===================================================================
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
-@@ -501,6 +501,9 @@ xtensa_valid_move (machine_mode mode, rtx *operands)
+@@ -477,6 +477,9 @@
{
int dst_regnum = xt_true_regnum (operands[0]);
@@ -121,8 +121,8 @@ index eb039ba..206ff80 100644
+
/* The stack pointer can only be assigned with a MOVSP opcode. */
if (dst_regnum == STACK_POINTER_REGNUM)
- return !TARGET_WINDOWED_ABI
-@@ -1069,7 +1072,7 @@ xtensa_emit_move_sequence (rtx *operands, machine_mode mode)
+ return (mode == SImode
+@@ -1044,7 +1047,7 @@
return 1;
}
@@ -131,7 +131,7 @@ index eb039ba..206ff80 100644
{
src = force_const_mem (SImode, src);
operands[1] = src;
-@@ -2449,6 +2452,20 @@ print_operand (FILE *file, rtx x, int letter)
+@@ -2428,6 +2431,20 @@
}
break;
@@ -152,11 +152,11 @@ index eb039ba..206ff80 100644
default:
if (GET_CODE (x) == REG || GET_CODE (x) == SUBREG)
fprintf (file, "%s", reg_names[xt_true_regnum (x)]);
-diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
-index 6d84384..0e673a3 100644
+Index: b/gcc/config/xtensa/xtensa.md
+===================================================================
--- a/gcc/config/xtensa/xtensa.md
+++ b/gcc/config/xtensa/xtensa.md
-@@ -761,8 +761,8 @@
+@@ -799,8 +799,8 @@
})
(define_insn "movsi_internal"
@@ -167,7 +167,7 @@ index 6d84384..0e673a3 100644
"xtensa_valid_move (SImode, operands)"
"@
movi.n\t%0, %x1
-@@ -774,15 +774,16 @@
+@@ -812,15 +812,16 @@
mov\t%0, %1
movsp\t%0, %1
movi\t%0, %x1
@@ -186,7 +186,7 @@ index 6d84384..0e673a3 100644
;; 16-bit Integer moves
-@@ -796,21 +797,22 @@
+@@ -834,21 +835,22 @@
})
(define_insn "movhi_internal"
@@ -213,7 +213,7 @@ index 6d84384..0e673a3 100644
;; 8-bit Integer moves
-@@ -881,7 +883,7 @@
+@@ -919,7 +921,7 @@
(match_operand:SF 1 "general_operand" ""))]
""
{
@@ -222,7 +222,7 @@ index 6d84384..0e673a3 100644
operands[1] = force_const_mem (SFmode, operands[1]);
if ((!register_operand (operands[0], SFmode)
-@@ -896,8 +898,8 @@
+@@ -934,8 +936,8 @@
})
(define_insn "movsf_internal"
@@ -233,7 +233,7 @@ index 6d84384..0e673a3 100644
"((register_operand (operands[0], SFmode)
|| register_operand (operands[1], SFmode))
&& !(FP_REG_P (xt_true_regnum (operands[0]))
-@@ -912,13 +914,14 @@
+@@ -950,13 +952,14 @@
mov\t%0, %1
wfr\t%0, %1
rfr\t%0, %1
@@ -250,7 +250,7 @@ index 6d84384..0e673a3 100644
(define_insn "*lsiu"
[(set (match_operand:SF 0 "register_operand" "=f")
-@@ -991,7 +994,7 @@
+@@ -997,7 +1000,7 @@
(match_operand:DF 1 "general_operand" ""))]
""
{
@@ -259,7 +259,7 @@ index 6d84384..0e673a3 100644
operands[1] = force_const_mem (DFmode, operands[1]);
if (!register_operand (operands[0], DFmode)
-@@ -1002,8 +1005,8 @@
+@@ -1008,8 +1011,8 @@
})
(define_insn_and_split "movdf_internal"
@@ -270,11 +270,11 @@ index 6d84384..0e673a3 100644
"register_operand (operands[0], DFmode)
|| register_operand (operands[1], DFmode)"
"#"
-diff --git a/gcc/config/xtensa/xtensa.opt b/gcc/config/xtensa/xtensa.opt
-index 2fd6cee..21c6e96 100644
+Index: b/gcc/config/xtensa/xtensa.opt
+===================================================================
--- a/gcc/config/xtensa/xtensa.opt
+++ b/gcc/config/xtensa/xtensa.opt
-@@ -38,6 +38,10 @@ mtext-section-literals
+@@ -38,6 +38,10 @@
Target
Intersperse literal pools with code in the text section
@@ -285,6 +285,3 @@ index 2fd6cee..21c6e96 100644
mserialize-volatile
Target Report Mask(SERIALIZE_VOLATILE)
-mno-serialize-volatile Do not serialize volatile memory references with MEMW instructions
---
-1.8.1.4
-
diff --git a/patches/gcc/4.9.3/871-xtensa-reimplement-register-spilling.patch b/patches/gcc/4.9.4/871-xtensa-reimplement-register-spilling.patch
index abc7a08..abc7a08 100644
--- a/patches/gcc/4.9.3/871-xtensa-reimplement-register-spilling.patch
+++ b/patches/gcc/4.9.4/871-xtensa-reimplement-register-spilling.patch
diff --git a/patches/gcc/4.9.3/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch b/patches/gcc/4.9.4/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
index f23a5c0..f23a5c0 100644
--- a/patches/gcc/4.9.3/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
+++ b/patches/gcc/4.9.4/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
diff --git a/patches/gcc/4.9.3/873-xtensa-fix-_Unwind_GetCFA.patch b/patches/gcc/4.9.4/873-xtensa-fix-_Unwind_GetCFA.patch
index dc40513..dc40513 100644
--- a/patches/gcc/4.9.3/873-xtensa-fix-_Unwind_GetCFA.patch
+++ b/patches/gcc/4.9.4/873-xtensa-fix-_Unwind_GetCFA.patch
diff --git a/patches/gcc/4.9.4/874-xtensa-add-uclinux-support.patch b/patches/gcc/4.9.4/874-xtensa-add-uclinux-support.patch
new file mode 100644
index 0000000..881aec0
--- /dev/null
+++ b/patches/gcc/4.9.4/874-xtensa-add-uclinux-support.patch
@@ -0,0 +1,169 @@
+From 70c2cb98fb129b4766b5da0f945dc41fd568c77a Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sat, 22 Aug 2015 08:44:26 +0300
+Subject: [PATCH] xtensa: add uclinux support
+
+2015-10-03 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config.gcc (xtensa*-*-uclinux*): New configuration.
+ * config/xtensa/uclinux.h: New file.
+ * config/xtensa/uclinux.opt: New file.
+
+libgcc/
+ * config.host (xtensa*-*-uclinux*): New configuration.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: r228450
+
+ gcc/config.gcc | 5 ++++
+ gcc/config/xtensa/uclinux.h | 69 +++++++++++++++++++++++++++++++++++++++++++
+ gcc/config/xtensa/uclinux.opt | 32 ++++++++++++++++++++
+ libgcc/config.host | 5 ++++
+ 4 files changed, 111 insertions(+)
+ create mode 100644 gcc/config/xtensa/uclinux.h
+ create mode 100644 gcc/config/xtensa/uclinux.opt
+
+Index: b/gcc/config.gcc
+===================================================================
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -2871,6 +2871,11 @@
+ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h"
+ tmake_file="${tmake_file} xtensa/t-xtensa"
+ ;;
++xtensa*-*-uclinux*)
++ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/uclinux.h"
++ tmake_file="${tmake_file} xtensa/t-xtensa"
++ extra_options="${extra_options} xtensa/uclinux.opt"
++ ;;
+ am33_2.0-*-linux*)
+ tm_file="mn10300/mn10300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h"
+ gas=yes gnu_ld=yes
+Index: b/gcc/config/xtensa/uclinux.h
+===================================================================
+--- /dev/null
++++ b/gcc/config/xtensa/uclinux.h
+@@ -0,0 +1,69 @@
++/* Xtensa uClinux configuration.
++ Derived from the configuration for GCC for Intel i386 running Linux.
++ Copyright (C) 2001-2015 Free Software Foundation, Inc.
++
++This file is part of GCC.
++
++GCC is free software; you can redistribute it and/or modify it under
++the terms of the GNU General Public License as published by the Free
++Software Foundation; either version 3, or (at your option) any later
++version.
++
++GCC is distributed in the hope that it will be useful, but WITHOUT ANY
++WARRANTY; without even the implied warranty of MERCHANTABILITY or
++FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++for more details.
++
++You should have received a copy of the GNU General Public License
++along with GCC; see the file COPYING3. If not see
++<http://www.gnu.org/licenses/>. */
++
++#undef TARGET_OS_CPP_BUILTINS
++#define TARGET_OS_CPP_BUILTINS() \
++ do \
++ { \
++ GNU_USER_TARGET_OS_CPP_BUILTINS (); \
++ builtin_define ("__uClinux__"); \
++ } \
++ while (0)
++
++#undef SUBTARGET_CPP_SPEC
++#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
++
++#undef SIZE_TYPE
++#define SIZE_TYPE "unsigned int"
++
++#undef PTRDIFF_TYPE
++#define PTRDIFF_TYPE "int"
++
++#undef WCHAR_TYPE
++#define WCHAR_TYPE "long int"
++
++#undef WCHAR_TYPE_SIZE
++#define WCHAR_TYPE_SIZE 32
++
++#undef ASM_SPEC
++#define ASM_SPEC \
++ "%{mtext-section-literals:--text-section-literals} \
++ %{mno-text-section-literals:--no-text-section-literals} \
++ %{mtarget-align:--target-align} \
++ %{mno-target-align:--no-target-align} \
++ %{mlongcalls:--longcalls} \
++ %{mno-longcalls:--no-longcalls} \
++ %{mauto-litpools:--auto-litpools} \
++ %{mno-auto-litpools:--no-auto-litpools}"
++
++#undef LINK_SPEC
++#define LINK_SPEC "%{!no-elf2flt:%{!elf2flt*:-elf2flt}}"
++
++#undef LOCAL_LABEL_PREFIX
++#define LOCAL_LABEL_PREFIX "."
++
++/* Always enable "-fpic" for Xtensa Linux. */
++#define XTENSA_ALWAYS_PIC 1
++
++#undef TARGET_LIBC_HAS_FUNCTION
++#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
++
++#undef DBX_REGISTER_NUMBER
++
+Index: b/gcc/config/xtensa/uclinux.opt
+===================================================================
+--- /dev/null
++++ b/gcc/config/xtensa/uclinux.opt
+@@ -0,0 +1,32 @@
++; Xtensa uClinux options.
++
++; Copyright (C) 2015 Free Software Foundation, Inc.
++;
++; This file is part of GCC.
++;
++; GCC is free software; you can redistribute it and/or modify it under
++; the terms of the GNU General Public License as published by the Free
++; Software Foundation; either version 3, or (at your option) any later
++; version.
++;
++; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
++; WARRANTY; without even the implied warranty of MERCHANTABILITY or
++; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++; for more details.
++;
++; You should have received a copy of the GNU General Public License
++; along with GCC; see the file COPYING3. If not see
++; <http://www.gnu.org/licenses/>.
++
++; See the GCC internals manual (options.texi) for a description of
++; this file's format.
++
++; Please try to keep this file in ASCII collating order.
++
++elf2flt
++Driver
++
++elf2flt=
++Driver JoinedOrMissing
++
++; This comment is to ensure we retain the blank line above.
+Index: b/libgcc/config.host
+===================================================================
+--- a/libgcc/config.host
++++ b/libgcc/config.host
+@@ -1213,6 +1213,11 @@
+ tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc"
+ md_unwind_header=xtensa/linux-unwind.h
+ ;;
++xtensa*-*-uclinux*)
++ tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc"
++ md_unwind_header=xtensa/linux-unwind.h
++ extra_parts="$extra_parts crtbeginS.o crtbeginT.o crtendS.o"
++ ;;
+ am33_2.0-*-linux*)
+ # Don't need crtbeginT.o from *-*-linux* default.
+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
diff --git a/patches/gcc/4.9.4/880-nios2_legitimize_address.patch b/patches/gcc/4.9.4/880-nios2_legitimize_address.patch
new file mode 100644
index 0000000..4623f29
--- /dev/null
+++ b/patches/gcc/4.9.4/880-nios2_legitimize_address.patch
@@ -0,0 +1,49 @@
+From b0ea54f3f995754881e0ea6651133aa7b58eeaa2 Mon Sep 17 00:00:00 2001
+From: cltang <cltang@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 22 Sep 2015 12:23:20 +0000
+Subject: [PATCH] nios2_legitimize_address 2015-09-22 Chung-Lin Tang
+ <cltang@codesourcery.com>
+
+ Backport from mainline
+ 2015-09-22 Chung-Lin Tang <cltang@codesourcery.com>
+
+ * config/nios2/nios2.c (nios2_legitimize_address): When handling
+ 'reg + reloc' cases, allow first operand to be non-REG, and use
+ force_reg() to enforce address pattern.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@228013 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Fixes:
+http://autobuild.buildroot.net/results/901/90186d1fe134b804c0101554296b1235dc0ccbb0
+
+[backported to 4.9.3]
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ gcc/config/nios2/nios2.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/config/nios2/nios2.c b/gcc/config/nios2/nios2.c
+index 047b615..41dd6f9 100644
+--- a/gcc/config/nios2/nios2.c
++++ b/gcc/config/nios2/nios2.c
+@@ -1786,15 +1786,15 @@ nios2_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
+
+ Which will be output as '%tls_le(var+48)(r23)' in assembly. */
+ if (GET_CODE (x) == PLUS
+- && GET_CODE (XEXP (x, 0)) == REG
+ && GET_CODE (XEXP (x, 1)) == CONST)
+ {
+- rtx unspec, offset, reg = XEXP (x, 0);
++ rtx unspec, offset;
+ split_const (XEXP (x, 1), &unspec, &offset);
+ if (GET_CODE (unspec) == UNSPEC
+ && !nios2_large_offset_p (XINT (unspec, 1))
+ && offset != const0_rtx)
+ {
++ rtx reg = force_reg (Pmode, XEXP (x, 0));
+ unspec = copy_rtx (unspec);
+ XVECEXP (unspec, 0, 0)
+ = plus_constant (Pmode, XVECEXP (unspec, 0, 0), INTVAL (offset));
+--
+2.5.0
+
diff --git a/patches/gcc/4.9.4/890-fix-m68k-compile.patch b/patches/gcc/4.9.4/890-fix-m68k-compile.patch
new file mode 100644
index 0000000..140977b
--- /dev/null
+++ b/patches/gcc/4.9.4/890-fix-m68k-compile.patch
@@ -0,0 +1,15 @@
+remove unused header, which breaks the toolchain building
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+diff -Nur gcc-4.9.3.orig/libgcc/config/m68k/linux-atomic.c gcc-4.9.3/libgcc/config/m68k/linux-atomic.c
+--- gcc-4.9.3.orig/libgcc/config/m68k/linux-atomic.c 2014-01-02 23:25:22.000000000 +0100
++++ gcc-4.9.3/libgcc/config/m68k/linux-atomic.c 2016-03-18 22:24:40.000000000 +0100
+@@ -33,7 +33,6 @@
+ using the kernel helper defined below. There is no support for
+ 64-bit operations yet. */
+
+-#include <asm/unistd.h>
+ #include <stdbool.h>
+
+ #ifndef __NR_atomic_cmpxchg_32
diff --git a/patches/gcc/4.9.4/891-fix-m68k-uclinux.patch b/patches/gcc/4.9.4/891-fix-m68k-uclinux.patch
new file mode 100644
index 0000000..4347642
--- /dev/null
+++ b/patches/gcc/4.9.4/891-fix-m68k-uclinux.patch
@@ -0,0 +1,18 @@
+avoids internal compiler error while compiling linux-atomic.c
+See here:
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53833
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+diff -Nur gcc-4.9.3.orig/libgcc/config.host gcc-4.9.3/libgcc/config.host
+--- gcc-4.9.3.orig/libgcc/config.host 2014-03-27 16:40:31.000000000 +0100
++++ gcc-4.9.3/libgcc/config.host 2016-04-05 16:20:53.422809885 +0200
+@@ -750,7 +750,7 @@
+ m68k*-*-openbsd*)
+ ;;
+ m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux with uClibc
+- tmake_file="$tmake_file m68k/t-floatlib m68k/t-linux"
++ tmake_file="$tmake_file m68k/t-floatlib"
+ md_unwind_header=m68k/linux-unwind.h
+ ;;
+ m68k-*-linux*) # Motorola m68k's running GNU/Linux
diff --git a/patches/gcc/4.9.3/900-musl-support.patch b/patches/gcc/4.9.4/900-musl-support.patch
index a711b06..a862d01 100644
--- a/patches/gcc/4.9.3/900-musl-support.patch
+++ b/patches/gcc/4.9.4/900-musl-support.patch
@@ -60,7 +60,7 @@ Index: b/gcc/config.gcc
*)
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
;;
-@@ -2322,6 +2325,10 @@
+@@ -2338,6 +2341,10 @@
powerpc*-*-linux*paired*)
tm_file="${tm_file} rs6000/750cl.h" ;;
esac
@@ -308,7 +308,7 @@ Index: b/gcc/config/microblaze/linux.h
===================================================================
--- a/gcc/config/microblaze/linux.h
+++ b/gcc/config/microblaze/linux.h
-@@ -25,7 +25,23 @@
+@@ -28,7 +28,23 @@
#undef TLS_NEEDS_GOT
#define TLS_NEEDS_GOT 1
@@ -337,7 +337,7 @@ Index: b/gcc/config/rs6000/linux64.h
===================================================================
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
-@@ -375,17 +375,23 @@
+@@ -371,17 +371,23 @@
#endif
#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
@@ -452,7 +452,7 @@ Index: b/gcc/configure
===================================================================
--- a/gcc/configure
+++ b/gcc/configure
-@@ -27449,6 +27453,9 @@
+@@ -27601,6 +27601,9 @@
gcc_cv_target_dl_iterate_phdr=no
fi
;;
@@ -466,7 +466,7 @@ Index: b/gcc/configure.ac
===================================================================
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
-@@ -5108,6 +5112,9 @@
+@@ -5173,6 +5173,9 @@
gcc_cv_target_dl_iterate_phdr=no
fi
;;
@@ -588,7 +588,7 @@ Index: b/libstdc++-v3/configure.host
===================================================================
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
-@@ -264,6 +264,13 @@
+@@ -266,6 +266,13 @@
os_include_dir="os/bsd/freebsd"
;;
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
@@ -602,7 +602,7 @@ Index: b/libstdc++-v3/configure.host
if [ "$uclibc" = "yes" ]; then
os_include_dir="os/uclibc"
elif [ "$bionic" = "yes" ]; then
-@@ -272,6 +279,9 @@
+@@ -274,6 +281,9 @@
os_include_dir="os/gnu-linux"
fi
;;
@@ -637,4 +637,4 @@ Index: b/gcc/config/mips/linux.h
+#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
+#endif
+#undef MUSL_DYNAMIC_LINKER
-+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E ".so.1"
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
diff --git a/patches/gcc/4.9.4/901-microblaze-uclibc.patch b/patches/gcc/4.9.4/901-microblaze-uclibc.patch
new file mode 100644
index 0000000..82c44e1
--- /dev/null
+++ b/patches/gcc/4.9.4/901-microblaze-uclibc.patch
@@ -0,0 +1,21 @@
+Add dynamic linker support for uClibc
+
+Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
+
+diff -Nur gcc-4.9.3.orig/gcc/config/microblaze/linux.h gcc-4.9.3/gcc/config/microblaze/linux.h
+--- gcc-4.9.3.orig/gcc/config/microblaze/linux.h 2016-06-04 21:21:09.430646655 +0200
++++ gcc-4.9.3/gcc/config/microblaze/linux.h 2016-06-04 21:21:44.596003509 +0200
+@@ -36,10 +36,13 @@
+
+ #undef MUSL_DYNAMIC_LINKER
+ #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-microblaze" MUSL_DYNAMIC_LINKER_E ".so.1"
++#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+
+ #if DEFAULT_LIBC == LIBC_MUSL
+ #define DYNAMIC_LINKER MUSL_DYNAMIC_LINKER
++#elif DEFAULT_LIBC == LIBC_UCLIBC
++#define DYNAMIC_LINKER UCLIBC_DYNAMIC_LINKER
+ #else
+ #define DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
+ #endif
diff --git a/patches/gcc/4.9.4/930-libgcc-disable-split-stack-nothreads.patch b/patches/gcc/4.9.4/930-libgcc-disable-split-stack-nothreads.patch
new file mode 100644
index 0000000..670cf8d
--- /dev/null
+++ b/patches/gcc/4.9.4/930-libgcc-disable-split-stack-nothreads.patch
@@ -0,0 +1,14 @@
+disable split-stack for non-thread builds
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+diff -Nur gcc-4.9.3.orig/libgcc/config/t-stack gcc-4.9.3/libgcc/config/t-stack
+--- gcc-4.9.3.orig/libgcc/config/t-stack 2010-10-01 21:31:49.000000000 +0200
++++ gcc-4.9.3/libgcc/config/t-stack 2016-03-07 01:34:32.000000000 +0100
+@@ -1,4 +1,6 @@
+ # Makefile fragment to provide generic support for -fsplit-stack.
+ # This should be used in config.host for any host which supports
+ # -fsplit-stack.
++ifeq ($(enable_threads),yes)
+ LIB2ADD_ST += $(srcdir)/generic-morestack.c $(srcdir)/generic-morestack-thread.c
++endif
diff --git a/patches/gcc/4.9.4/940-uclinux-enable-threads.patch b/patches/gcc/4.9.4/940-uclinux-enable-threads.patch
new file mode 100644
index 0000000..5108147
--- /dev/null
+++ b/patches/gcc/4.9.4/940-uclinux-enable-threads.patch
@@ -0,0 +1,20 @@
+Enable POSIX threads for uClinux targets
+Reported upstream:
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71721
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+Index: b/gcc/config.gcc
+===================================================================
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -810,6 +810,9 @@
+ *-*-uclinux*)
+ extra_options="$extra_options gnu-user.opt"
+ use_gcc_stdint=wrap
++ case ${enable_threads} in
++ "" | yes | posix) thread_file='posix' ;;
++ esac
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC"
+ ;;
+ *-*-rdos*)
diff --git a/patches/gcc/5.4.0/875-xtensa-fix-xtensa_fallback_frame_state-for-call0-ABI.patch b/patches/gcc/5.4.0/875-xtensa-fix-xtensa_fallback_frame_state-for-call0-ABI.patch
new file mode 100644
index 0000000..d128596
--- /dev/null
+++ b/patches/gcc/5.4.0/875-xtensa-fix-xtensa_fallback_frame_state-for-call0-ABI.patch
@@ -0,0 +1,108 @@
+From 7d3692c6933f7ff87bf110dede8e33e922b164c6 Mon Sep 17 00:00:00 2001
+From: jcmvbkbc <jcmvbkbc@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 15 Sep 2015 19:30:32 +0000
+Subject: [PATCH] xtensa: fix xtensa_fallback_frame_state for call0 ABI
+
+2015-09-15 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/xtensa.h (DWARF_ALT_FRAME_RETURN_COLUMN): New
+ definition.
+ (DWARF_FRAME_REGISTERS): Reserve space for one extra register in
+ call0 ABI.
+
+libgcc/
+ * config/xtensa/linux-unwind.h (xtensa_fallback_frame_state):
+ Add support for call0 ABI.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227809 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gcc/config/xtensa/xtensa.h | 4 +++-
+ libgcc/config/xtensa/linux-unwind.h | 30 ++++++++++++++++++++++++++++--
+ 2 files changed, 31 insertions(+), 3 deletions(-)
+
+diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
+index 584080b..e165def 100644
+--- a/gcc/config/xtensa/xtensa.h
++++ b/gcc/config/xtensa/xtensa.h
+@@ -813,7 +813,9 @@ typedef struct xtensa_args
+ for debugging. */
+ #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, 0)
+ #define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (0)
+-#define DWARF_FRAME_REGISTERS 16
++#define DWARF_ALT_FRAME_RETURN_COLUMN 16
++#define DWARF_FRAME_REGISTERS (DWARF_ALT_FRAME_RETURN_COLUMN \
++ + (TARGET_WINDOWED_ABI ? 0 : 1))
+ #define EH_RETURN_DATA_REGNO(N) ((N) < 2 ? (N) + 2 : INVALID_REGNUM)
+ #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
+ (flag_pic \
+diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h
+index 9daf738..9a67b5d 100644
+--- a/libgcc/config/xtensa/linux-unwind.h
++++ b/libgcc/config/xtensa/linux-unwind.h
+@@ -52,7 +52,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define ENTRY_BYTE 0x36
+ #endif
+
+-#ifdef __XTENSA_WINDOWED_ABI__
+ #define MD_FALLBACK_FRAME_STATE_FOR xtensa_fallback_frame_state
+
+ static _Unwind_Reason_Code
+@@ -61,6 +60,10 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
+ {
+ unsigned char *pc = context->ra;
+ struct sigcontext *sc;
++#if defined(__XTENSA_CALL0_ABI__)
++ _Unwind_Ptr new_cfa;
++ int i;
++#endif
+
+ struct rt_sigframe {
+ siginfo_t info;
+@@ -76,6 +79,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
+ || pc[5] != SYSC_BYTE2)
+ return _URC_END_OF_STACK;
+
++#if defined(__XTENSA_WINDOWED_ABI__)
+ rt_ = context->sp;
+ sc = &rt_->uc.uc_mcontext;
+ fs->signal_regs = (_Unwind_Word *) sc->sc_a;
+@@ -90,11 +94,33 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
+ }
+ else
+ fs->signal_ra = sc->sc_pc;
++#elif defined(__XTENSA_CALL0_ABI__)
++ rt_ = context->cfa;
++ sc = &rt_->uc.uc_mcontext;
++
++ new_cfa = (_Unwind_Ptr) sc;
++ fs->regs.cfa_how = CFA_REG_OFFSET;
++ fs->regs.cfa_reg = __LIBGCC_STACK_POINTER_REGNUM__;
++ fs->regs.cfa_offset = new_cfa - (_Unwind_Ptr) context->cfa;
++
++ for (i = 0; i < 16; i++)
++ {
++ fs->regs.reg[i].how = REG_SAVED_OFFSET;
++ fs->regs.reg[i].loc.offset = (_Unwind_Ptr) &(sc->sc_a[i]) - new_cfa;
++ }
++
++ fs->regs.reg[__LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__].how =
++ REG_SAVED_VAL_OFFSET;
++ fs->regs.reg[__LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__].loc.offset =
++ (_Unwind_Ptr) (sc->sc_pc) - new_cfa;
++ fs->retaddr_column = __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__;
++#else
++#error Unsupported Xtensa ABI
++#endif
+
+ fs->signal_frame = 1;
+ return _URC_NO_REASON;
+ }
+
+-#endif /* __XTENSA_WINDOWED_ABI__ */
+
+ #endif /* ifdef inhibit_libc */
+--
+2.1.4
+
diff --git a/patches/gcc/5.4.0/876-xtensa-fix-libgcc-build-with-text-section-literals.patch b/patches/gcc/5.4.0/876-xtensa-fix-libgcc-build-with-text-section-literals.patch
new file mode 100644
index 0000000..4b2334a
--- /dev/null
+++ b/patches/gcc/5.4.0/876-xtensa-fix-libgcc-build-with-text-section-literals.patch
@@ -0,0 +1,67 @@
+From 44fbad9f8bed55f690f251b530ab38df1e696d95 Mon Sep 17 00:00:00 2001
+From: jcmvbkbc <jcmvbkbc@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed, 17 Feb 2016 20:21:48 +0000
+Subject: [PATCH] xtensa: fix libgcc build with --text-section-literals
+
+Functions __muldf3_aux, __divdf3_aux, __mulsf3_aux and __divsf3_aux
+don't start with leaf_entry, so they need explicit .literal_position,
+otherwise libgcc build fails in the presence of --text-section-literals.
+
+2016-02-17 Max Filippov <jcmvbkbc@gmail.com>
+libgcc/
+ * config/xtensa/ieee754-df.S (__muldf3_aux, __divdf3_aux): Add
+ .literal_position before the function.
+ * config/xtensa/ieee754-sf.S (__mulsf3_aux, __divsf3_aux):
+ Likewise.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233505 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ libgcc/config/xtensa/ieee754-df.S | 2 ++
+ libgcc/config/xtensa/ieee754-sf.S | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/libgcc/config/xtensa/ieee754-df.S b/libgcc/config/xtensa/ieee754-df.S
+index a7ae209..26f2abd 100644
+--- a/libgcc/config/xtensa/ieee754-df.S
++++ b/libgcc/config/xtensa/ieee754-df.S
+@@ -606,6 +606,7 @@ __subdf3:
+ #define XCHAL_NO_MUL 1
+ #endif
+
++ .literal_position
+ __muldf3_aux:
+
+ /* Handle unusual cases (zeros, subnormals, NaNs and Infinities).
+@@ -1216,6 +1217,7 @@ __muldf3:
+
+ #ifdef L_divdf3
+
++ .literal_position
+ /* Division */
+ __divdf3_aux:
+
+diff --git a/libgcc/config/xtensa/ieee754-sf.S b/libgcc/config/xtensa/ieee754-sf.S
+index 7e397dc..a5e6e3c 100644
+--- a/libgcc/config/xtensa/ieee754-sf.S
++++ b/libgcc/config/xtensa/ieee754-sf.S
+@@ -487,6 +487,7 @@ __subsf3:
+ #define XCHAL_NO_MUL 1
+ #endif
+
++ .literal_position
+ __mulsf3_aux:
+
+ /* Handle unusual cases (zeros, subnormals, NaNs and Infinities).
+@@ -884,6 +885,7 @@ __mulsf3:
+
+ #ifdef L_divsf3
+
++ .literal_position
+ /* Division */
+ __divsf3_aux:
+
+--
+2.1.4
+
diff --git a/patches/gcc/5.4.0/877-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch b/patches/gcc/5.4.0/877-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch
new file mode 100644
index 0000000..6e0ce6e
--- /dev/null
+++ b/patches/gcc/5.4.0/877-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch
@@ -0,0 +1,62 @@
+From d28554ee61a1ab1263274d66386e4051bca0ce05 Mon Sep 17 00:00:00 2001
+From: jcmvbkbc <jcmvbkbc@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 18 Oct 2016 19:12:19 +0000
+Subject: [PATCH] xtensa: don't use unwind-dw2-fde-dip with elf targets
+
+Define LIB2ADDEH_XTENSA_UNWIND_DW2_FDE to unwind-dw2-fde.c in
+xtensa/t-elf and to unwind-dw2-fde-dip.c in xtensa/t-linux and use
+LIB2ADDEH_XTENSA_UNWIND_DW2_FDE in LIB2ADDEH definition.
+
+This fixes build for elf target with windowed xtensa core that currently
+breaks with the following error message:
+
+ unwind-dw2-fde-dip.c:36:40: fatal error: elf.h: No such file or directory
+
+2016-10-18 Max Filippov <jcmvbkbc@gmail.com>
+libgcc/
+ * config/xtensa/t-elf (LIB2ADDEH_XTENSA_UNWIND_DW2_FDE): New
+ definition.
+ * config/xtensa/t-linux (LIB2ADDEH_XTENSA_UNWIND_DW2_FDE): New
+ definition.
+ * config/xtensa/t-windowed (LIB2ADDEH): Use
+ LIB2ADDEH_XTENSA_UNWIND_DW2_FDE defined by either xtensa/t-elf
+ or xtensa/t-linux.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241313 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ libgcc/config/xtensa/t-elf | 2 ++
+ libgcc/config/xtensa/t-linux | 2 ++
+ libgcc/config/xtensa/t-windowed | 2 +-
+ 3 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/libgcc/config/xtensa/t-elf b/libgcc/config/xtensa/t-elf
+index 59d5121..967cf9b 100644
+--- a/libgcc/config/xtensa/t-elf
++++ b/libgcc/config/xtensa/t-elf
+@@ -3,3 +3,5 @@ CRTSTUFF_T_CFLAGS += -mlongcalls
+ CRTSTUFF_T_CFLAGS_S += -mlongcalls
+
+ HOST_LIBGCC2_CFLAGS += -mlongcalls
++
++LIB2ADDEH_XTENSA_UNWIND_DW2_FDE = $(srcdir)/unwind-dw2-fde.c
+diff --git a/libgcc/config/xtensa/t-linux b/libgcc/config/xtensa/t-linux
+index 6f4ae89..412ecca 100644
+--- a/libgcc/config/xtensa/t-linux
++++ b/libgcc/config/xtensa/t-linux
+@@ -1 +1,3 @@
+ SHLIB_MAPFILES += $(srcdir)/config/xtensa/libgcc-glibc.ver
++
++LIB2ADDEH_XTENSA_UNWIND_DW2_FDE = $(srcdir)/unwind-dw2-fde-dip.c
+diff --git a/libgcc/config/xtensa/t-windowed b/libgcc/config/xtensa/t-windowed
+index a99156c..f140136 100644
+--- a/libgcc/config/xtensa/t-windowed
++++ b/libgcc/config/xtensa/t-windowed
+@@ -1,2 +1,2 @@
+ LIB2ADDEH = $(srcdir)/config/xtensa/unwind-dw2-xtensa.c \
+- $(srcdir)/unwind-dw2-fde-dip.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
++ $(LIB2ADDEH_XTENSA_UNWIND_DW2_FDE) $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+--
+2.1.4
+
diff --git a/patches/gcc/5.4.0/878-xtensa-Fix-PR-target-78603.patch b/patches/gcc/5.4.0/878-xtensa-Fix-PR-target-78603.patch
new file mode 100644
index 0000000..4646d3c
--- /dev/null
+++ b/patches/gcc/5.4.0/878-xtensa-Fix-PR-target-78603.patch
@@ -0,0 +1,35 @@
+From b18fe564ed233ee0965b3a980edc5dbe069b80ea Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Tue, 29 Nov 2016 13:09:17 -0800
+Subject: [PATCH] xtensa: Fix PR target/78603
+
+2016-11-29 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/xtensa.c (hwloop_optimize): Don't emit zero
+ overhead loop start between a call and its CALL_ARG_LOCATION
+ note.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gcc/config/xtensa/xtensa.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index 206ff80..36ab1e3 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -4182,7 +4182,10 @@ hwloop_optimize (hwloop_info loop)
+ entry_after = BB_END (entry_bb);
+ while (DEBUG_INSN_P (entry_after)
+ || (NOTE_P (entry_after)
+- && NOTE_KIND (entry_after) != NOTE_INSN_BASIC_BLOCK))
++ && NOTE_KIND (entry_after) != NOTE_INSN_BASIC_BLOCK
++ /* Make sure we don't split a call and its corresponding
++ CALL_ARG_LOCATION note. */
++ && NOTE_KIND (entry_after) != NOTE_INSN_CALL_ARG_LOCATION))
+ entry_after = PREV_INSN (entry_after);
+
+ emit_insn_after (seq, entry_after);
+--
+2.1.4
+
diff --git a/patches/gcc/6.1.0/100-uclibc-conf.patch b/patches/gcc/6.2.0/100-uclibc-conf.patch
index 73d1f0d..73d1f0d 100644
--- a/patches/gcc/6.1.0/100-uclibc-conf.patch
+++ b/patches/gcc/6.2.0/100-uclibc-conf.patch
diff --git a/patches/gcc/6.1.0/301-missing-execinfo_h.patch b/patches/gcc/6.2.0/301-missing-execinfo_h.patch
index 2d0e7ba..2d0e7ba 100644
--- a/patches/gcc/6.1.0/301-missing-execinfo_h.patch
+++ b/patches/gcc/6.2.0/301-missing-execinfo_h.patch
diff --git a/patches/gcc/6.1.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch b/patches/gcc/6.2.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
index d8986d5..d8986d5 100644
--- a/patches/gcc/6.1.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
+++ b/patches/gcc/6.2.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
diff --git a/patches/gcc/6.1.0/380-gcc-plugin-POSIX-include-sys-select-h.patch b/patches/gcc/6.2.0/380-gcc-plugin-POSIX-include-sys-select-h.patch
index 12ef48e..12ef48e 100644
--- a/patches/gcc/6.1.0/380-gcc-plugin-POSIX-include-sys-select-h.patch
+++ b/patches/gcc/6.2.0/380-gcc-plugin-POSIX-include-sys-select-h.patch
diff --git a/patches/gcc/4.9.3/810-arm-softfloat-libgcc.patch b/patches/gcc/6.2.0/810-arm-softfloat-libgcc.patch
index c8cb377..5efa7fd 100644
--- a/patches/gcc/4.9.3/810-arm-softfloat-libgcc.patch
+++ b/patches/gcc/6.2.0/810-arm-softfloat-libgcc.patch
@@ -1,8 +1,8 @@
-Index: gcc-4.8.0/gcc/config/arm/linux-elf.h
+Index: b/gcc/config/arm/linux-elf.h
===================================================================
---- gcc-4.8.0.orig/gcc/config/arm/linux-elf.h 2013-01-10 21:38:27.000000000 +0100
-+++ gcc-4.8.0/gcc/config/arm/linux-elf.h 2013-03-23 17:40:00.000000000 +0100
-@@ -55,7 +55,7 @@
+--- a/gcc/config/arm/linux-elf.h
++++ b/gcc/config/arm/linux-elf.h
+@@ -60,7 +60,7 @@
%{shared:-lc} \
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"
@@ -11,10 +11,10 @@ Index: gcc-4.8.0/gcc/config/arm/linux-elf.h
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
-Index: gcc-4.8.0/libgcc/config/arm/t-linux
+Index: b/libgcc/config/arm/t-linux
===================================================================
---- gcc-4.8.0.orig/libgcc/config/arm/t-linux 2012-03-22 16:14:46.000000000 +0100
-+++ gcc-4.8.0/libgcc/config/arm/t-linux 2013-03-23 17:40:54.000000000 +0100
+--- a/libgcc/config/arm/t-linux
++++ b/libgcc/config/arm/t-linux
@@ -1,6 +1,11 @@
LIB1ASMSRC = arm/lib1funcs.S
LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
diff --git a/patches/gcc/6.1.0/830-arm_unbreak_armv4t.patch b/patches/gcc/6.2.0/830-arm_unbreak_armv4t.patch
index b730059..b730059 100644
--- a/patches/gcc/6.1.0/830-arm_unbreak_armv4t.patch
+++ b/patches/gcc/6.2.0/830-arm_unbreak_armv4t.patch
diff --git a/patches/gcc/6.2.0/831-ARM-PR-target-70473-Reduce-size-of-Cortex-A8-automat.patch b/patches/gcc/6.2.0/831-ARM-PR-target-70473-Reduce-size-of-Cortex-A8-automat.patch
new file mode 100644
index 0000000..af9fb1d
--- /dev/null
+++ b/patches/gcc/6.2.0/831-ARM-PR-target-70473-Reduce-size-of-Cortex-A8-automat.patch
@@ -0,0 +1,69 @@
+From 07453188b18a2cbe815917dbb893b4ebfdd793b6 Mon Sep 17 00:00:00 2001
+From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 26 Aug 2016 10:23:20 +0000
+Subject: [PATCH] [ARM] PR target/70473: Reduce size of Cortex-A8 automaton
+
+ PR target/70473
+ * config/arm/cortex-a8-neon.md (cortex_a8_vfp_muld): Reduce
+ reservation duration to 15 cycles.
+ (cortex_a8_vfp_macs): Likewise.
+ (cortex_a8_vfp_macd): Likewise.
+ (cortex_a8_vfp_divs): Likewise.
+ (cortex_a8_vfp_divd): Likewise.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239772
+138bc75d-0d04-0410-961f-82ee72b054a4
+
+[Backport from gcc upstream commit 79f5d5e3cd5a668d5ecb2b6b0cce80ef5706ac53.]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ gcc/config/arm/cortex-a8-neon.md | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/config/arm/cortex-a8-neon.md b/gcc/config/arm/cortex-a8-neon.md
+index 45f861f..b16c299 100644
+--- a/gcc/config/arm/cortex-a8-neon.md
++++ b/gcc/config/arm/cortex-a8-neon.md
+@@ -357,30 +357,34 @@
+ (eq_attr "type" "fmuls"))
+ "cortex_a8_vfp,cortex_a8_vfplite*11")
+
++;; Don't model a reservation for more than 15 cycles as this explodes the
++;; state space of the automaton for little gain. It is unlikely that the
++;; scheduler will find enough instructions to hide the full latency of the
++;; instructions.
+ (define_insn_reservation "cortex_a8_vfp_muld" 17
+ (and (eq_attr "tune" "cortexa8")
+ (eq_attr "type" "fmuld"))
+- "cortex_a8_vfp,cortex_a8_vfplite*16")
++ "cortex_a8_vfp,cortex_a8_vfplite*15")
+
+ (define_insn_reservation "cortex_a8_vfp_macs" 21
+ (and (eq_attr "tune" "cortexa8")
+ (eq_attr "type" "fmacs,ffmas"))
+- "cortex_a8_vfp,cortex_a8_vfplite*20")
++ "cortex_a8_vfp,cortex_a8_vfplite*15")
+
+ (define_insn_reservation "cortex_a8_vfp_macd" 26
+ (and (eq_attr "tune" "cortexa8")
+ (eq_attr "type" "fmacd,ffmad"))
+- "cortex_a8_vfp,cortex_a8_vfplite*25")
++ "cortex_a8_vfp,cortex_a8_vfplite*15")
+
+ (define_insn_reservation "cortex_a8_vfp_divs" 37
+ (and (eq_attr "tune" "cortexa8")
+ (eq_attr "type" "fdivs, fsqrts"))
+- "cortex_a8_vfp,cortex_a8_vfplite*36")
++ "cortex_a8_vfp,cortex_a8_vfplite*15")
+
+ (define_insn_reservation "cortex_a8_vfp_divd" 65
+ (and (eq_attr "tune" "cortexa8")
+ (eq_attr "type" "fdivd, fsqrtd"))
+- "cortex_a8_vfp,cortex_a8_vfplite*64")
++ "cortex_a8_vfp,cortex_a8_vfplite*15")
+
+ ;; Comparisons can actually take 7 cycles sometimes instead of four,
+ ;; but given all the other instructions lumped into type=ffarith that
+--
+2.7.4
+
diff --git a/patches/gcc/6.1.0/860-cilk-wchar.patch b/patches/gcc/6.2.0/860-cilk-wchar.patch
index 1d9916f..1d9916f 100644
--- a/patches/gcc/6.1.0/860-cilk-wchar.patch
+++ b/patches/gcc/6.2.0/860-cilk-wchar.patch
diff --git a/patches/gcc/6.2.0/870-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch b/patches/gcc/6.2.0/870-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch
new file mode 100644
index 0000000..6e0ce6e
--- /dev/null
+++ b/patches/gcc/6.2.0/870-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch
@@ -0,0 +1,62 @@
+From d28554ee61a1ab1263274d66386e4051bca0ce05 Mon Sep 17 00:00:00 2001
+From: jcmvbkbc <jcmvbkbc@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 18 Oct 2016 19:12:19 +0000
+Subject: [PATCH] xtensa: don't use unwind-dw2-fde-dip with elf targets
+
+Define LIB2ADDEH_XTENSA_UNWIND_DW2_FDE to unwind-dw2-fde.c in
+xtensa/t-elf and to unwind-dw2-fde-dip.c in xtensa/t-linux and use
+LIB2ADDEH_XTENSA_UNWIND_DW2_FDE in LIB2ADDEH definition.
+
+This fixes build for elf target with windowed xtensa core that currently
+breaks with the following error message:
+
+ unwind-dw2-fde-dip.c:36:40: fatal error: elf.h: No such file or directory
+
+2016-10-18 Max Filippov <jcmvbkbc@gmail.com>
+libgcc/
+ * config/xtensa/t-elf (LIB2ADDEH_XTENSA_UNWIND_DW2_FDE): New
+ definition.
+ * config/xtensa/t-linux (LIB2ADDEH_XTENSA_UNWIND_DW2_FDE): New
+ definition.
+ * config/xtensa/t-windowed (LIB2ADDEH): Use
+ LIB2ADDEH_XTENSA_UNWIND_DW2_FDE defined by either xtensa/t-elf
+ or xtensa/t-linux.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241313 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ libgcc/config/xtensa/t-elf | 2 ++
+ libgcc/config/xtensa/t-linux | 2 ++
+ libgcc/config/xtensa/t-windowed | 2 +-
+ 3 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/libgcc/config/xtensa/t-elf b/libgcc/config/xtensa/t-elf
+index 59d5121..967cf9b 100644
+--- a/libgcc/config/xtensa/t-elf
++++ b/libgcc/config/xtensa/t-elf
+@@ -3,3 +3,5 @@ CRTSTUFF_T_CFLAGS += -mlongcalls
+ CRTSTUFF_T_CFLAGS_S += -mlongcalls
+
+ HOST_LIBGCC2_CFLAGS += -mlongcalls
++
++LIB2ADDEH_XTENSA_UNWIND_DW2_FDE = $(srcdir)/unwind-dw2-fde.c
+diff --git a/libgcc/config/xtensa/t-linux b/libgcc/config/xtensa/t-linux
+index 6f4ae89..412ecca 100644
+--- a/libgcc/config/xtensa/t-linux
++++ b/libgcc/config/xtensa/t-linux
+@@ -1 +1,3 @@
+ SHLIB_MAPFILES += $(srcdir)/config/xtensa/libgcc-glibc.ver
++
++LIB2ADDEH_XTENSA_UNWIND_DW2_FDE = $(srcdir)/unwind-dw2-fde-dip.c
+diff --git a/libgcc/config/xtensa/t-windowed b/libgcc/config/xtensa/t-windowed
+index a99156c..f140136 100644
+--- a/libgcc/config/xtensa/t-windowed
++++ b/libgcc/config/xtensa/t-windowed
+@@ -1,2 +1,2 @@
+ LIB2ADDEH = $(srcdir)/config/xtensa/unwind-dw2-xtensa.c \
+- $(srcdir)/unwind-dw2-fde-dip.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
++ $(LIB2ADDEH_XTENSA_UNWIND_DW2_FDE) $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+--
+2.1.4
+
diff --git a/patches/gcc/6.2.0/871-xtensa-Fix-PR-target-78118.patch b/patches/gcc/6.2.0/871-xtensa-Fix-PR-target-78118.patch
new file mode 100644
index 0000000..c6ae103
--- /dev/null
+++ b/patches/gcc/6.2.0/871-xtensa-Fix-PR-target-78118.patch
@@ -0,0 +1,318 @@
+From bdda1689faf608ad7c83b5bd2e21a236b0047579 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Wed, 26 Oct 2016 08:02:51 +0000
+Subject: [PATCH] xtensa: Fix PR target/78118
+
+It started failing after the following commit: 32e90dc6a0cda45 ("PR
+rtl-optimization/61047").
+
+The change that made xtensa backend go ICE looks completely unrelated,
+and indeed, the issue is caused by the side effect of
+compute_frame_size() function call hidden in the
+INITIAL_ELIMINATION_OFFSET macro. This call updates the value of the
+xtensa_current_frame_size static variable, used in "return" instruction
+predicate. Prior to the change the value of xtensa_current_frame_size was
+set to 0 after the end of epilogue generation, which enabled the "return"
+instruction for the CALL0 ABI, but after the change the additional
+INITIAL_ELIMINATION_OFFSET calls make xtensa_current_frame_size non-zero
+and "return" pattern unavailable.
+
+Get rid of the global xtensa_current_frame_size and
+xtensa_callee_save_size variables by moving them into the
+machine_function structure. Implement predicate for the "return" pattern
+as a function. Don't communicate completion of epilogue generation
+through zeroing of xtensa_current_frame_size, add explicit epilogue_done
+variable to the machine_function structure. Don't update stack frame
+layout after the completion of reload.
+
+2016-10-26 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/xtensa-protos.h
+ (xtensa_use_return_instruction_p): New prototype.
+ * config/xtensa/xtensa.c (xtensa_current_frame_size,
+ xtensa_callee_save_size): Remove.
+ (struct machine_function): Add new fields: current_frame_size,
+ callee_save_size, frame_laid_out and epilogue_done.
+ (compute_frame_size, xtensa_expand_prologue,
+ xtensa_expand_epilogue): Replace xtensa_callee_save_size with
+ cfun->machine->callee_save_size and xtensa_current_frame_size
+ with cfun->machine->current_frame_size.
+ (compute_frame_size): Update cfun->machine->frame_laid_out and
+ don't update frame layout after reload completion.
+ (xtensa_expand_epilogue): Set cfun->machine->epilogue_done
+ instead of zeroing xtensa_current_frame_size.
+ (xtensa_use_return_instruction_p): New function.
+ * config/xtensa/xtensa.h (xtensa_current_frame_size): Remove
+ declaration.
+ (INITIAL_ELIMINATION_OFFSET): Use return value of
+ compute_frame_size instead of xtensa_current_frame_size value.
+ * config/xtensa/xtensa.md ("return" pattern): Use new predicate
+ function xtensa_use_return_instruction_p instead of inline code.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gcc/config/xtensa/xtensa-protos.h | 1 +
+ gcc/config/xtensa/xtensa.c | 82 ++++++++++++++++++++++++---------------
+ gcc/config/xtensa/xtensa.h | 6 +--
+ gcc/config/xtensa/xtensa.md | 2 +-
+ 4 files changed, 55 insertions(+), 36 deletions(-)
+
+diff --git a/gcc/config/xtensa/xtensa-protos.h b/gcc/config/xtensa/xtensa-protos.h
+index f2ca526..873557f 100644
+--- a/gcc/config/xtensa/xtensa-protos.h
++++ b/gcc/config/xtensa/xtensa-protos.h
+@@ -68,6 +68,7 @@ extern rtx xtensa_return_addr (int, rtx);
+ extern void xtensa_setup_frame_addresses (void);
+ extern int xtensa_dbx_register_number (int);
+ extern long compute_frame_size (int);
++extern bool xtensa_use_return_instruction_p (void);
+ extern void xtensa_expand_prologue (void);
+ extern void xtensa_expand_epilogue (void);
+ extern void order_regs_for_local_alloc (void);
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index 64d089b..e49f784 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -78,11 +78,6 @@ enum internal_test
+ can support a given mode. */
+ char xtensa_hard_regno_mode_ok[(int) MAX_MACHINE_MODE][FIRST_PSEUDO_REGISTER];
+
+-/* Current frame size calculated by compute_frame_size. */
+-unsigned xtensa_current_frame_size;
+-/* Callee-save area size in the current frame calculated by compute_frame_size. */
+-int xtensa_callee_save_size;
+-
+ /* Largest block move to handle in-line. */
+ #define LARGEST_MOVE_RATIO 15
+
+@@ -94,6 +89,13 @@ struct GTY(()) machine_function
+ bool vararg_a7;
+ rtx vararg_a7_copy;
+ rtx_insn *set_frame_ptr_insn;
++ /* Current frame size calculated by compute_frame_size. */
++ unsigned current_frame_size;
++ /* Callee-save area size in the current frame calculated by
++ compute_frame_size. */
++ int callee_save_size;
++ bool frame_laid_out;
++ bool epilogue_done;
+ };
+
+ /* Vector, indexed by hard register number, which contains 1 for a
+@@ -2628,24 +2630,29 @@ compute_frame_size (int size)
+ {
+ int regno;
+
++ if (reload_completed && cfun->machine->frame_laid_out)
++ return cfun->machine->current_frame_size;
++
+ /* Add space for the incoming static chain value. */
+ if (cfun->static_chain_decl != NULL)
+ size += (1 * UNITS_PER_WORD);
+
+- xtensa_callee_save_size = 0;
++ cfun->machine->callee_save_size = 0;
+ for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno)
+ {
+ if (xtensa_call_save_reg(regno))
+- xtensa_callee_save_size += UNITS_PER_WORD;
++ cfun->machine->callee_save_size += UNITS_PER_WORD;
+ }
+
+- xtensa_current_frame_size =
++ cfun->machine->current_frame_size =
+ XTENSA_STACK_ALIGN (size
+- + xtensa_callee_save_size
++ + cfun->machine->callee_save_size
+ + crtl->outgoing_args_size
+ + (WINDOW_SIZE * UNITS_PER_WORD));
+- xtensa_callee_save_size = XTENSA_STACK_ALIGN (xtensa_callee_save_size);
+- return xtensa_current_frame_size;
++ cfun->machine->callee_save_size =
++ XTENSA_STACK_ALIGN (cfun->machine->callee_save_size);
++ cfun->machine->frame_laid_out = true;
++ return cfun->machine->current_frame_size;
+ }
+
+
+@@ -2696,6 +2703,7 @@ xtensa_expand_prologue (void)
+ {
+ int regno;
+ HOST_WIDE_INT offset = 0;
++ int callee_save_size = cfun->machine->callee_save_size;
+
+ /* -128 is a limit of single addi instruction. */
+ if (total_size > 0 && total_size <= 128)
+@@ -2709,7 +2717,7 @@ xtensa_expand_prologue (void)
+ add_reg_note (insn, REG_FRAME_RELATED_EXPR, note_rtx);
+ offset = total_size - UNITS_PER_WORD;
+ }
+- else if (xtensa_callee_save_size)
++ else if (callee_save_size)
+ {
+ /* 1020 is maximal s32i offset, if the frame is bigger than that
+ * we move sp to the end of callee-saved save area, save and then
+@@ -2717,13 +2725,13 @@ xtensa_expand_prologue (void)
+ if (total_size > 1024)
+ {
+ insn = emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
+- GEN_INT (-xtensa_callee_save_size)));
++ GEN_INT (-callee_save_size)));
+ RTX_FRAME_RELATED_P (insn) = 1;
+ note_rtx = gen_rtx_SET (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
+- -xtensa_callee_save_size));
++ -callee_save_size));
+ add_reg_note (insn, REG_FRAME_RELATED_EXPR, note_rtx);
+- offset = xtensa_callee_save_size - UNITS_PER_WORD;
++ offset = callee_save_size - UNITS_PER_WORD;
+ }
+ else
+ {
+@@ -2759,13 +2767,13 @@ xtensa_expand_prologue (void)
+ {
+ rtx tmp_reg = gen_rtx_REG (Pmode, A9_REG);
+ emit_move_insn (tmp_reg, GEN_INT (total_size -
+- xtensa_callee_save_size));
++ callee_save_size));
+ insn = emit_insn (gen_subsi3 (stack_pointer_rtx,
+ stack_pointer_rtx, tmp_reg));
+ RTX_FRAME_RELATED_P (insn) = 1;
+ note_rtx = gen_rtx_SET (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
+- xtensa_callee_save_size -
++ callee_save_size -
+ total_size));
+ add_reg_note (insn, REG_FRAME_RELATED_EXPR, note_rtx);
+ }
+@@ -2833,21 +2841,21 @@ xtensa_expand_epilogue (void)
+ int regno;
+ HOST_WIDE_INT offset;
+
+- if (xtensa_current_frame_size > (frame_pointer_needed ? 127 : 1024))
++ if (cfun->machine->current_frame_size > (frame_pointer_needed ? 127 : 1024))
+ {
+ rtx tmp_reg = gen_rtx_REG (Pmode, A9_REG);
+- emit_move_insn (tmp_reg, GEN_INT (xtensa_current_frame_size -
+- xtensa_callee_save_size));
++ emit_move_insn (tmp_reg, GEN_INT (cfun->machine->current_frame_size -
++ cfun->machine->callee_save_size));
+ emit_insn (gen_addsi3 (stack_pointer_rtx, frame_pointer_needed ?
+ hard_frame_pointer_rtx : stack_pointer_rtx,
+ tmp_reg));
+- offset = xtensa_callee_save_size - UNITS_PER_WORD;
++ offset = cfun->machine->callee_save_size - UNITS_PER_WORD;
+ }
+ else
+ {
+ if (frame_pointer_needed)
+ emit_move_insn (stack_pointer_rtx, hard_frame_pointer_rtx);
+- offset = xtensa_current_frame_size - UNITS_PER_WORD;
++ offset = cfun->machine->current_frame_size - UNITS_PER_WORD;
+ }
+
+ /* Prevent reordering of saved a0 update and loading it back from
+@@ -2867,16 +2875,16 @@ xtensa_expand_epilogue (void)
+ }
+ }
+
+- if (xtensa_current_frame_size > 0)
++ if (cfun->machine->current_frame_size > 0)
+ {
+ if (frame_pointer_needed || /* always reachable with addi */
+- xtensa_current_frame_size > 1024 ||
+- xtensa_current_frame_size <= 127)
++ cfun->machine->current_frame_size > 1024 ||
++ cfun->machine->current_frame_size <= 127)
+ {
+- if (xtensa_current_frame_size <= 127)
+- offset = xtensa_current_frame_size;
++ if (cfun->machine->current_frame_size <= 127)
++ offset = cfun->machine->current_frame_size;
+ else
+- offset = xtensa_callee_save_size;
++ offset = cfun->machine->callee_save_size;
+
+ emit_insn (gen_addsi3 (stack_pointer_rtx,
+ stack_pointer_rtx,
+@@ -2885,7 +2893,8 @@ xtensa_expand_epilogue (void)
+ else
+ {
+ rtx tmp_reg = gen_rtx_REG (Pmode, A9_REG);
+- emit_move_insn (tmp_reg, GEN_INT (xtensa_current_frame_size));
++ emit_move_insn (tmp_reg,
++ GEN_INT (cfun->machine->current_frame_size));
+ emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
+ tmp_reg));
+ }
+@@ -2896,11 +2905,22 @@ xtensa_expand_epilogue (void)
+ stack_pointer_rtx,
+ EH_RETURN_STACKADJ_RTX));
+ }
+- xtensa_current_frame_size = 0;
+- xtensa_callee_save_size = 0;
++ cfun->machine->epilogue_done = true;
+ emit_jump_insn (gen_return ());
+ }
+
++bool
++xtensa_use_return_instruction_p (void)
++{
++ if (!reload_completed)
++ return false;
++ if (TARGET_WINDOWED_ABI)
++ return true;
++ if (compute_frame_size (get_frame_size ()) == 0)
++ return true;
++ return cfun->machine->epilogue_done;
++}
++
+ void
+ xtensa_set_return_address (rtx address, rtx scratch)
+ {
+diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
+index 82e9900..58eb1b2 100644
+--- a/gcc/config/xtensa/xtensa.h
++++ b/gcc/config/xtensa/xtensa.h
+@@ -23,8 +23,6 @@ along with GCC; see the file COPYING3. If not see
+
+ /* External variables defined in xtensa.c. */
+
+-extern unsigned xtensa_current_frame_size;
+-
+ /* Macros used in the machine description to select various Xtensa
+ configuration options. */
+ #ifndef XCHAL_HAVE_MUL32_HIGH
+@@ -477,14 +475,14 @@ enum reg_class
+ /* Specify the initial difference between the specified pair of registers. */
+ #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
+ do { \
+- compute_frame_size (get_frame_size ()); \
++ long frame_size = compute_frame_size (get_frame_size ()); \
+ switch (FROM) \
+ { \
+ case FRAME_POINTER_REGNUM: \
+ (OFFSET) = 0; \
+ break; \
+ case ARG_POINTER_REGNUM: \
+- (OFFSET) = xtensa_current_frame_size; \
++ (OFFSET) = frame_size; \
+ break; \
+ default: \
+ gcc_unreachable (); \
+diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
+index db54a12..fcdb6c8 100644
+--- a/gcc/config/xtensa/xtensa.md
++++ b/gcc/config/xtensa/xtensa.md
+@@ -1663,7 +1663,7 @@
+ (define_insn "return"
+ [(return)
+ (use (reg:SI A0_REG))]
+- "(TARGET_WINDOWED_ABI || !xtensa_current_frame_size) && reload_completed"
++ "xtensa_use_return_instruction_p ()"
+ {
+ return TARGET_WINDOWED_ABI ?
+ (TARGET_DENSITY ? "retw.n" : "retw") :
+--
+2.1.4
+
diff --git a/patches/gcc/6.2.0/872-xtensa-Fix-PR-target-78603.patch b/patches/gcc/6.2.0/872-xtensa-Fix-PR-target-78603.patch
new file mode 100644
index 0000000..669097c
--- /dev/null
+++ b/patches/gcc/6.2.0/872-xtensa-Fix-PR-target-78603.patch
@@ -0,0 +1,35 @@
+From a568f3a84ff41ca272301a5fcf31071143e97e0f Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Tue, 29 Nov 2016 13:09:17 -0800
+Subject: [PATCH] xtensa: Fix PR target/78603
+
+2016-11-29 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/xtensa.c (hwloop_optimize): Don't emit zero
+ overhead loop start between a call and its CALL_ARG_LOCATION
+ note.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gcc/config/xtensa/xtensa.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index e49f784..70f698a 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -4158,7 +4158,10 @@ hwloop_optimize (hwloop_info loop)
+ entry_after = BB_END (entry_bb);
+ while (DEBUG_INSN_P (entry_after)
+ || (NOTE_P (entry_after)
+- && NOTE_KIND (entry_after) != NOTE_INSN_BASIC_BLOCK))
++ && NOTE_KIND (entry_after) != NOTE_INSN_BASIC_BLOCK
++ /* Make sure we don't split a call and its corresponding
++ CALL_ARG_LOCATION note. */
++ && NOTE_KIND (entry_after) != NOTE_INSN_CALL_ARG_LOCATION))
+ entry_after = PREV_INSN (entry_after);
+
+ emit_insn_after (seq, entry_after);
+--
+2.1.4
+
diff --git a/patches/gcc/6.2.0/890-fix-m68k-compile.patch b/patches/gcc/6.2.0/890-fix-m68k-compile.patch
new file mode 100644
index 0000000..6e63de0
--- /dev/null
+++ b/patches/gcc/6.2.0/890-fix-m68k-compile.patch
@@ -0,0 +1,15 @@
+remove unused header, which breaks the toolchain building
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+diff -Nur gcc-5.3.0.orig/libgcc/config/m68k/linux-atomic.c gcc-5.3.0/libgcc/config/m68k/linux-atomic.c
+--- gcc-5.3.0.orig/libgcc/config/m68k/linux-atomic.c 2015-01-05 13:33:28.000000000 +0100
++++ gcc-5.3.0/libgcc/config/m68k/linux-atomic.c 2016-03-19 09:25:07.000000000 +0100
+@@ -33,7 +33,6 @@
+ using the kernel helper defined below. There is no support for
+ 64-bit operations yet. */
+
+-#include <asm/unistd.h>
+ #include <stdbool.h>
+
+ #ifndef __NR_atomic_cmpxchg_32
diff --git a/patches/gcc/6.2.0/891-fix-m68k-uclinux.patch b/patches/gcc/6.2.0/891-fix-m68k-uclinux.patch
new file mode 100644
index 0000000..4e186bd
--- /dev/null
+++ b/patches/gcc/6.2.0/891-fix-m68k-uclinux.patch
@@ -0,0 +1,18 @@
+avoids internal compiler error while compiling linux-atomic.c
+See here:
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53833
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+diff -Nur gcc-5.3.0.orig/libgcc/config.host gcc-5.3.0/libgcc/config.host
+--- gcc-5.3.0.orig/libgcc/config.host 2015-10-01 14:01:18.000000000 +0200
++++ gcc-5.3.0/libgcc/config.host 2016-04-26 21:30:25.353691745 +0200
+@@ -794,7 +794,7 @@
+ m68k*-*-openbsd*)
+ ;;
+ m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux with uClibc
+- tmake_file="$tmake_file m68k/t-floatlib m68k/t-linux"
++ tmake_file="$tmake_file m68k/t-floatlib"
+ md_unwind_header=m68k/linux-unwind.h
+ ;;
+ m68k-*-linux*) # Motorola m68k's running GNU/Linux
diff --git a/patches/gcc/6.2.0/892-libgcc-mkmap-symver-support-skip_underscore.patch b/patches/gcc/6.2.0/892-libgcc-mkmap-symver-support-skip_underscore.patch
new file mode 100644
index 0000000..73ee6c5
--- /dev/null
+++ b/patches/gcc/6.2.0/892-libgcc-mkmap-symver-support-skip_underscore.patch
@@ -0,0 +1,60 @@
+From ae9c3e354440c4a0f105a9eabfb2f77be085ebc1 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Thu, 18 Aug 2016 17:59:16 +0200
+Subject: [PATCH] libgcc/mkmap-symver: support skip_underscore
+
+Some platforms, such as Blackfin, have a special prefix for assembly
+symbols as opposed to C symbols. For this reason, a function named
+"foo()" in C will in fact be visible as a symbol called "_foo" in the
+ELF binary.
+
+The current linker version script logic in libgcc doesn't take into
+account this situation properly. The Blackfin specific
+libgcc/config/bfin/libgcc-glibc.ver has an additional "_" in front of
+every symbol so that it matches the output of "nm" (which gets parsed to
+produce the final linker version script). But due to this additional
+"_", ld no longer matches with the symbols since "ld" does the matching
+with the original symbol name, not the one prefixed with "_".
+
+Due to this, none of the symbols in libgcc/config/bfin/libgcc-glibc.ver
+are actually matched with symbols in libgcc. This causes all libgcc
+symbols to be left as "LOCAL", which causes lots of "undefined
+reference" whenever some C or C++ code that calls a function of libgcc
+is compiled.
+
+To address this, this commit introduces a "skip_underscore" variable to
+the mkmap-symver script. It tells mkmap-symver to ignore the leading
+underscore from the "nm" output.
+
+Note that this new argument is different from the existing
+"leading_underscore" argument, which *adds* an additional underscore to
+the generated linker version script.
+
+Having this functionality paves the way to using the generic linker
+version information for Blackfin, instead of using a custom one.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ libgcc/mkmap-symver.awk | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/libgcc/mkmap-symver.awk b/libgcc/mkmap-symver.awk
+index 266832a..30bb179 100644
+--- a/libgcc/mkmap-symver.awk
++++ b/libgcc/mkmap-symver.awk
+@@ -47,7 +47,11 @@ state == "nm" && ($1 == "U" || $2 == "U") {
+
+ state == "nm" && NF == 3 {
+ split ($3, s, "@")
+- def[s[1]] = 1;
++ if (skip_underscore)
++ symname = substr(s[1], 2);
++ else
++ symname = s[1];
++ def[symname] = 1;
+ sawsymbol = 1;
+ next;
+ }
+--
+2.7.4
+
diff --git a/patches/gcc/6.2.0/893-libgcc-config-bfin-use-the-generic-linker-version-in.patch b/patches/gcc/6.2.0/893-libgcc-config-bfin-use-the-generic-linker-version-in.patch
new file mode 100644
index 0000000..454295d
--- /dev/null
+++ b/patches/gcc/6.2.0/893-libgcc-config-bfin-use-the-generic-linker-version-in.patch
@@ -0,0 +1,1944 @@
+From 56d606931716de30a89a40dc69a9282c1b4e2880 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Thu, 18 Aug 2016 18:04:06 +0200
+Subject: [PATCH] libgcc/config/bfin: use the generic linker version
+ information
+
+This commit makes the Blackfin platform use the generic linker version
+information, rather than a completely duplicated file, specific for the
+Blackfin architecture.
+
+This is made possible using the newly introduced skip_underscore
+variable of the mkmap-symver script.
+
+This also allows to get a correct linker version file, with symbol names
+matching the ones found in libgcc. Thanks to this, the necessary symbols
+are marked "GLOBAL" instead of "LOCAL", which makes them visible at link
+time, and solves a large number of "undefined reference"
+issues. Indeed, the Blackfin specific linker version script had an extra
+underscore in front of all symbols, which meant none of them matched the
+symbols in libgcc, and therefore all libgcc symbols were marked as
+"LOCAL", making them invisible for linking.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ libgcc/config/bfin/libgcc-glibc.ver | 1894 +----------------------------------
+ libgcc/config/bfin/t-linux | 3 +-
+ 2 files changed, 4 insertions(+), 1893 deletions(-)
+
+diff --git a/libgcc/config/bfin/libgcc-glibc.ver b/libgcc/config/bfin/libgcc-glibc.ver
+index b1bd2df..2af3df7 100644
+--- a/libgcc/config/bfin/libgcc-glibc.ver
++++ b/libgcc/config/bfin/libgcc-glibc.ver
+@@ -16,1898 +16,8 @@
+ # along with GCC; see the file COPYING3. If not see
+ # <http://www.gnu.org/licenses/>.
+
+-GCC_3.0 {
+- # libgcc1 integer symbols
+- ___absvsi2
+- ___addvsi3
+- ___ashlsi3
+- ___ashrsi3
+- ___divsi3
+- ___lshrsi3
+- ___modsi3
+- ___mulsi3
+- ___mulvsi3
+- ___negvsi2
+- ___subvsi3
+- ___udivsi3
+- ___umodsi3
+-
+- # libgcc1 floating point symbols
+- ___addsf3
+- ___adddf3
+- ___addxf3
+- ___addtf3
+- ___divsf3
+- ___divdf3
+- ___divxf3
+- ___divtf3
+- ___eqsf2
+- ___eqdf2
+- ___eqxf2
+- ___eqtf2
+- ___extenddfxf2
+- ___extenddftf2
+- ___extendsfdf2
+- ___extendsfxf2
+- ___extendsftf2
+- ___fixsfsi
+- ___fixdfsi
+- ___fixxfsi
+- ___fixtfsi
+- ___floatsisf
+- ___floatsidf
+- ___floatsixf
+- ___floatsitf
+- ___gesf2
+- ___gedf2
+- ___gexf2
+- ___getf2
+- ___gtsf2
+- ___gtdf2
+- ___gtxf2
+- ___gttf2
+- ___lesf2
+- ___ledf2
+- ___lexf2
+- ___letf2
+- ___ltsf2
+- ___ltdf2
+- ___ltxf2
+- ___lttf2
+- ___mulsf3
+- ___muldf3
+- ___mulxf3
+- ___multf3
+- ___negsf2
+- ___negdf2
+- ___negxf2
+- ___negtf2
+- ___nesf2
+- ___nedf2
+- ___nexf2
+- ___netf2
+- ___subsf3
+- ___subdf3
+- ___subxf3
+- ___subtf3
+- ___truncdfsf2
+- ___truncxfsf2
+- ___trunctfsf2
+- ___truncxfdf2
+- ___trunctfdf2
+-
+- # libgcc2 DImode arithmetic (for 32-bit targets).
+- ___absvdi2
+- ___addvdi3
+- ___ashldi3
+- ___ashrdi3
+- ___cmpdi2
+- ___divdi3
+- ___ffsdi2
+- ___fixdfdi
+- ___fixsfdi
+- ___fixtfdi
+- ___fixxfdi
+- ___fixunsdfdi
+- ___fixunsdfsi
+- ___fixunssfsi
+- ___fixunssfdi
+- ___fixunstfdi
+- ___fixunstfsi
+- ___fixunsxfdi
+- ___fixunsxfsi
+- ___floatdidf
+- ___floatdisf
+- ___floatdixf
+- ___floatditf
+- ___lshrdi3
+- ___moddi3
+- ___muldi3
+- ___mulvdi3
+- ___negdi2
+- ___negvdi2
+- ___subvdi3
+- ___ucmpdi2
+- ___udivdi3
+- ___udivmoddi4
+- ___umoddi3
+-
+- # libgcc2 TImode arithmetic (for 64-bit targets).
+- ___ashlti3
+- ___ashrti3
+- ___cmpti2
+- ___divti3
+- ___ffsti2
+- ___fixdfti
+- ___fixsfti
+- ___fixtfti
+- ___fixxfti
+- ___lshrti3
+- ___modti3
+- ___multi3
+- ___negti2
+- ___ucmpti2
+- ___udivmodti4
+- ___udivti3
+- ___umodti3
+- ___fixunsdfti
+- ___fixunssfti
+- ___fixunstfti
+- ___fixunsxfti
+- ___floattidf
+- ___floattisf
+- ___floattixf
+- ___floattitf
+-
+- # Used to deal with trampoline initialization on some platforms
+- ___clear_cache
+-
+- # EH symbols
+- __Unwind_DeleteException
+- __Unwind_Find_FDE
+- __Unwind_ForcedUnwind
+- __Unwind_GetGR
+- __Unwind_GetIP
+- __Unwind_GetLanguageSpecificData
+- __Unwind_GetRegionStart
+- __Unwind_GetTextRelBase
+- __Unwind_GetDataRelBase
+- __Unwind_RaiseException
+- __Unwind_Resume
+- __Unwind_SetGR
+- __Unwind_SetIP
+- ___deregister_frame
+- ___deregister_frame_info
+- ___deregister_frame_info_bases
+- ___register_frame
+- ___register_frame_info
+- ___register_frame_info_bases
+- ___register_frame_info_table
+- ___register_frame_info_table_bases
+- ___register_frame_table
+-
+- # SjLj EH symbols
+- __Unwind_SjLj_Register
+- __Unwind_SjLj_Unregister
+- __Unwind_SjLj_RaiseException
+- __Unwind_SjLj_ForcedUnwind
+- __Unwind_SjLj_Resume
+-}
+-
+-%inherit GCC_3.3 GCC_3.0
+-GCC_3.3 {
+- __Unwind_FindEnclosingFunction
+- __Unwind_GetCFA
+- __Unwind_Backtrace
+- __Unwind_Resume_or_Rethrow
+- __Unwind_SjLj_Resume_or_Rethrow
+-}
+-
+-%inherit GCC_3.3.1 GCC_3.3
+-GCC_3.3.1 {
+- ___gcc_personality_sj0
+- ___gcc_personality_v0
+-}
+-
+-%inherit GCC_3.3.2 GCC_3.3.1
+-GCC_3.3.2 {
+-}
+-%inherit GCC_3.3.4 GCC_3.3.2
+-GCC_3.3.4 {
+- ___unorddf2
+- ___unordsf2
+-}
+-
+-%inherit GCC_3.4 GCC_3.3.4
+-GCC_3.4 {
+- # bit scanning and counting built-ins
+- ___clzsi2
+- ___clzdi2
+- ___clzti2
+- ___ctzsi2
+- ___ctzdi2
+- ___ctzti2
+- ___popcountsi2
+- ___popcountdi2
+- ___popcountti2
+- ___paritysi2
+- ___paritydi2
+- ___parityti2
+-}
+-
+-%inherit GCC_3.4.2 GCC_3.4
+-GCC_3.4.2 {
+- # Used to deal with trampoline initialization on some platforms
+- ___enable_execute_stack
+- ___trampoline_setup
+-}
+-
+-%inherit GCC_3.4.4 GCC_3.4.2
+-GCC_3.4.4 {
+- # libgcc2 TImode arithmetic (for 64-bit targets).
+- ___absvti2
+- ___addvti3
+- ___mulvti3
+- ___negvti2
+- ___subvti3
+-}
+-
+-%inherit GCC_4.0.0 GCC_3.4.4
+-GCC_4.0.0 {
+- # libgcc2 __builtin_powi helpers.
+- ___powisf2
+- ___powidf2
+- ___powixf2
+- ___powitf2
+-
+- # c99 compliant complex arithmetic
+- ___divsc3
+- ___divdc3
+- ___divxc3
+- ___divtc3
+- ___mulsc3
+- ___muldc3
+- ___mulxc3
+- ___multc3
+-}
+-
+ %inherit GCC_4.1.0 GCC_4.0.0
+ GCC_4.1.0 {
+- ___smulsi3_highpart
+- ___umulsi3_highpart
+-}
+-
+-%inherit GCC_4.2.0 GCC_4.1.0
+-GCC_4.2.0 {
+- # unsigned-to-floating conversions
+- ___floatunsisf
+- ___floatunsidf
+- ___floatunsixf
+- ___floatunsitf
+- ___floatundidf
+- ___floatundisf
+- ___floatundixf
+- ___floatunditf
+- ___floatuntidf
+- ___floatuntisf
+- ___floatuntixf
+- ___floatuntitf
+- __Unwind_GetIPInfo
+-}
+-
+-%inherit GCC_4.3.0 GCC_4.2.0
+-GCC_4.3.0 {
+- # byte swapping routines
+- ___bswapsi2
+- ___bswapdi2
+- ___emutls_get_address
+- ___emutls_register_common
+- ___ffssi2
+- ___extendxftf2
+- ___trunctfxf2
+-
+- # fixed-point routines
+- ___addqq3
+- ___addhq3
+- ___addsq3
+- ___adddq3
+- ___addtq3
+- ___adduqq3
+- ___adduhq3
+- ___addusq3
+- ___addudq3
+- ___addutq3
+- ___addha3
+- ___addsa3
+- ___addda3
+- ___addta3
+- ___adduha3
+- ___addusa3
+- ___adduda3
+- ___adduta3
+- ___ssaddqq3
+- ___ssaddhq3
+- ___ssaddsq3
+- ___ssadddq3
+- ___ssaddtq3
+- ___ssaddha3
+- ___ssaddsa3
+- ___ssaddda3
+- ___ssaddta3
+- ___usadduqq3
+- ___usadduhq3
+- ___usaddusq3
+- ___usaddudq3
+- ___usaddutq3
+- ___usadduha3
+- ___usaddusa3
+- ___usadduda3
+- ___usadduta3
+- ___subqq3
+- ___subhq3
+- ___subsq3
+- ___subdq3
+- ___subtq3
+- ___subuqq3
+- ___subuhq3
+- ___subusq3
+- ___subudq3
+- ___subutq3
+- ___subha3
+- ___subsa3
+- ___subda3
+- ___subta3
+- ___subuha3
+- ___subusa3
+- ___subuda3
+- ___subuta3
+- ___sssubqq3
+- ___sssubhq3
+- ___sssubsq3
+- ___sssubdq3
+- ___sssubtq3
+- ___sssubha3
+- ___sssubsa3
+- ___sssubda3
+- ___sssubta3
+- ___ussubuqq3
+- ___ussubuhq3
+- ___ussubusq3
+- ___ussubudq3
+- ___ussubutq3
+- ___ussubuha3
+- ___ussubusa3
+- ___ussubuda3
+- ___ussubuta3
+- ___mulqq3
+- ___mulhq3
+- ___mulsq3
+- ___muldq3
+- ___multq3
+- ___muluqq3
+- ___muluhq3
+- ___mulusq3
+- ___muludq3
+- ___mulutq3
+- ___mulha3
+- ___mulsa3
+- ___mulda3
+- ___multa3
+- ___muluha3
+- ___mulusa3
+- ___muluda3
+- ___muluta3
+- ___ssmulqq3
+- ___ssmulhq3
+- ___ssmulsq3
+- ___ssmuldq3
+- ___ssmultq3
+- ___ssmulha3
+- ___ssmulsa3
+- ___ssmulda3
+- ___ssmulta3
+- ___usmuluqq3
+- ___usmuluhq3
+- ___usmulusq3
+- ___usmuludq3
+- ___usmulutq3
+- ___usmuluha3
+- ___usmulusa3
+- ___usmuluda3
+- ___usmuluta3
+- ___divqq3
+- ___divhq3
+- ___divsq3
+- ___divdq3
+- ___divtq3
+- ___divha3
+- ___divsa3
+- ___divda3
+- ___divta3
+- ___udivuqq3
+- ___udivuhq3
+- ___udivusq3
+- ___udivudq3
+- ___udivutq3
+- ___udivuha3
+- ___udivusa3
+- ___udivuda3
+- ___udivuta3
+- ___ssdivqq3
+- ___ssdivhq3
+- ___ssdivsq3
+- ___ssdivdq3
+- ___ssdivtq3
+- ___ssdivha3
+- ___ssdivsa3
+- ___ssdivda3
+- ___ssdivta3
+- ___usdivuqq3
+- ___usdivuhq3
+- ___usdivusq3
+- ___usdivudq3
+- ___usdivutq3
+- ___usdivuha3
+- ___usdivusa3
+- ___usdivuda3
+- ___usdivuta3
+- ___negqq2
+- ___neghq2
+- ___negsq2
+- ___negdq2
+- ___negtq2
+- ___neguqq2
+- ___neguhq2
+- ___negusq2
+- ___negudq2
+- ___negutq2
+- ___negha2
+- ___negsa2
+- ___negda2
+- ___negta2
+- ___neguha2
+- ___negusa2
+- ___neguda2
+- ___neguta2
+- ___ssnegqq2
+- ___ssneghq2
+- ___ssnegsq2
+- ___ssnegdq2
+- ___ssnegtq2
+- ___ssnegha2
+- ___ssnegsa2
+- ___ssnegda2
+- ___ssnegta2
+- ___usneguqq2
+- ___usneguhq2
+- ___usnegusq2
+- ___usnegudq2
+- ___usnegutq2
+- ___usneguha2
+- ___usnegusa2
+- ___usneguda2
+- ___usneguta2
+- ___ashlqq3
+- ___ashlhq3
+- ___ashlsq3
+- ___ashldq3
+- ___ashltq3
+- ___ashluqq3
+- ___ashluhq3
+- ___ashlusq3
+- ___ashludq3
+- ___ashlutq3
+- ___ashlha3
+- ___ashlsa3
+- ___ashlda3
+- ___ashlta3
+- ___ashluha3
+- ___ashlusa3
+- ___ashluda3
+- ___ashluta3
+- ___ashrqq3
+- ___ashrhq3
+- ___ashrsq3
+- ___ashrdq3
+- ___ashrtq3
+- ___ashrha3
+- ___ashrsa3
+- ___ashrda3
+- ___ashrta3
+- ___lshruqq3
+- ___lshruhq3
+- ___lshrusq3
+- ___lshrudq3
+- ___lshrutq3
+- ___lshruha3
+- ___lshrusa3
+- ___lshruda3
+- ___lshruta3
+- ___ssashlqq3
+- ___ssashlhq3
+- ___ssashlsq3
+- ___ssashldq3
+- ___ssashltq3
+- ___ssashlha3
+- ___ssashlsa3
+- ___ssashlda3
+- ___ssashlta3
+- ___usashluqq3
+- ___usashluhq3
+- ___usashlusq3
+- ___usashludq3
+- ___usashlutq3
+- ___usashluha3
+- ___usashlusa3
+- ___usashluda3
+- ___usashluta3
+- ___cmpqq2
+- ___cmphq2
+- ___cmpsq2
+- ___cmpdq2
+- ___cmptq2
+- ___cmpuqq2
+- ___cmpuhq2
+- ___cmpusq2
+- ___cmpudq2
+- ___cmputq2
+- ___cmpha2
+- ___cmpsa2
+- ___cmpda2
+- ___cmpta2
+- ___cmpuha2
+- ___cmpusa2
+- ___cmpuda2
+- ___cmputa2
+- ___fractqqhq2
+- ___fractqqsq2
+- ___fractqqdq2
+- ___fractqqtq2
+- ___fractqqha
+- ___fractqqsa
+- ___fractqqda
+- ___fractqqta
+- ___fractqquqq
+- ___fractqquhq
+- ___fractqqusq
+- ___fractqqudq
+- ___fractqqutq
+- ___fractqquha
+- ___fractqqusa
+- ___fractqquda
+- ___fractqquta
+- ___fractqqqi
+- ___fractqqhi
+- ___fractqqsi
+- ___fractqqdi
+- ___fractqqti
+- ___fractqqsf
+- ___fractqqdf
+- ___fracthqqq2
+- ___fracthqsq2
+- ___fracthqdq2
+- ___fracthqtq2
+- ___fracthqha
+- ___fracthqsa
+- ___fracthqda
+- ___fracthqta
+- ___fracthquqq
+- ___fracthquhq
+- ___fracthqusq
+- ___fracthqudq
+- ___fracthqutq
+- ___fracthquha
+- ___fracthqusa
+- ___fracthquda
+- ___fracthquta
+- ___fracthqqi
+- ___fracthqhi
+- ___fracthqsi
+- ___fracthqdi
+- ___fracthqti
+- ___fracthqsf
+- ___fracthqdf
+- ___fractsqqq2
+- ___fractsqhq2
+- ___fractsqdq2
+- ___fractsqtq2
+- ___fractsqha
+- ___fractsqsa
+- ___fractsqda
+- ___fractsqta
+- ___fractsquqq
+- ___fractsquhq
+- ___fractsqusq
+- ___fractsqudq
+- ___fractsqutq
+- ___fractsquha
+- ___fractsqusa
+- ___fractsquda
+- ___fractsquta
+- ___fractsqqi
+- ___fractsqhi
+- ___fractsqsi
+- ___fractsqdi
+- ___fractsqti
+- ___fractsqsf
+- ___fractsqdf
+- ___fractdqqq2
+- ___fractdqhq2
+- ___fractdqsq2
+- ___fractdqtq2
+- ___fractdqha
+- ___fractdqsa
+- ___fractdqda
+- ___fractdqta
+- ___fractdquqq
+- ___fractdquhq
+- ___fractdqusq
+- ___fractdqudq
+- ___fractdqutq
+- ___fractdquha
+- ___fractdqusa
+- ___fractdquda
+- ___fractdquta
+- ___fractdqqi
+- ___fractdqhi
+- ___fractdqsi
+- ___fractdqdi
+- ___fractdqti
+- ___fractdqsf
+- ___fractdqdf
+- ___fracttqqq2
+- ___fracttqhq2
+- ___fracttqsq2
+- ___fracttqdq2
+- ___fracttqha
+- ___fracttqsa
+- ___fracttqda
+- ___fracttqta
+- ___fracttquqq
+- ___fracttquhq
+- ___fracttqusq
+- ___fracttqudq
+- ___fracttqutq
+- ___fracttquha
+- ___fracttqusa
+- ___fracttquda
+- ___fracttquta
+- ___fracttqqi
+- ___fracttqhi
+- ___fracttqsi
+- ___fracttqdi
+- ___fracttqti
+- ___fracttqsf
+- ___fracttqdf
+- ___fracthaqq
+- ___fracthahq
+- ___fracthasq
+- ___fracthadq
+- ___fracthatq
+- ___fracthasa2
+- ___fracthada2
+- ___fracthata2
+- ___fracthauqq
+- ___fracthauhq
+- ___fracthausq
+- ___fracthaudq
+- ___fracthautq
+- ___fracthauha
+- ___fracthausa
+- ___fracthauda
+- ___fracthauta
+- ___fracthaqi
+- ___fracthahi
+- ___fracthasi
+- ___fracthadi
+- ___fracthati
+- ___fracthasf
+- ___fracthadf
+- ___fractsaqq
+- ___fractsahq
+- ___fractsasq
+- ___fractsadq
+- ___fractsatq
+- ___fractsaha2
+- ___fractsada2
+- ___fractsata2
+- ___fractsauqq
+- ___fractsauhq
+- ___fractsausq
+- ___fractsaudq
+- ___fractsautq
+- ___fractsauha
+- ___fractsausa
+- ___fractsauda
+- ___fractsauta
+- ___fractsaqi
+- ___fractsahi
+- ___fractsasi
+- ___fractsadi
+- ___fractsati
+- ___fractsasf
+- ___fractsadf
+- ___fractdaqq
+- ___fractdahq
+- ___fractdasq
+- ___fractdadq
+- ___fractdatq
+- ___fractdaha2
+- ___fractdasa2
+- ___fractdata2
+- ___fractdauqq
+- ___fractdauhq
+- ___fractdausq
+- ___fractdaudq
+- ___fractdautq
+- ___fractdauha
+- ___fractdausa
+- ___fractdauda
+- ___fractdauta
+- ___fractdaqi
+- ___fractdahi
+- ___fractdasi
+- ___fractdadi
+- ___fractdati
+- ___fractdasf
+- ___fractdadf
+- ___fracttaqq
+- ___fracttahq
+- ___fracttasq
+- ___fracttadq
+- ___fracttatq
+- ___fracttaha2
+- ___fracttasa2
+- ___fracttada2
+- ___fracttauqq
+- ___fracttauhq
+- ___fracttausq
+- ___fracttaudq
+- ___fracttautq
+- ___fracttauha
+- ___fracttausa
+- ___fracttauda
+- ___fracttauta
+- ___fracttaqi
+- ___fracttahi
+- ___fracttasi
+- ___fracttadi
+- ___fracttati
+- ___fracttasf
+- ___fracttadf
+- ___fractuqqqq
+- ___fractuqqhq
+- ___fractuqqsq
+- ___fractuqqdq
+- ___fractuqqtq
+- ___fractuqqha
+- ___fractuqqsa
+- ___fractuqqda
+- ___fractuqqta
+- ___fractuqquhq2
+- ___fractuqqusq2
+- ___fractuqqudq2
+- ___fractuqqutq2
+- ___fractuqquha
+- ___fractuqqusa
+- ___fractuqquda
+- ___fractuqquta
+- ___fractuqqqi
+- ___fractuqqhi
+- ___fractuqqsi
+- ___fractuqqdi
+- ___fractuqqti
+- ___fractuqqsf
+- ___fractuqqdf
+- ___fractuhqqq
+- ___fractuhqhq
+- ___fractuhqsq
+- ___fractuhqdq
+- ___fractuhqtq
+- ___fractuhqha
+- ___fractuhqsa
+- ___fractuhqda
+- ___fractuhqta
+- ___fractuhquqq2
+- ___fractuhqusq2
+- ___fractuhqudq2
+- ___fractuhqutq2
+- ___fractuhquha
+- ___fractuhqusa
+- ___fractuhquda
+- ___fractuhquta
+- ___fractuhqqi
+- ___fractuhqhi
+- ___fractuhqsi
+- ___fractuhqdi
+- ___fractuhqti
+- ___fractuhqsf
+- ___fractuhqdf
+- ___fractusqqq
+- ___fractusqhq
+- ___fractusqsq
+- ___fractusqdq
+- ___fractusqtq
+- ___fractusqha
+- ___fractusqsa
+- ___fractusqda
+- ___fractusqta
+- ___fractusquqq2
+- ___fractusquhq2
+- ___fractusqudq2
+- ___fractusqutq2
+- ___fractusquha
+- ___fractusqusa
+- ___fractusquda
+- ___fractusquta
+- ___fractusqqi
+- ___fractusqhi
+- ___fractusqsi
+- ___fractusqdi
+- ___fractusqti
+- ___fractusqsf
+- ___fractusqdf
+- ___fractudqqq
+- ___fractudqhq
+- ___fractudqsq
+- ___fractudqdq
+- ___fractudqtq
+- ___fractudqha
+- ___fractudqsa
+- ___fractudqda
+- ___fractudqta
+- ___fractudquqq2
+- ___fractudquhq2
+- ___fractudqusq2
+- ___fractudqutq2
+- ___fractudquha
+- ___fractudqusa
+- ___fractudquda
+- ___fractudquta
+- ___fractudqqi
+- ___fractudqhi
+- ___fractudqsi
+- ___fractudqdi
+- ___fractudqti
+- ___fractudqsf
+- ___fractudqdf
+- ___fractutqqq
+- ___fractutqhq
+- ___fractutqsq
+- ___fractutqdq
+- ___fractutqtq
+- ___fractutqha
+- ___fractutqsa
+- ___fractutqda
+- ___fractutqta
+- ___fractutquqq2
+- ___fractutquhq2
+- ___fractutqusq2
+- ___fractutqudq2
+- ___fractutquha
+- ___fractutqusa
+- ___fractutquda
+- ___fractutquta
+- ___fractutqqi
+- ___fractutqhi
+- ___fractutqsi
+- ___fractutqdi
+- ___fractutqti
+- ___fractutqsf
+- ___fractutqdf
+- ___fractuhaqq
+- ___fractuhahq
+- ___fractuhasq
+- ___fractuhadq
+- ___fractuhatq
+- ___fractuhaha
+- ___fractuhasa
+- ___fractuhada
+- ___fractuhata
+- ___fractuhauqq
+- ___fractuhauhq
+- ___fractuhausq
+- ___fractuhaudq
+- ___fractuhautq
+- ___fractuhausa2
+- ___fractuhauda2
+- ___fractuhauta2
+- ___fractuhaqi
+- ___fractuhahi
+- ___fractuhasi
+- ___fractuhadi
+- ___fractuhati
+- ___fractuhasf
+- ___fractuhadf
+- ___fractusaqq
+- ___fractusahq
+- ___fractusasq
+- ___fractusadq
+- ___fractusatq
+- ___fractusaha
+- ___fractusasa
+- ___fractusada
+- ___fractusata
+- ___fractusauqq
+- ___fractusauhq
+- ___fractusausq
+- ___fractusaudq
+- ___fractusautq
+- ___fractusauha2
+- ___fractusauda2
+- ___fractusauta2
+- ___fractusaqi
+- ___fractusahi
+- ___fractusasi
+- ___fractusadi
+- ___fractusati
+- ___fractusasf
+- ___fractusadf
+- ___fractudaqq
+- ___fractudahq
+- ___fractudasq
+- ___fractudadq
+- ___fractudatq
+- ___fractudaha
+- ___fractudasa
+- ___fractudada
+- ___fractudata
+- ___fractudauqq
+- ___fractudauhq
+- ___fractudausq
+- ___fractudaudq
+- ___fractudautq
+- ___fractudauha2
+- ___fractudausa2
+- ___fractudauta2
+- ___fractudaqi
+- ___fractudahi
+- ___fractudasi
+- ___fractudadi
+- ___fractudati
+- ___fractudasf
+- ___fractudadf
+- ___fractutaqq
+- ___fractutahq
+- ___fractutasq
+- ___fractutadq
+- ___fractutatq
+- ___fractutaha
+- ___fractutasa
+- ___fractutada
+- ___fractutata
+- ___fractutauqq
+- ___fractutauhq
+- ___fractutausq
+- ___fractutaudq
+- ___fractutautq
+- ___fractutauha2
+- ___fractutausa2
+- ___fractutauda2
+- ___fractutaqi
+- ___fractutahi
+- ___fractutasi
+- ___fractutadi
+- ___fractutati
+- ___fractutasf
+- ___fractutadf
+- ___fractqiqq
+- ___fractqihq
+- ___fractqisq
+- ___fractqidq
+- ___fractqitq
+- ___fractqiha
+- ___fractqisa
+- ___fractqida
+- ___fractqita
+- ___fractqiuqq
+- ___fractqiuhq
+- ___fractqiusq
+- ___fractqiudq
+- ___fractqiutq
+- ___fractqiuha
+- ___fractqiusa
+- ___fractqiuda
+- ___fractqiuta
+- ___fracthiqq
+- ___fracthihq
+- ___fracthisq
+- ___fracthidq
+- ___fracthitq
+- ___fracthiha
+- ___fracthisa
+- ___fracthida
+- ___fracthita
+- ___fracthiuqq
+- ___fracthiuhq
+- ___fracthiusq
+- ___fracthiudq
+- ___fracthiutq
+- ___fracthiuha
+- ___fracthiusa
+- ___fracthiuda
+- ___fracthiuta
+- ___fractsiqq
+- ___fractsihq
+- ___fractsisq
+- ___fractsidq
+- ___fractsitq
+- ___fractsiha
+- ___fractsisa
+- ___fractsida
+- ___fractsita
+- ___fractsiuqq
+- ___fractsiuhq
+- ___fractsiusq
+- ___fractsiudq
+- ___fractsiutq
+- ___fractsiuha
+- ___fractsiusa
+- ___fractsiuda
+- ___fractsiuta
+- ___fractdiqq
+- ___fractdihq
+- ___fractdisq
+- ___fractdidq
+- ___fractditq
+- ___fractdiha
+- ___fractdisa
+- ___fractdida
+- ___fractdita
+- ___fractdiuqq
+- ___fractdiuhq
+- ___fractdiusq
+- ___fractdiudq
+- ___fractdiutq
+- ___fractdiuha
+- ___fractdiusa
+- ___fractdiuda
+- ___fractdiuta
+- ___fracttiqq
+- ___fracttihq
+- ___fracttisq
+- ___fracttidq
+- ___fracttitq
+- ___fracttiha
+- ___fracttisa
+- ___fracttida
+- ___fracttita
+- ___fracttiuqq
+- ___fracttiuhq
+- ___fracttiusq
+- ___fracttiudq
+- ___fracttiutq
+- ___fracttiuha
+- ___fracttiusa
+- ___fracttiuda
+- ___fracttiuta
+- ___fractsfqq
+- ___fractsfhq
+- ___fractsfsq
+- ___fractsfdq
+- ___fractsftq
+- ___fractsfha
+- ___fractsfsa
+- ___fractsfda
+- ___fractsfta
+- ___fractsfuqq
+- ___fractsfuhq
+- ___fractsfusq
+- ___fractsfudq
+- ___fractsfutq
+- ___fractsfuha
+- ___fractsfusa
+- ___fractsfuda
+- ___fractsfuta
+- ___fractdfqq
+- ___fractdfhq
+- ___fractdfsq
+- ___fractdfdq
+- ___fractdftq
+- ___fractdfha
+- ___fractdfsa
+- ___fractdfda
+- ___fractdfta
+- ___fractdfuqq
+- ___fractdfuhq
+- ___fractdfusq
+- ___fractdfudq
+- ___fractdfutq
+- ___fractdfuha
+- ___fractdfusa
+- ___fractdfuda
+- ___fractdfuta
+- ___satfractqqhq2
+- ___satfractqqsq2
+- ___satfractqqdq2
+- ___satfractqqtq2
+- ___satfractqqha
+- ___satfractqqsa
+- ___satfractqqda
+- ___satfractqqta
+- ___satfractqquqq
+- ___satfractqquhq
+- ___satfractqqusq
+- ___satfractqqudq
+- ___satfractqqutq
+- ___satfractqquha
+- ___satfractqqusa
+- ___satfractqquda
+- ___satfractqquta
+- ___satfracthqqq2
+- ___satfracthqsq2
+- ___satfracthqdq2
+- ___satfracthqtq2
+- ___satfracthqha
+- ___satfracthqsa
+- ___satfracthqda
+- ___satfracthqta
+- ___satfracthquqq
+- ___satfracthquhq
+- ___satfracthqusq
+- ___satfracthqudq
+- ___satfracthqutq
+- ___satfracthquha
+- ___satfracthqusa
+- ___satfracthquda
+- ___satfracthquta
+- ___satfractsqqq2
+- ___satfractsqhq2
+- ___satfractsqdq2
+- ___satfractsqtq2
+- ___satfractsqha
+- ___satfractsqsa
+- ___satfractsqda
+- ___satfractsqta
+- ___satfractsquqq
+- ___satfractsquhq
+- ___satfractsqusq
+- ___satfractsqudq
+- ___satfractsqutq
+- ___satfractsquha
+- ___satfractsqusa
+- ___satfractsquda
+- ___satfractsquta
+- ___satfractdqqq2
+- ___satfractdqhq2
+- ___satfractdqsq2
+- ___satfractdqtq2
+- ___satfractdqha
+- ___satfractdqsa
+- ___satfractdqda
+- ___satfractdqta
+- ___satfractdquqq
+- ___satfractdquhq
+- ___satfractdqusq
+- ___satfractdqudq
+- ___satfractdqutq
+- ___satfractdquha
+- ___satfractdqusa
+- ___satfractdquda
+- ___satfractdquta
+- ___satfracttqqq2
+- ___satfracttqhq2
+- ___satfracttqsq2
+- ___satfracttqdq2
+- ___satfracttqha
+- ___satfracttqsa
+- ___satfracttqda
+- ___satfracttqta
+- ___satfracttquqq
+- ___satfracttquhq
+- ___satfracttqusq
+- ___satfracttqudq
+- ___satfracttqutq
+- ___satfracttquha
+- ___satfracttqusa
+- ___satfracttquda
+- ___satfracttquta
+- ___satfracthaqq
+- ___satfracthahq
+- ___satfracthasq
+- ___satfracthadq
+- ___satfracthatq
+- ___satfracthasa2
+- ___satfracthada2
+- ___satfracthata2
+- ___satfracthauqq
+- ___satfracthauhq
+- ___satfracthausq
+- ___satfracthaudq
+- ___satfracthautq
+- ___satfracthauha
+- ___satfracthausa
+- ___satfracthauda
+- ___satfracthauta
+- ___satfractsaqq
+- ___satfractsahq
+- ___satfractsasq
+- ___satfractsadq
+- ___satfractsatq
+- ___satfractsaha2
+- ___satfractsada2
+- ___satfractsata2
+- ___satfractsauqq
+- ___satfractsauhq
+- ___satfractsausq
+- ___satfractsaudq
+- ___satfractsautq
+- ___satfractsauha
+- ___satfractsausa
+- ___satfractsauda
+- ___satfractsauta
+- ___satfractdaqq
+- ___satfractdahq
+- ___satfractdasq
+- ___satfractdadq
+- ___satfractdatq
+- ___satfractdaha2
+- ___satfractdasa2
+- ___satfractdata2
+- ___satfractdauqq
+- ___satfractdauhq
+- ___satfractdausq
+- ___satfractdaudq
+- ___satfractdautq
+- ___satfractdauha
+- ___satfractdausa
+- ___satfractdauda
+- ___satfractdauta
+- ___satfracttaqq
+- ___satfracttahq
+- ___satfracttasq
+- ___satfracttadq
+- ___satfracttatq
+- ___satfracttaha2
+- ___satfracttasa2
+- ___satfracttada2
+- ___satfracttauqq
+- ___satfracttauhq
+- ___satfracttausq
+- ___satfracttaudq
+- ___satfracttautq
+- ___satfracttauha
+- ___satfracttausa
+- ___satfracttauda
+- ___satfracttauta
+- ___satfractuqqqq
+- ___satfractuqqhq
+- ___satfractuqqsq
+- ___satfractuqqdq
+- ___satfractuqqtq
+- ___satfractuqqha
+- ___satfractuqqsa
+- ___satfractuqqda
+- ___satfractuqqta
+- ___satfractuqquhq2
+- ___satfractuqqusq2
+- ___satfractuqqudq2
+- ___satfractuqqutq2
+- ___satfractuqquha
+- ___satfractuqqusa
+- ___satfractuqquda
+- ___satfractuqquta
+- ___satfractuhqqq
+- ___satfractuhqhq
+- ___satfractuhqsq
+- ___satfractuhqdq
+- ___satfractuhqtq
+- ___satfractuhqha
+- ___satfractuhqsa
+- ___satfractuhqda
+- ___satfractuhqta
+- ___satfractuhquqq2
+- ___satfractuhqusq2
+- ___satfractuhqudq2
+- ___satfractuhqutq2
+- ___satfractuhquha
+- ___satfractuhqusa
+- ___satfractuhquda
+- ___satfractuhquta
+- ___satfractusqqq
+- ___satfractusqhq
+- ___satfractusqsq
+- ___satfractusqdq
+- ___satfractusqtq
+- ___satfractusqha
+- ___satfractusqsa
+- ___satfractusqda
+- ___satfractusqta
+- ___satfractusquqq2
+- ___satfractusquhq2
+- ___satfractusqudq2
+- ___satfractusqutq2
+- ___satfractusquha
+- ___satfractusqusa
+- ___satfractusquda
+- ___satfractusquta
+- ___satfractudqqq
+- ___satfractudqhq
+- ___satfractudqsq
+- ___satfractudqdq
+- ___satfractudqtq
+- ___satfractudqha
+- ___satfractudqsa
+- ___satfractudqda
+- ___satfractudqta
+- ___satfractudquqq2
+- ___satfractudquhq2
+- ___satfractudqusq2
+- ___satfractudqutq2
+- ___satfractudquha
+- ___satfractudqusa
+- ___satfractudquda
+- ___satfractudquta
+- ___satfractutqqq
+- ___satfractutqhq
+- ___satfractutqsq
+- ___satfractutqdq
+- ___satfractutqtq
+- ___satfractutqha
+- ___satfractutqsa
+- ___satfractutqda
+- ___satfractutqta
+- ___satfractutquqq2
+- ___satfractutquhq2
+- ___satfractutqusq2
+- ___satfractutqudq2
+- ___satfractutquha
+- ___satfractutqusa
+- ___satfractutquda
+- ___satfractutquta
+- ___satfractuhaqq
+- ___satfractuhahq
+- ___satfractuhasq
+- ___satfractuhadq
+- ___satfractuhatq
+- ___satfractuhaha
+- ___satfractuhasa
+- ___satfractuhada
+- ___satfractuhata
+- ___satfractuhauqq
+- ___satfractuhauhq
+- ___satfractuhausq
+- ___satfractuhaudq
+- ___satfractuhautq
+- ___satfractuhausa2
+- ___satfractuhauda2
+- ___satfractuhauta2
+- ___satfractusaqq
+- ___satfractusahq
+- ___satfractusasq
+- ___satfractusadq
+- ___satfractusatq
+- ___satfractusaha
+- ___satfractusasa
+- ___satfractusada
+- ___satfractusata
+- ___satfractusauqq
+- ___satfractusauhq
+- ___satfractusausq
+- ___satfractusaudq
+- ___satfractusautq
+- ___satfractusauha2
+- ___satfractusauda2
+- ___satfractusauta2
+- ___satfractudaqq
+- ___satfractudahq
+- ___satfractudasq
+- ___satfractudadq
+- ___satfractudatq
+- ___satfractudaha
+- ___satfractudasa
+- ___satfractudada
+- ___satfractudata
+- ___satfractudauqq
+- ___satfractudauhq
+- ___satfractudausq
+- ___satfractudaudq
+- ___satfractudautq
+- ___satfractudauha2
+- ___satfractudausa2
+- ___satfractudauta2
+- ___satfractutaqq
+- ___satfractutahq
+- ___satfractutasq
+- ___satfractutadq
+- ___satfractutatq
+- ___satfractutaha
+- ___satfractutasa
+- ___satfractutada
+- ___satfractutata
+- ___satfractutauqq
+- ___satfractutauhq
+- ___satfractutausq
+- ___satfractutaudq
+- ___satfractutautq
+- ___satfractutauha2
+- ___satfractutausa2
+- ___satfractutauda2
+- ___satfractqiqq
+- ___satfractqihq
+- ___satfractqisq
+- ___satfractqidq
+- ___satfractqitq
+- ___satfractqiha
+- ___satfractqisa
+- ___satfractqida
+- ___satfractqita
+- ___satfractqiuqq
+- ___satfractqiuhq
+- ___satfractqiusq
+- ___satfractqiudq
+- ___satfractqiutq
+- ___satfractqiuha
+- ___satfractqiusa
+- ___satfractqiuda
+- ___satfractqiuta
+- ___satfracthiqq
+- ___satfracthihq
+- ___satfracthisq
+- ___satfracthidq
+- ___satfracthitq
+- ___satfracthiha
+- ___satfracthisa
+- ___satfracthida
+- ___satfracthita
+- ___satfracthiuqq
+- ___satfracthiuhq
+- ___satfracthiusq
+- ___satfracthiudq
+- ___satfracthiutq
+- ___satfracthiuha
+- ___satfracthiusa
+- ___satfracthiuda
+- ___satfracthiuta
+- ___satfractsiqq
+- ___satfractsihq
+- ___satfractsisq
+- ___satfractsidq
+- ___satfractsitq
+- ___satfractsiha
+- ___satfractsisa
+- ___satfractsida
+- ___satfractsita
+- ___satfractsiuqq
+- ___satfractsiuhq
+- ___satfractsiusq
+- ___satfractsiudq
+- ___satfractsiutq
+- ___satfractsiuha
+- ___satfractsiusa
+- ___satfractsiuda
+- ___satfractsiuta
+- ___satfractdiqq
+- ___satfractdihq
+- ___satfractdisq
+- ___satfractdidq
+- ___satfractditq
+- ___satfractdiha
+- ___satfractdisa
+- ___satfractdida
+- ___satfractdita
+- ___satfractdiuqq
+- ___satfractdiuhq
+- ___satfractdiusq
+- ___satfractdiudq
+- ___satfractdiutq
+- ___satfractdiuha
+- ___satfractdiusa
+- ___satfractdiuda
+- ___satfractdiuta
+- ___satfracttiqq
+- ___satfracttihq
+- ___satfracttisq
+- ___satfracttidq
+- ___satfracttitq
+- ___satfracttiha
+- ___satfracttisa
+- ___satfracttida
+- ___satfracttita
+- ___satfracttiuqq
+- ___satfracttiuhq
+- ___satfracttiusq
+- ___satfracttiudq
+- ___satfracttiutq
+- ___satfracttiuha
+- ___satfracttiusa
+- ___satfracttiuda
+- ___satfracttiuta
+- ___satfractsfqq
+- ___satfractsfhq
+- ___satfractsfsq
+- ___satfractsfdq
+- ___satfractsftq
+- ___satfractsfha
+- ___satfractsfsa
+- ___satfractsfda
+- ___satfractsfta
+- ___satfractsfuqq
+- ___satfractsfuhq
+- ___satfractsfusq
+- ___satfractsfudq
+- ___satfractsfutq
+- ___satfractsfuha
+- ___satfractsfusa
+- ___satfractsfuda
+- ___satfractsfuta
+- ___satfractdfqq
+- ___satfractdfhq
+- ___satfractdfsq
+- ___satfractdfdq
+- ___satfractdftq
+- ___satfractdfha
+- ___satfractdfsa
+- ___satfractdfda
+- ___satfractdfta
+- ___satfractdfuqq
+- ___satfractdfuhq
+- ___satfractdfusq
+- ___satfractdfudq
+- ___satfractdfutq
+- ___satfractdfuha
+- ___satfractdfusa
+- ___satfractdfuda
+- ___satfractdfuta
+- ___fractunsqqqi
+- ___fractunsqqhi
+- ___fractunsqqsi
+- ___fractunsqqdi
+- ___fractunsqqti
+- ___fractunshqqi
+- ___fractunshqhi
+- ___fractunshqsi
+- ___fractunshqdi
+- ___fractunshqti
+- ___fractunssqqi
+- ___fractunssqhi
+- ___fractunssqsi
+- ___fractunssqdi
+- ___fractunssqti
+- ___fractunsdqqi
+- ___fractunsdqhi
+- ___fractunsdqsi
+- ___fractunsdqdi
+- ___fractunsdqti
+- ___fractunstqqi
+- ___fractunstqhi
+- ___fractunstqsi
+- ___fractunstqdi
+- ___fractunstqti
+- ___fractunshaqi
+- ___fractunshahi
+- ___fractunshasi
+- ___fractunshadi
+- ___fractunshati
+- ___fractunssaqi
+- ___fractunssahi
+- ___fractunssasi
+- ___fractunssadi
+- ___fractunssati
+- ___fractunsdaqi
+- ___fractunsdahi
+- ___fractunsdasi
+- ___fractunsdadi
+- ___fractunsdati
+- ___fractunstaqi
+- ___fractunstahi
+- ___fractunstasi
+- ___fractunstadi
+- ___fractunstati
+- ___fractunsuqqqi
+- ___fractunsuqqhi
+- ___fractunsuqqsi
+- ___fractunsuqqdi
+- ___fractunsuqqti
+- ___fractunsuhqqi
+- ___fractunsuhqhi
+- ___fractunsuhqsi
+- ___fractunsuhqdi
+- ___fractunsuhqti
+- ___fractunsusqqi
+- ___fractunsusqhi
+- ___fractunsusqsi
+- ___fractunsusqdi
+- ___fractunsusqti
+- ___fractunsudqqi
+- ___fractunsudqhi
+- ___fractunsudqsi
+- ___fractunsudqdi
+- ___fractunsudqti
+- ___fractunsutqqi
+- ___fractunsutqhi
+- ___fractunsutqsi
+- ___fractunsutqdi
+- ___fractunsutqti
+- ___fractunsuhaqi
+- ___fractunsuhahi
+- ___fractunsuhasi
+- ___fractunsuhadi
+- ___fractunsuhati
+- ___fractunsusaqi
+- ___fractunsusahi
+- ___fractunsusasi
+- ___fractunsusadi
+- ___fractunsusati
+- ___fractunsudaqi
+- ___fractunsudahi
+- ___fractunsudasi
+- ___fractunsudadi
+- ___fractunsudati
+- ___fractunsutaqi
+- ___fractunsutahi
+- ___fractunsutasi
+- ___fractunsutadi
+- ___fractunsutati
+- ___fractunsqiqq
+- ___fractunsqihq
+- ___fractunsqisq
+- ___fractunsqidq
+- ___fractunsqitq
+- ___fractunsqiha
+- ___fractunsqisa
+- ___fractunsqida
+- ___fractunsqita
+- ___fractunsqiuqq
+- ___fractunsqiuhq
+- ___fractunsqiusq
+- ___fractunsqiudq
+- ___fractunsqiutq
+- ___fractunsqiuha
+- ___fractunsqiusa
+- ___fractunsqiuda
+- ___fractunsqiuta
+- ___fractunshiqq
+- ___fractunshihq
+- ___fractunshisq
+- ___fractunshidq
+- ___fractunshitq
+- ___fractunshiha
+- ___fractunshisa
+- ___fractunshida
+- ___fractunshita
+- ___fractunshiuqq
+- ___fractunshiuhq
+- ___fractunshiusq
+- ___fractunshiudq
+- ___fractunshiutq
+- ___fractunshiuha
+- ___fractunshiusa
+- ___fractunshiuda
+- ___fractunshiuta
+- ___fractunssiqq
+- ___fractunssihq
+- ___fractunssisq
+- ___fractunssidq
+- ___fractunssitq
+- ___fractunssiha
+- ___fractunssisa
+- ___fractunssida
+- ___fractunssita
+- ___fractunssiuqq
+- ___fractunssiuhq
+- ___fractunssiusq
+- ___fractunssiudq
+- ___fractunssiutq
+- ___fractunssiuha
+- ___fractunssiusa
+- ___fractunssiuda
+- ___fractunssiuta
+- ___fractunsdiqq
+- ___fractunsdihq
+- ___fractunsdisq
+- ___fractunsdidq
+- ___fractunsditq
+- ___fractunsdiha
+- ___fractunsdisa
+- ___fractunsdida
+- ___fractunsdita
+- ___fractunsdiuqq
+- ___fractunsdiuhq
+- ___fractunsdiusq
+- ___fractunsdiudq
+- ___fractunsdiutq
+- ___fractunsdiuha
+- ___fractunsdiusa
+- ___fractunsdiuda
+- ___fractunsdiuta
+- ___fractunstiqq
+- ___fractunstihq
+- ___fractunstisq
+- ___fractunstidq
+- ___fractunstitq
+- ___fractunstiha
+- ___fractunstisa
+- ___fractunstida
+- ___fractunstita
+- ___fractunstiuqq
+- ___fractunstiuhq
+- ___fractunstiusq
+- ___fractunstiudq
+- ___fractunstiutq
+- ___fractunstiuha
+- ___fractunstiusa
+- ___fractunstiuda
+- ___fractunstiuta
+- ___satfractunsqiqq
+- ___satfractunsqihq
+- ___satfractunsqisq
+- ___satfractunsqidq
+- ___satfractunsqitq
+- ___satfractunsqiha
+- ___satfractunsqisa
+- ___satfractunsqida
+- ___satfractunsqita
+- ___satfractunsqiuqq
+- ___satfractunsqiuhq
+- ___satfractunsqiusq
+- ___satfractunsqiudq
+- ___satfractunsqiutq
+- ___satfractunsqiuha
+- ___satfractunsqiusa
+- ___satfractunsqiuda
+- ___satfractunsqiuta
+- ___satfractunshiqq
+- ___satfractunshihq
+- ___satfractunshisq
+- ___satfractunshidq
+- ___satfractunshitq
+- ___satfractunshiha
+- ___satfractunshisa
+- ___satfractunshida
+- ___satfractunshita
+- ___satfractunshiuqq
+- ___satfractunshiuhq
+- ___satfractunshiusq
+- ___satfractunshiudq
+- ___satfractunshiutq
+- ___satfractunshiuha
+- ___satfractunshiusa
+- ___satfractunshiuda
+- ___satfractunshiuta
+- ___satfractunssiqq
+- ___satfractunssihq
+- ___satfractunssisq
+- ___satfractunssidq
+- ___satfractunssitq
+- ___satfractunssiha
+- ___satfractunssisa
+- ___satfractunssida
+- ___satfractunssita
+- ___satfractunssiuqq
+- ___satfractunssiuhq
+- ___satfractunssiusq
+- ___satfractunssiudq
+- ___satfractunssiutq
+- ___satfractunssiuha
+- ___satfractunssiusa
+- ___satfractunssiuda
+- ___satfractunssiuta
+- ___satfractunsdiqq
+- ___satfractunsdihq
+- ___satfractunsdisq
+- ___satfractunsdidq
+- ___satfractunsditq
+- ___satfractunsdiha
+- ___satfractunsdisa
+- ___satfractunsdida
+- ___satfractunsdita
+- ___satfractunsdiuqq
+- ___satfractunsdiuhq
+- ___satfractunsdiusq
+- ___satfractunsdiudq
+- ___satfractunsdiutq
+- ___satfractunsdiuha
+- ___satfractunsdiusa
+- ___satfractunsdiuda
+- ___satfractunsdiuta
+- ___satfractunstiqq
+- ___satfractunstihq
+- ___satfractunstisq
+- ___satfractunstidq
+- ___satfractunstitq
+- ___satfractunstiha
+- ___satfractunstisa
+- ___satfractunstida
+- ___satfractunstita
+- ___satfractunstiuqq
+- ___satfractunstiuhq
+- ___satfractunstiusq
+- ___satfractunstiudq
+- ___satfractunstiutq
+- ___satfractunstiuha
+- ___satfractunstiusa
+- ___satfractunstiuda
+- ___satfractunstiuta
+-}
+-
+-%inherit GCC_4.4.0 GCC_4.3.0
+-GCC_4.4.0 {
+- ___sync_fetch_and_add_1
+- ___sync_fetch_and_sub_1
+- ___sync_fetch_and_or_1
+- ___sync_fetch_and_and_1
+- ___sync_fetch_and_xor_1
+- ___sync_fetch_and_nand_1
+- ___sync_add_and_fetch_1
+- ___sync_sub_and_fetch_1
+- ___sync_or_and_fetch_1
+- ___sync_and_and_fetch_1
+- ___sync_xor_and_fetch_1
+- ___sync_nand_and_fetch_1
+- ___sync_bool_compare_and_swap_1
+- ___sync_val_compare_and_swap_1
+- ___sync_lock_test_and_set_1
+-
+- ___sync_fetch_and_add_2
+- ___sync_fetch_and_sub_2
+- ___sync_fetch_and_or_2
+- ___sync_fetch_and_and_2
+- ___sync_fetch_and_xor_2
+- ___sync_fetch_and_nand_2
+- ___sync_add_and_fetch_2
+- ___sync_sub_and_fetch_2
+- ___sync_or_and_fetch_2
+- ___sync_and_and_fetch_2
+- ___sync_xor_and_fetch_2
+- ___sync_nand_and_fetch_2
+- ___sync_bool_compare_and_swap_2
+- ___sync_val_compare_and_swap_2
+- ___sync_lock_test_and_set_2
+-
+- ___sync_fetch_and_add_4
+- ___sync_fetch_and_sub_4
+- ___sync_fetch_and_or_4
+- ___sync_fetch_and_and_4
+- ___sync_fetch_and_xor_4
+- ___sync_fetch_and_nand_4
+- ___sync_add_and_fetch_4
+- ___sync_sub_and_fetch_4
+- ___sync_or_and_fetch_4
+- ___sync_and_and_fetch_4
+- ___sync_xor_and_fetch_4
+- ___sync_nand_and_fetch_4
+- ___sync_bool_compare_and_swap_4
+- ___sync_val_compare_and_swap_4
+- ___sync_lock_test_and_set_4
+-
+- ___sync_fetch_and_add_8
+- ___sync_fetch_and_sub_8
+- ___sync_fetch_and_or_8
+- ___sync_fetch_and_and_8
+- ___sync_fetch_and_xor_8
+- ___sync_fetch_and_nand_8
+- ___sync_add_and_fetch_8
+- ___sync_sub_and_fetch_8
+- ___sync_or_and_fetch_8
+- ___sync_and_and_fetch_8
+- ___sync_xor_and_fetch_8
+- ___sync_nand_and_fetch_8
+- ___sync_bool_compare_and_swap_8
+- ___sync_val_compare_and_swap_8
+- ___sync_lock_test_and_set_8
+-
+- ___sync_fetch_and_add_16
+- ___sync_fetch_and_sub_16
+- ___sync_fetch_and_or_16
+- ___sync_fetch_and_and_16
+- ___sync_fetch_and_xor_16
+- ___sync_fetch_and_nand_16
+- ___sync_add_and_fetch_16
+- ___sync_sub_and_fetch_16
+- ___sync_or_and_fetch_16
+- ___sync_and_and_fetch_16
+- ___sync_xor_and_fetch_16
+- ___sync_nand_and_fetch_16
+- ___sync_bool_compare_and_swap_16
+- ___sync_val_compare_and_swap_16
+- ___sync_lock_test_and_set_16
+-
+- ___sync_synchronize
+-}
+-
+-%inherit GCC_4.5.0 GCC_4.4.0
+-GCC_4.5.0 {
+- ___unordxf2
+- ___unordtf2
++ __smulsi3_highpart
++ __umulsi3_highpart
+ }
+diff --git a/libgcc/config/bfin/t-linux b/libgcc/config/bfin/t-linux
+index 1c42e48..8898157 100644
+--- a/libgcc/config/bfin/t-linux
++++ b/libgcc/config/bfin/t-linux
+@@ -1 +1,2 @@
+-SHLIB_MAPFILES = $(srcdir)/config/bfin/libgcc-glibc.ver
++SHLIB_MAPFILES += $(srcdir)/config/bfin/libgcc-glibc.ver
++SHLIB_MKMAP_OPTS = -v skip_underscore=1
+--
+2.7.4
+
diff --git a/patches/gcc/6.2.0/894-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch b/patches/gcc/6.2.0/894-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch
new file mode 100644
index 0000000..ce49de7
--- /dev/null
+++ b/patches/gcc/6.2.0/894-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch
@@ -0,0 +1,59 @@
+From 9d9f97ca5d1ceba66677bf406c9b31027dc1f22e Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Fri, 19 Aug 2016 13:54:46 +0200
+Subject: [PATCH] libgcc: fix DWARF compilation with FDPIC targets
+
+The build of unwind-dw2-fde-dip.c currently fails for FDPIC targets with
+the following error:
+
+libgcc/unwind-dw2-fde-dip.c:167:31: error: storage size of 'load_base' isn't known
+ struct elf32_fdpic_loadaddr load_base;
+
+This patch addresses that by defining load_base with the appropriate
+type on FDPIC targets. It has been tested on FRV and Blackfin.
+
+Fixes PR gcc/68468.
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ libgcc/unwind-dw2-fde-dip.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c
+index f7a1c3f..801bce8 100644
+--- a/libgcc/unwind-dw2-fde-dip.c
++++ b/libgcc/unwind-dw2-fde-dip.c
+@@ -124,7 +124,11 @@ static struct frame_hdr_cache_element
+ {
+ _Unwind_Ptr pc_low;
+ _Unwind_Ptr pc_high;
++#if defined __FRV_FDPIC__ || defined __BFIN_FDPIC__
++ struct elf32_fdpic_loadaddr load_base;
++#else
+ _Unwind_Ptr load_base;
++#endif
+ const ElfW(Phdr) *p_eh_frame_hdr;
+ const ElfW(Phdr) *p_dynamic;
+ struct frame_hdr_cache_element *link;
+@@ -163,7 +167,7 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
+ struct unw_eh_callback_data *data = (struct unw_eh_callback_data *) ptr;
+ const ElfW(Phdr) *phdr, *p_eh_frame_hdr, *p_dynamic;
+ long n, match;
+-#ifdef __FRV_FDPIC__
++#if defined __FRV_FDPIC__ || defined __BFIN_FDPIC__
+ struct elf32_fdpic_loadaddr load_base;
+ #else
+ _Unwind_Ptr load_base;
+@@ -347,7 +351,7 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
+ break;
+ }
+ }
+-# elif defined __FRV_FDPIC__ && defined __linux__
++# elif (defined __FRV_FDPIC__ || defined __BFIN_FDPIC__) && defined __linux__
+ data->dbase = load_base.got_value;
+ # else
+ # error What is DW_EH_PE_datarel base on this platform?
+--
+2.7.4
+
diff --git a/patches/gcc/6.2.0/895-bfin-define-REENTRANT.patch b/patches/gcc/6.2.0/895-bfin-define-REENTRANT.patch
new file mode 100644
index 0000000..e2828a5
--- /dev/null
+++ b/patches/gcc/6.2.0/895-bfin-define-REENTRANT.patch
@@ -0,0 +1,17 @@
+enable _REENTRANT when -lpthread is used
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+diff -Nur gcc-6.2.0.orig/gcc/config/bfin/linux.h gcc-6.2.0/gcc/config/bfin/linux.h
+--- gcc-6.2.0.orig/gcc/config/bfin/linux.h 2016-01-04 15:30:50.000000000 +0100
++++ gcc-6.2.0/gcc/config/bfin/linux.h 2016-09-30 20:48:17.446636819 +0200
+@@ -38,6 +38,9 @@
+ "%{static:--start-group} %{mfast-fp:-lbffastfp} %G %L %{static:--end-group} \
+ %{!static:%{mfast-fp:-lbffastfp} %G}"
+
++#undef CPP_SPEC
++#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
++
+ #undef LINK_SPEC
+ #define LINK_SPEC "\
+ %{mfdpic: -m elf32bfinfd -z text} %{shared} %{pie} \
diff --git a/patches/gcc/6.2.0/910-nios2-bad-multilib-default.patch b/patches/gcc/6.2.0/910-nios2-bad-multilib-default.patch
new file mode 100644
index 0000000..61989e5
--- /dev/null
+++ b/patches/gcc/6.2.0/910-nios2-bad-multilib-default.patch
@@ -0,0 +1,28 @@
+diff -ur gcc-6.2.0.orig/gcc/config/nios2/nios2.h gcc-6.2.0/gcc/config/nios2/nios2.h
+--- gcc-6.2.0.orig/gcc/config/nios2/nios2.h 2016-11-29 10:27:50.364479625 -0800
++++ gcc-6.2.0/gcc/config/nios2/nios2.h 2016-11-29 10:29:55.069624746 -0800
+@@ -63,11 +63,11 @@
+ #if TARGET_ENDIAN_DEFAULT == 0
+ # define ASM_SPEC "%{!meb:-EL} %{meb:-EB} %{march=*:-march=%*}"
+ # define LINK_SPEC_ENDIAN "%{!meb:-EL} %{meb:-EB}"
+-# define MULTILIB_DEFAULTS { "EL" }
++# define MULTILIB_DEFAULTS { "mel" }
+ #else
+ # define ASM_SPEC "%{!mel:-EB} %{mel:-EL} %{march=*:-march=%*}"
+ # define LINK_SPEC_ENDIAN "%{!mel:-EB} %{mel:-EL}"
+-# define MULTILIB_DEFAULTS { "EB" }
++# define MULTILIB_DEFAULTS { "meb" }
+ #endif
+
+ #define LINK_SPEC LINK_SPEC_ENDIAN \
+diff -ur gcc-6.2.0.orig/gcc/config/nios2/t-nios2 gcc-6.2.0/gcc/config/nios2/t-nios2
+--- gcc-6.2.0.orig/gcc/config/nios2/t-nios2 2016-11-29 10:27:50.364479625 -0800
++++ gcc-6.2.0/gcc/config/nios2/t-nios2 2016-11-29 10:29:03.517151014 -0800
+@@ -22,6 +22,5 @@
+ # MULTILIB_DIRNAMES = nomul mulx fpu-60-1 fpu-60-2
+ # MULTILIB_EXCEPTIONS =
+
+-# MULTILIB_OPTIONS += EL/EB
++# MULTILIB_OPTIONS += mel/meb
+ # MULTILIB_DIRNAMES += le be
+-# MULTILIB_MATCHES += EL=mel EB=meb
diff --git a/patches/gcc/6.2.0/930-libgcc-disable-split-stack-nothreads.patch b/patches/gcc/6.2.0/930-libgcc-disable-split-stack-nothreads.patch
new file mode 100644
index 0000000..07f9a73
--- /dev/null
+++ b/patches/gcc/6.2.0/930-libgcc-disable-split-stack-nothreads.patch
@@ -0,0 +1,14 @@
+disable split-stack for non-thread builds
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+diff -Nur gcc-5.3.0.orig/libgcc/config/t-stack gcc-5.3.0/libgcc/config/t-stack
+--- gcc-5.3.0.orig/libgcc/config/t-stack 2010-10-01 21:31:49.000000000 +0200
++++ gcc-5.3.0/libgcc/config/t-stack 2016-03-07 03:25:32.000000000 +0100
+@@ -1,4 +1,6 @@
+ # Makefile fragment to provide generic support for -fsplit-stack.
+ # This should be used in config.host for any host which supports
+ # -fsplit-stack.
++ifeq ($(enable_threads),yes)
+ LIB2ADD_ST += $(srcdir)/generic-morestack.c $(srcdir)/generic-morestack-thread.c
++endif
diff --git a/patches/gcc/6.2.0/940-uclinux-enable-threads.patch b/patches/gcc/6.2.0/940-uclinux-enable-threads.patch
new file mode 100644
index 0000000..490a55b
--- /dev/null
+++ b/patches/gcc/6.2.0/940-uclinux-enable-threads.patch
@@ -0,0 +1,19 @@
+Enable POSIX threads for uClinux targets
+Reported upstream:
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71721
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+diff -Nur gcc-5.4.0.orig/gcc/config.gcc gcc-5.4.0/gcc/config.gcc
+--- gcc-5.4.0.orig/gcc/config.gcc 2015-09-10 16:17:53.000000000 +0200
++++ gcc-5.4.0/gcc/config.gcc 2016-07-01 21:26:02.772958441 +0200
+@@ -808,6 +808,9 @@
+ *-*-uclinux*)
+ extra_options="$extra_options gnu-user.opt"
+ use_gcc_stdint=wrap
++ case ${enable_threads} in
++ "" | yes | posix) thread_file='posix' ;;
++ esac
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC"
+ ;;
+ *-*-rdos*)