summaryrefslogtreecommitdiff
path: root/toolchain
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-11-10 12:03:59 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-11-10 12:03:59 +0000
commit8b5d644bb36846660e1fa20d38361fec12a14b28 (patch)
tree3862ad9cadac2989690765d921a16b875147180a /toolchain
parent759b1c11872d5df4bd198aaff2a5cf7e68a85314 (diff)
downloadmtk-20170518-8b5d644bb36846660e1fa20d38361fec12a14b28.zip
mtk-20170518-8b5d644bb36846660e1fa20d38361fec12a14b28.tar.gz
mtk-20170518-8b5d644bb36846660e1fa20d38361fec12a14b28.tar.bz2
toolchain: add support of ARC architecture
This includes binutils, gcc, gdb and uClibc-ng. Latest release of ARC gcc (as of today it is "arc-2015.06") is based on upstream gcc 4.8.4. Sources are available on GitHub, see: https://github.com/foss-for-synopsys-dwc-arc-processors/gcc Latest release of ARC binutils (as of today it is "arc-2015.06") is based on upstream binutils 2.23. Sources are available on GitHub, see: https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06 Latest release of ARC GDB (as of today this is "arc-2015.06-gdb") is based on upstream gdb 7.9.1. Sources are available on GitHub, see: https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06-gdb Note that for binutils and gdb that come from unified git repository (which is the case for upstream binutils/gdb today) we need to disable building of gdb in binutils and binutils in gdb hence in binutils: ------>8------ --disable-sim --disable-gdb ------>8------ and in gdb: ------>8------ --disable-binutils --disable-ld --disable-gas ------>8------ Also in gdb we disable sim because if the following breakage while building with it: ------------>8------------ /usr/bin/env bash ./../common/genmloop.sh -shell /usr/bin/env bash \ -mono -fast -pbb -switch sem5-switch.c \ -cpu a5f -infile ./mloop5.in \ -outfile-suffix 5 unknown option: bash Makefile:699: recipe for target 'stamp-5mloop' failed make[7]: *** [stamp-5mloop] Error 1 ------------>8------------ Cc: Felix Fietkau <nbd@openwrt.org> Cc: John Crispin <blogic@openwrt.org> Cc: Jonas Gorski <jogo@openwrt.org> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> SVN-Revision: 47438
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/Config.in9
-rw-r--r--toolchain/binutils/Config.in23
-rw-r--r--toolchain/binutils/Config.version17
-rw-r--r--toolchain/binutils/Makefile29
-rw-r--r--toolchain/gcc/Config.in9
-rw-r--r--toolchain/gcc/Config.version9
-rw-r--r--toolchain/gcc/common.mk31
-rw-r--r--toolchain/gcc/patches/arc-2015.06/001-revert_register_mode_search.patch65
-rw-r--r--toolchain/gcc/patches/arc-2015.06/002-weak_data_fix.patch42
-rw-r--r--toolchain/gcc/patches/arc-2015.06/003-universal_initializer.patch94
-rw-r--r--toolchain/gcc/patches/arc-2015.06/004-case_insensitive.patch14
-rw-r--r--toolchain/gcc/patches/arc-2015.06/010-documentation.patch23
-rw-r--r--toolchain/gcc/patches/arc-2015.06/020-no-plt-backport.patch28
-rw-r--r--toolchain/gcc/patches/arc-2015.06/100-uclibc-conf.patch33
-rw-r--r--toolchain/gcc/patches/arc-2015.06/210-disable_libsanitizer_off_t_check.patch11
-rw-r--r--toolchain/gcc/patches/arc-2015.06/800-arc-disablelibgmon.patch18
-rw-r--r--toolchain/gcc/patches/arc-2015.06/820-libgcc_pic.patch36
-rw-r--r--toolchain/gcc/patches/arc-2015.06/850-use_shared_libgcc.patch47
-rw-r--r--toolchain/gcc/patches/arc-2015.06/851-libgcc_no_compat.patch12
-rw-r--r--toolchain/gcc/patches/arc-2015.06/860-use_eh_frame.patch42
-rw-r--r--toolchain/gcc/patches/arc-2015.06/870-ppc_no_crtsavres.patch11
-rw-r--r--toolchain/gcc/patches/arc-2015.06/880-no_java_section.patch11
-rw-r--r--toolchain/gcc/patches/arc-2015.06/910-mbsd_multi.patch253
-rw-r--r--toolchain/gcc/patches/arc-2015.06/920-specs_nonfatal_getenv.patch14
-rw-r--r--toolchain/gcc/patches/arc-2015.06/940-no-clobber-stamp-bits.patch11
-rw-r--r--toolchain/gdb/Makefile19
-rw-r--r--toolchain/uClibc/common.mk1
-rw-r--r--toolchain/uClibc/config/arc10
28 files changed, 891 insertions, 31 deletions
diff --git a/toolchain/Config.in b/toolchain/Config.in
index deff21a..2d7fcc1 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -212,6 +212,7 @@ comment "C Library"
choice
prompt "C Library implementation" if TOOLCHAINOPTS
default LIBC_USE_GLIBC if mips64 || mips64el
+ default LIBC_USE_UCLIBC if arc
default LIBC_USE_MUSL
help
Select the C library implementation.
@@ -219,6 +220,7 @@ choice
config LIBC_USE_GLIBC
bool "Use (e)glibc"
select USE_GLIBC
+ depends on !arc
config LIBC_USE_UCLIBC
select USE_UCLIBC
@@ -229,7 +231,7 @@ choice
config LIBC_USE_MUSL
select USE_MUSL
bool "Use musl"
- depends on !(mips64 || mips64el)
+ depends on !(arc || mips64 || mips64el)
endchoice
@@ -260,17 +262,18 @@ config USE_GLIBC
bool
config USE_UCLIBC
- default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (mips64 || mips64el)
+ default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc || mips64 || mips64el)
bool
config USE_MUSL
- default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(mips64 || mips64el)
+ default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc || mips64 || mips64el)
bool
config USE_EXTERNAL_LIBC
bool
default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
+source "toolchain/binutils/Config.version"
source "toolchain/gcc/Config.version"
source "toolchain/glibc/Config.version"
diff --git a/toolchain/binutils/Config.in b/toolchain/binutils/Config.in
index 27b2ffa..4fa8ab9 100644
--- a/toolchain/binutils/Config.in
+++ b/toolchain/binutils/Config.in
@@ -2,15 +2,25 @@
choice
prompt "Binutils Version" if TOOLCHAINOPTS
- default BINUTILS_VERSION_LINARO
+ default BINUTILS_USE_VERSION_2_24_LINARO if !arc
+ default BINUTILS_USE_VERSION_2_23_ARC if arc
help
Select the version of binutils you wish to use.
- config BINUTILS_VERSION_LINARO
+ config BINUTILS_USE_VERSION_2_24_LINARO
+ depends on !arc
bool "Linaro binutils 2.24"
+ select BINUTILS_VERSION_2_24_LINARO
- config BINUTILS_VERSION_2_25_1
+ config BINUTILS_USE_VERSION_2_25_1
+ depends on !arc
bool "Binutils 2.25.1"
+ select BINUTILS_VERSION_2_25_1
+
+ config BINUTILS_USE_VERSION_2_23_ARC
+ depends on arc
+ bool "ARC binutils 2.23"
+ select BINUTILS_VERSION_2_23_ARC
endchoice
@@ -20,10 +30,3 @@ config EXTRA_BINUTILS_CONFIG_OPTIONS
default ""
help
Any additional binutils options you may want to include....
-
-config BINUTILS_VERSION
- string
- prompt "Binutils Version" if (TOOLCHAINOPTS && NULL)
- default "linaro" if BINUTILS_VERSION_LINARO
- default "2.25.1" if BINUTILS_VERSION_2_25_1
- default "linaro"
diff --git a/toolchain/binutils/Config.version b/toolchain/binutils/Config.version
new file mode 100644
index 0000000..0a57c17
--- /dev/null
+++ b/toolchain/binutils/Config.version
@@ -0,0 +1,17 @@
+config BINUTILS_VERSION_2_24_LINARO
+ default y if (!TOOLCHAINOPTS && !arc)
+ bool
+
+config BINUTILS_VERSION_2_25_1
+ bool
+
+config BINUTILS_VERSION_2_23_ARC
+ default y if (!TOOLCHAINOPTS && arc)
+ bool
+
+config BINUTILS_VERSION
+ string
+ default "2.24-linaro" if BINUTILS_VERSION_2_24_LINARO
+ default "2.25.1" if BINUTILS_VERSION_2_25_1
+ default "arc-2015.06" if BINUTILS_VERSION_2_23_ARC
+
diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile
index 0028a02..c37148e 100644
--- a/toolchain/binutils/Makefile
+++ b/toolchain/binutils/Makefile
@@ -10,6 +10,13 @@ PKG_NAME:=binutils
PKG_VERSION:=$(call qstrip,$(CONFIG_BINUTILS_VERSION))
BIN_VERSION:=$(PKG_VERSION)
+PKG_SOURCE_URL:=@GNU/binutils/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+
+ifeq ($(PKG_VERSION),2.25.1)
+ PKG_MD5SUM:=ac493a78de4fee895961d025b7905be4
+endif
+
ifeq ($(findstring linaro, $(CONFIG_BINUTILS_VERSION)),linaro)
PKG_SOURCE_URL:=https://releases.linaro.org/14.09/components/toolchain/binutils-linaro/
PKG_REV:=2.24.0-2014.09
@@ -17,13 +24,15 @@ ifeq ($(findstring linaro, $(CONFIG_BINUTILS_VERSION)),linaro)
PKG_MD5SUM:=8f9b2b2e049d59b1b86ce9657802a353
BINUTILS_DIR:=$(PKG_NAME)-linaro-$(PKG_REV)
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(BINUTILS_DIR)
-else
- PKG_SOURCE_URL:=@GNU/binutils/
- PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+endif
- ifeq ($(PKG_VERSION),2.25.1)
- PKG_MD5SUM:=ac493a78de4fee895961d025b7905be4
- endif
+ifneq ($(CONFIG_BINUTILS_VERSION_2_23_ARC),)
+ PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2015.06/
+ PKG_REV:=2015.06
+ PKG_SOURCE:=$(PKG_NAME)-arc-$(PKG_REV).tar.gz
+ PKG_MD5SUM:=961a3564de857238c255c381f8e4360b
+ BINUTILS_DIR:=$(PKG_NAME)-gdb-arc-$(PKG_REV)
+ HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(BINUTILS_DIR)
endif
HOST_BUILD_PARALLEL:=1
@@ -46,6 +55,8 @@ BINUTILS_CONFIGURE:= \
--disable-multilib \
--disable-werror \
--disable-nls \
+ --disable-sim \
+ --disable-gdb \
$(GRAPHITE_CONFIGURE) \
$(SOFT_FLOAT_CONFIG_OPTION) \
$(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
@@ -91,6 +102,12 @@ define Host/Install
$(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
$(RM) $(TOOLCHAIN_DIR)/initial/lib/libiberty.a
$(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
+ # ARC gcc requires extlib.
+ # If extlib is not available in "initial" folder
+ # initial gcc will fail to build libc.
+ if [ -d $(TOOLCHAIN_DIR)/extlib ]; then \
+ $(CP) -r $(TOOLCHAIN_DIR)/extlib $(TOOLCHAIN_DIR)/initial/; \
+ fi
endef
define Host/Clean
diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in
index 2d4400a..f14356b 100644
--- a/toolchain/gcc/Config.in
+++ b/toolchain/gcc/Config.in
@@ -3,6 +3,7 @@
choice
prompt "GCC compiler Version" if TOOLCHAINOPTS
default GCC_USE_VERSION_4_6_LINARO if TARGET_octeon
+ default GCC_USE_VERSION_4_8_ARC if arc
default GCC_USE_VERSION_4_8_LINARO
help
Select the version of gcc you wish to use.
@@ -10,14 +11,22 @@ choice
config GCC_USE_VERSION_4_6_LINARO
select GCC_VERSION_4_6_LINARO
bool "gcc 4.6.x with Linaro enhancements"
+ depends on !arc
config GCC_USE_VERSION_4_8_LINARO
select GCC_VERSION_4_8_LINARO
bool "gcc 4.8.x with Linaro enhancements"
+ depends on !arc
+
+ config GCC_USE_VERSION_4_8_ARC
+ select GCC_VERSION_4_8_ARC
+ bool "gcc 4.8.x with support of ARC cores"
+ depends on arc
config GCC_USE_VERSION_5
select GCC_VERSION_5
bool "gcc 5.x"
+ depends on !arc
endchoice
diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version
index 9636fca..8fd658e 100644
--- a/toolchain/gcc/Config.version
+++ b/toolchain/gcc/Config.version
@@ -3,7 +3,11 @@ config GCC_VERSION_4_6_LINARO
bool
config GCC_VERSION_4_8_LINARO
- default y if (!TOOLCHAINOPTS && !TARGET_octeon)
+ default y if (!TOOLCHAINOPTS && !(TARGET_octeon || arc))
+ bool
+
+config GCC_VERSION_4_8_ARC
+ default y if (!TOOLCHAINOPTS && arc)
bool
config GCC_VERSION
@@ -11,6 +15,7 @@ config GCC_VERSION
default "5.2.0" if GCC_VERSION_5
default "4.6-linaro" if GCC_VERSION_4_6_LINARO
default "4.8-linaro" if GCC_VERSION_4_8_LINARO
+ default "arc-2015.06" if GCC_VERSION_4_8_ARC
default "4.6-linaro"
config GCC_VERSION_4_6
@@ -19,7 +24,7 @@ config GCC_VERSION_4_6
config GCC_VERSION_4_8
bool
- default y if GCC_VERSION_4_8_LINARO
+ default y if (GCC_VERSION_4_8_LINARO || GCC_VERSION_4_8_ARC)
config GCC_VERSION_5
bool
diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk
index b33769c..5214765 100644
--- a/toolchain/gcc/common.mk
+++ b/toolchain/gcc/common.mk
@@ -25,6 +25,19 @@ GCC_VERSION:=$(call qstrip,$(CONFIG_GCC_VERSION))
PKG_VERSION:=$(firstword $(subst +, ,$(GCC_VERSION)))
GCC_DIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+
+ifeq ($(PKG_VERSION),4.6.3)
+ PKG_MD5SUM:=773092fe5194353b02bb0110052a972e
+endif
+ifeq ($(PKG_VERSION),4.8.0)
+ PKG_MD5SUM:=e6040024eb9e761c3bea348d1fa5abb0
+endif
+ifeq ($(PKG_VERSION),5.2.0)
+ PKG_MD5SUM:=a51bcfeb3da7dd4c623e27207ed43467
+endif
+
ifeq ($(findstring linaro, $(CONFIG_GCC_VERSION)),linaro)
LINARO_RELEASE:=
ifeq ($(CONFIG_GCC_VERSION),"4.6-linaro")
@@ -49,16 +62,16 @@ ifeq ($(findstring linaro, $(CONFIG_GCC_VERSION)),linaro)
PKG_SOURCE:=$(PKG_NAME)-linaro-$(PKG_REV).tar.$(PKG_COMP)
GCC_DIR:=gcc-linaro-$(PKG_REV)
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GCC_DIR)
-else
- PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION)
- PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+endif
- ifeq ($(PKG_VERSION),4.8.0)
- PKG_MD5SUM:=e6040024eb9e761c3bea348d1fa5abb0
- endif
- ifeq ($(PKG_VERSION),5.2.0)
- PKG_MD5SUM:=a51bcfeb3da7dd4c623e27207ed43467
- endif
+ifneq ($(CONFIG_GCC_VERSION_4_8_ARC),)
+ PKG_VERSION:=4.8.4
+ PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/gcc/archive/arc-2015.06
+ PKG_SOURCE:=$(PKG_NAME)-$(GCC_VERSION).tar.gz
+ PKG_MD5SUM:=25007ebb02a5f6c32532b103bb5984a0
+ PKG_REV:=2015.06
+ GCC_DIR:=gcc-arc-$(PKG_REV)
+ HOST_BUILD_DIR = $(BUILD_DIR_HOST)/$(PKG_NAME)-$(GCC_VERSION)
endif
PATCH_DIR=../patches/$(GCC_VERSION)
diff --git a/toolchain/gcc/patches/arc-2015.06/001-revert_register_mode_search.patch b/toolchain/gcc/patches/arc-2015.06/001-revert_register_mode_search.patch
new file mode 100644
index 0000000..162d651
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/001-revert_register_mode_search.patch
@@ -0,0 +1,65 @@
+Revert of:
+
+commit 275035b56823b26d5fb7e90fad945b998648edf2
+Author: bergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Thu Sep 5 14:09:07 2013 +0000
+
+ PR target/58139
+ * reginfo.c (choose_hard_reg_mode): Scan through all mode classes
+ looking for widest mode.
+
+
+ git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202286 138bc75d-0d04-0410-961f-82ee72b054a4
+
+
+--- a/gcc/reginfo.c
++++ b/gcc/reginfo.c
+@@ -620,35 +620,40 @@ choose_hard_reg_mode (unsigned int regno
+ mode = GET_MODE_WIDER_MODE (mode))
+ if ((unsigned) hard_regno_nregs[regno][mode] == nregs
+ && HARD_REGNO_MODE_OK (regno, mode)
+- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
+- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
+ found_mode = mode;
+
++ if (found_mode != VOIDmode)
++ return found_mode;
++
+ for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT);
+ mode != VOIDmode;
+ mode = GET_MODE_WIDER_MODE (mode))
+ if ((unsigned) hard_regno_nregs[regno][mode] == nregs
+ && HARD_REGNO_MODE_OK (regno, mode)
+- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
+- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
+ found_mode = mode;
+
++ if (found_mode != VOIDmode)
++ return found_mode;
++
+ for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT);
+ mode != VOIDmode;
+ mode = GET_MODE_WIDER_MODE (mode))
+ if ((unsigned) hard_regno_nregs[regno][mode] == nregs
+ && HARD_REGNO_MODE_OK (regno, mode)
+- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
+- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
+ found_mode = mode;
+
++ if (found_mode != VOIDmode)
++ return found_mode;
++
+ for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT);
+ mode != VOIDmode;
+ mode = GET_MODE_WIDER_MODE (mode))
+ if ((unsigned) hard_regno_nregs[regno][mode] == nregs
+ && HARD_REGNO_MODE_OK (regno, mode)
+- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
+- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
+ found_mode = mode;
+
+ if (found_mode != VOIDmode)
diff --git a/toolchain/gcc/patches/arc-2015.06/002-weak_data_fix.patch b/toolchain/gcc/patches/arc-2015.06/002-weak_data_fix.patch
new file mode 100644
index 0000000..a740b4c
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/002-weak_data_fix.patch
@@ -0,0 +1,42 @@
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/visibility-21.c
+@@ -0,0 +1,14 @@
++/* PR target/32219 */
++/* { dg-do run } */
++/* { dg-require-visibility "" } */
++/* { dg-options "-fPIC" { target fpic } } */
++
++extern void f() __attribute__((weak,visibility("hidden")));
++extern int puts( char const* );
++int main()
++{
++ if (f)
++ f();
++ return 0;
++}
++
+--- a/gcc/varasm.c
++++ b/gcc/varasm.c
+@@ -6677,6 +6677,10 @@ default_binds_local_p_1 (const_tree exp,
+ /* Static variables are always local. */
+ else if (! TREE_PUBLIC (exp))
+ local_p = true;
++ /* hidden weak can't be overridden by something non-local, all
++ that is possible is that it is not defined at all. */
++ else if (DECL_WEAK (exp))
++ local_p = false;
+ /* A variable is local if the user has said explicitly that it will
+ be. */
+ else if ((DECL_VISIBILITY_SPECIFIED (exp)
+@@ -6690,11 +6694,6 @@ default_binds_local_p_1 (const_tree exp,
+ local. */
+ else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
+ local_p = true;
+- /* Default visibility weak data can be overridden by a strong symbol
+- in another module and so are not local. */
+- else if (DECL_WEAK (exp)
+- && !resolved_locally)
+- local_p = false;
+ /* If PIC, then assume that any global name can be overridden by
+ symbols resolved from other modules. */
+ else if (shlib)
diff --git a/toolchain/gcc/patches/arc-2015.06/003-universal_initializer.patch b/toolchain/gcc/patches/arc-2015.06/003-universal_initializer.patch
new file mode 100644
index 0000000..1b9a5b3
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/003-universal_initializer.patch
@@ -0,0 +1,94 @@
+--- a/gcc/c/c-typeck.c
++++ b/gcc/c/c-typeck.c
+@@ -62,9 +62,9 @@ int in_typeof;
+ if expr.original_code == SIZEOF_EXPR. */
+ tree c_last_sizeof_arg;
+
+-/* Nonzero if we've already printed a "missing braces around initializer"
+- message within this initializer. */
+-static int missing_braces_mentioned;
++/* Nonzero if we might need to print a "missing braces around
++ initializer" message within this initializer. */
++static int found_missing_braces;
+
+ static int require_constant_value;
+ static int require_constant_elements;
+@@ -6363,6 +6363,9 @@ static int constructor_nonconst;
+ /* 1 if this constructor is erroneous so far. */
+ static int constructor_erroneous;
+
++/* 1 if this constructor is the universal zero initializer { 0 }. */
++static int constructor_zeroinit;
++
+ /* Structure for managing pending initializer elements, organized as an
+ AVL tree. */
+
+@@ -6524,7 +6527,7 @@ start_init (tree decl, tree asmspec_tree
+ constructor_stack = 0;
+ constructor_range_stack = 0;
+
+- missing_braces_mentioned = 0;
++ found_missing_braces = 0;
+
+ spelling_base = 0;
+ spelling_size = 0;
+@@ -6619,6 +6622,7 @@ really_start_incremental_init (tree type
+ constructor_type = type;
+ constructor_incremental = 1;
+ constructor_designated = 0;
++ constructor_zeroinit = 1;
+ designator_depth = 0;
+ designator_erroneous = 0;
+
+@@ -6816,11 +6820,8 @@ push_init_level (int implicit, struct ob
+ set_nonincremental_init (braced_init_obstack);
+ }
+
+- if (implicit == 1 && warn_missing_braces && !missing_braces_mentioned)
+- {
+- missing_braces_mentioned = 1;
+- warning_init (OPT_Wmissing_braces, "missing braces around initializer");
+- }
++ if (implicit == 1)
++ found_missing_braces = 1;
+
+ if (TREE_CODE (constructor_type) == RECORD_TYPE
+ || TREE_CODE (constructor_type) == UNION_TYPE)
+@@ -6953,16 +6954,23 @@ pop_init_level (int implicit, struct obs
+ }
+ }
+
++ if (vec_safe_length (constructor_elements) != 1)
++ constructor_zeroinit = 0;
++
++ /* Warn when some structs are initialized with direct aggregation. */
++ if (!implicit && found_missing_braces && warn_missing_braces
++ && !constructor_zeroinit)
++ {
++ warning_init (OPT_Wmissing_braces,
++ "missing braces around initializer");
++ }
++
+ /* Warn when some struct elements are implicitly initialized to zero. */
+ if (warn_missing_field_initializers
+ && constructor_type
+ && TREE_CODE (constructor_type) == RECORD_TYPE
+ && constructor_unfilled_fields)
+ {
+- bool constructor_zeroinit =
+- (vec_safe_length (constructor_elements) == 1
+- && integer_zerop ((*constructor_elements)[0].value));
+-
+ /* Do not warn for flexible array members or zero-length arrays. */
+ while (constructor_unfilled_fields
+ && (!DECL_SIZE (constructor_unfilled_fields)
+@@ -8077,6 +8085,9 @@ process_init_element (struct c_expr valu
+ designator_depth = 0;
+ designator_erroneous = 0;
+
++ if (!implicit && value.value && !integer_zerop (value.value))
++ constructor_zeroinit = 0;
++
+ /* Handle superfluous braces around string cst as in
+ char x[] = {"foo"}; */
+ if (string_flag
diff --git a/toolchain/gcc/patches/arc-2015.06/004-case_insensitive.patch b/toolchain/gcc/patches/arc-2015.06/004-case_insensitive.patch
new file mode 100644
index 0000000..b3d2dbe
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/004-case_insensitive.patch
@@ -0,0 +1,14 @@
+--- a/include/filenames.h
++++ b/include/filenames.h
+@@ -43,11 +43,6 @@ extern "C" {
+ # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c)
+ # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f)
+ #else /* not DOSish */
+-# if defined(__APPLE__)
+-# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
+-# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
+-# endif
+-# endif /* __APPLE__ */
+ # define HAS_DRIVE_SPEC(f) (0)
+ # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c)
+ # define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f)
diff --git a/toolchain/gcc/patches/arc-2015.06/010-documentation.patch b/toolchain/gcc/patches/arc-2015.06/010-documentation.patch
new file mode 100644
index 0000000..5548069
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/010-documentation.patch
@@ -0,0 +1,23 @@
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -4327,18 +4327,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
+ doc/gccint.info: $(TEXI_GCCINT_FILES)
+ doc/cppinternals.info: $(TEXI_CPPINT_FILES)
+
+-doc/%.info: %.texi
+- if [ x$(BUILD_INFO) = xinfo ]; then \
+- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \
+- -I $(gcc_docdir)/include -o $@ $<; \
+- fi
++doc/%.info:
+
+ # Duplicate entry to handle renaming of gccinstall.info
+-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES)
+- if [ x$(BUILD_INFO) = xinfo ]; then \
+- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \
+- -I $(gcc_docdir)/include -o $@ $<; \
+- fi
++doc/gccinstall.info:
+
+ doc/cpp.dvi: $(TEXI_CPP_FILES)
+ doc/gcc.dvi: $(TEXI_GCC_FILES)
diff --git a/toolchain/gcc/patches/arc-2015.06/020-no-plt-backport.patch b/toolchain/gcc/patches/arc-2015.06/020-no-plt-backport.patch
new file mode 100644
index 0000000..b225376
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/020-no-plt-backport.patch
@@ -0,0 +1,28 @@
+--- a/gcc/calls.c
++++ b/gcc/calls.c
+@@ -176,6 +176,12 @@ prepare_call_address (tree fndecl, rtx f
+ && targetm.small_register_classes_for_mode_p (FUNCTION_MODE))
+ ? force_not_mem (memory_address (FUNCTION_MODE, funexp))
+ : memory_address (FUNCTION_MODE, funexp));
++ else if (flag_pic && !flag_plt && fndecl
++ && TREE_CODE (fndecl) == FUNCTION_DECL
++ && !targetm.binds_local_p (fndecl))
++ {
++ funexp = force_reg (Pmode, funexp);
++ }
+ else if (! sibcallp)
+ {
+ #ifndef NO_FUNCTION_CSE
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -1617,6 +1617,10 @@ fpie
+ Common Report Var(flag_pie,1) Negative(fPIC)
+ Generate position-independent code for executables if possible (small mode)
+
++fplt
++Common Report Var(flag_plt) Init(1)
++Use PLT for PIC calls (-fno-plt: load the address from GOT at call site)
++
+ fplugin=
+ Common Joined RejectNegative Var(common_deferred_options) Defer
+ Specify a plugin to load
diff --git a/toolchain/gcc/patches/arc-2015.06/100-uclibc-conf.patch b/toolchain/gcc/patches/arc-2015.06/100-uclibc-conf.patch
new file mode 100644
index 0000000..ff9ad94
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/100-uclibc-conf.patch
@@ -0,0 +1,33 @@
+--- a/contrib/regression/objs-gcc.sh
++++ b/contrib/regression/objs-gcc.sh
+@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++ make all-gdb all-dejagnu all-ld || exit 1
++ make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
+--- a/libjava/classpath/ltconfig
++++ b/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+
+@@ -1247,7 +1247,7 @@ linux-gnuoldld* | linux-gnuaout* | linux
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
diff --git a/toolchain/gcc/patches/arc-2015.06/210-disable_libsanitizer_off_t_check.patch b/toolchain/gcc/patches/arc-2015.06/210-disable_libsanitizer_off_t_check.patch
new file mode 100644
index 0000000..5608469
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/210-disable_libsanitizer_off_t_check.patch
@@ -0,0 +1,11 @@
+--- a/libsanitizer/interception/interception_type_test.cc
++++ b/libsanitizer/interception/interception_type_test.cc
+@@ -31,7 +31,7 @@ COMPILER_CHECK(sizeof(OFF64_T) == sizeof
+ // rest (they depend on _FILE_OFFSET_BITS setting when building an application).
+ # if defined(__ANDROID__) || !defined _FILE_OFFSET_BITS || \
+ _FILE_OFFSET_BITS != 64
+-COMPILER_CHECK(sizeof(OFF_T) == sizeof(off_t));
++// COMPILER_CHECK(sizeof(OFF_T) == sizeof(off_t));
+ # endif
+
+ #endif
diff --git a/toolchain/gcc/patches/arc-2015.06/800-arc-disablelibgmon.patch b/toolchain/gcc/patches/arc-2015.06/800-arc-disablelibgmon.patch
new file mode 100644
index 0000000..612883c
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/800-arc-disablelibgmon.patch
@@ -0,0 +1,18 @@
+diff --git a/libgcc/config.host b/libgcc/config.host
+index e768389..aec10c7 100644
+--- a/libgcc/config.host
++++ b/libgcc/config.host
+@@ -320,11 +320,11 @@ alpha*-dec-*vms*)
+ ;;
+ arc*-*-elf*)
+ tmake_file="arc/t-arc-newlib arc/t-arc"
+- extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o libgmon.a crtg.o crtgend.o crttls_r25.o crttls_r30.o"
++ extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o crtg.o crtgend.o crttls_r25.o crttls_r30.o"
+ ;;
+ arc*-*-linux-uclibc*)
+ tmake_file="${tmake_file} t-slibgcc-libgcc t-slibgcc-nolc-override arc/t-arc700-uClibc arc/t-arc"
+- extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o libgmon.a crtg.o crtgend.o"
++ extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o crtg.o crtgend.o"
+ ;;
+ arm-wrs-vxworks)
+ tmake_file="$tmake_file arm/t-arm arm/t-vxworks t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
diff --git a/toolchain/gcc/patches/arc-2015.06/820-libgcc_pic.patch b/toolchain/gcc/patches/arc-2015.06/820-libgcc_pic.patch
new file mode 100644
index 0000000..7a0ac73
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/820-libgcc_pic.patch
@@ -0,0 +1,36 @@
+--- a/libgcc/Makefile.in
++++ b/libgcc/Makefile.in
+@@ -865,11 +865,12 @@ $(libgcov-objects): %$(objext): $(srcdir
+
+ # Static libraries.
+ libgcc.a: $(libgcc-objects)
++libgcc_pic.a: $(libgcc-s-objects)
+ libgcov.a: $(libgcov-objects)
+ libunwind.a: $(libunwind-objects)
+ libgcc_eh.a: $(libgcc-eh-objects)
+
+-libgcc.a libgcov.a libunwind.a libgcc_eh.a:
++libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a:
+ -rm -f $@
+
+ objects="$(objects)"; \
+@@ -891,7 +892,7 @@ libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_E
+ endif
+
+ ifeq ($(enable_shared),yes)
+-all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
++all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT)
+ ifneq ($(LIBUNWIND),)
+ all: libunwind$(SHLIB_EXT)
+ endif
+@@ -1058,6 +1059,10 @@ install-shared:
+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
+
++ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/
++ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a
++ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a
++
+ $(subst @multilib_dir@,$(MULTIDIR),$(subst \
+ @shlib_base_name@,libgcc_s,$(subst \
+ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
diff --git a/toolchain/gcc/patches/arc-2015.06/850-use_shared_libgcc.patch b/toolchain/gcc/patches/arc-2015.06/850-use_shared_libgcc.patch
new file mode 100644
index 0000000..6934bc9
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/850-use_shared_libgcc.patch
@@ -0,0 +1,47 @@
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -131,10 +131,6 @@
+ #define ENDFILE_SPEC \
+ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
+
+-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
+- do not use -lfloat. */
+-#undef LIBGCC_SPEC
+-
+ /* Clear the instruction cache from `beg' to `end'. This is
+ implemented in lib1funcs.S, so ensure an error if this definition
+ is used. */
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -51,6 +51,10 @@ see the files COPYING3 and COPYING.RUNTI
+ builtin_assert ("system=posix"); \
+ } while (0)
+
++#ifndef LIBGCC_SPEC
++#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}"
++#endif
++
+ /* Determine which dynamic linker to use depending on whether GLIBC or
+ uClibc or Bionic is the default C library and whether
+ -muclibc or -mglibc or -mbionic has been passed to change the default. */
+--- a/libgcc/mkmap-symver.awk
++++ b/libgcc/mkmap-symver.awk
+@@ -132,5 +132,5 @@ function output(lib) {
+ else if (inherit[lib])
+ printf("} %s;\n", inherit[lib]);
+ else
+- printf ("\n local:\n\t*;\n};\n");
++ printf ("\n\t*;\n};\n");
+ }
+--- a/gcc/config/rs6000/linux.h
++++ b/gcc/config/rs6000/linux.h
+@@ -61,6 +61,9 @@
+ #undef CPLUSPLUS_CPP_SPEC
+ #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
+
++#undef LIBGCC_SPEC
++#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc"
++
+ #undef LINK_SHLIB_SPEC
+ #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}"
+
diff --git a/toolchain/gcc/patches/arc-2015.06/851-libgcc_no_compat.patch b/toolchain/gcc/patches/arc-2015.06/851-libgcc_no_compat.patch
new file mode 100644
index 0000000..80c3476
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/851-libgcc_no_compat.patch
@@ -0,0 +1,12 @@
+--- a/libgcc/config/t-libunwind
++++ b/libgcc/config/t-libunwind
+@@ -2,8 +2,7 @@
+
+ HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER
+
+-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
+- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c
++LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+ LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+
+ # Override the default value from t-slibgcc-elf-ver and mention -lunwind
diff --git a/toolchain/gcc/patches/arc-2015.06/860-use_eh_frame.patch b/toolchain/gcc/patches/arc-2015.06/860-use_eh_frame.patch
new file mode 100644
index 0000000..1ac83fe
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/860-use_eh_frame.patch
@@ -0,0 +1,42 @@
+--- a/libgcc/unwind-dw2-fde-dip.c
++++ b/libgcc/unwind-dw2-fde-dip.c
+@@ -46,33 +46,13 @@
+ #include "unwind-compat.h"
+ #include "gthr.h"
+
+-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
+- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
+-# define USE_PT_GNU_EH_FRAME
+-#endif
+-
+-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+- && defined(__BIONIC__)
+-# define USE_PT_GNU_EH_FRAME
+-#endif
+-
+-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+- && defined(__FreeBSD__) && __FreeBSD__ >= 7
+-# define ElfW __ElfN
+-# define USE_PT_GNU_EH_FRAME
+-#endif
+-
+-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+- && defined(__OpenBSD__)
+-# define ElfW(type) Elf_##type
+-# define USE_PT_GNU_EH_FRAME
+-#endif
+-
+-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+- && defined(TARGET_DL_ITERATE_PHDR) \
+- && defined(__sun__) && defined(__svr4__)
++#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR)
+ # define USE_PT_GNU_EH_FRAME
++# ifdef __OpenBSD__
++# define ElfW(type) Elf_##type
++# elif defined(__FreeBSD__) && __FreeBSD__ >= 7
++# define ElfW __ElfN
++# endif
+ #endif
+
+ #if defined(USE_PT_GNU_EH_FRAME)
diff --git a/toolchain/gcc/patches/arc-2015.06/870-ppc_no_crtsavres.patch b/toolchain/gcc/patches/arc-2015.06/870-ppc_no_crtsavres.patch
new file mode 100644
index 0000000..4b7fcbd
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/870-ppc_no_crtsavres.patch
@@ -0,0 +1,11 @@
+--- a/gcc/config/rs6000/rs6000.c
++++ b/gcc/config/rs6000/rs6000.c
+@@ -17662,7 +17662,7 @@ rs6000_savres_strategy (rs6000_stack_t *
+ /* Define cutoff for using out-of-line functions to save registers. */
+ if (DEFAULT_ABI == ABI_V4 || TARGET_ELF)
+ {
+- if (!optimize_size)
++ if (1)
+ {
+ strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS;
+ strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS;
diff --git a/toolchain/gcc/patches/arc-2015.06/880-no_java_section.patch b/toolchain/gcc/patches/arc-2015.06/880-no_java_section.patch
new file mode 100644
index 0000000..def6c9f
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/880-no_java_section.patch
@@ -0,0 +1,11 @@
+--- a/gcc/defaults.h
++++ b/gcc/defaults.h
+@@ -380,7 +380,7 @@ see the files COPYING3 and COPYING.RUNTI
+ /* If we have named section and we support weak symbols, then use the
+ .jcr section for recording java classes which need to be registered
+ at program start-up time. */
+-#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
++#if 0 && defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
+ #ifndef JCR_SECTION_NAME
+ #define JCR_SECTION_NAME ".jcr"
+ #endif
diff --git a/toolchain/gcc/patches/arc-2015.06/910-mbsd_multi.patch b/toolchain/gcc/patches/arc-2015.06/910-mbsd_multi.patch
new file mode 100644
index 0000000..5387f8e
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/910-mbsd_multi.patch
@@ -0,0 +1,253 @@
+
+ This patch brings over a few features from MirBSD:
+ * -fhonour-copts
+ If this option is not given, it's warned (depending
+ on environment variables). This is to catch errors
+ of misbuilt packages which override CFLAGS themselves.
+ * -Werror-maybe-reset
+ Has the effect of -Wno-error if GCC_NO_WERROR is
+ set and not '0', a no-operation otherwise. This is
+ to be able to use -Werror in "make" but prevent
+ GNU autoconf generated configure scripts from
+ freaking out.
+ * Make -fno-strict-aliasing and -fno-delete-null-pointer-checks
+ the default for -O2/-Os, because they trigger gcc bugs
+ and can delete code with security implications.
+
+ This patch was authored by Thorsten Glaser <tg at mirbsd.de>
+ with copyright assignment to the FSF in effect.
+
+--- a/gcc/c-family/c-opts.c
++++ b/gcc/c-family/c-opts.c
+@@ -104,6 +104,9 @@ static size_t include_cursor;
+ /* Whether any standard preincluded header has been preincluded. */
+ static bool done_preinclude;
+
++/* Check if a port honours COPTS. */
++static int honour_copts = 0;
++
+ static void handle_OPT_d (const char *);
+ static void set_std_cxx98 (int);
+ static void set_std_cxx11 (int);
+@@ -383,6 +386,9 @@ c_common_handle_option (size_t scode, co
+ cpp_opts->warn_endif_labels = value;
+ break;
+
++ case OPT_Werror_maybe_reset:
++ break;
++
+ case OPT_Winvalid_pch:
+ cpp_opts->warn_invalid_pch = value;
+ break;
+@@ -491,6 +497,12 @@ c_common_handle_option (size_t scode, co
+ flag_no_builtin = !value;
+ break;
+
++ case OPT_fhonour_copts:
++ if (c_language == clk_c) {
++ honour_copts++;
++ }
++ break;
++
+ case OPT_fconstant_string_class_:
+ constant_string_class_name = arg;
+ break;
+@@ -1027,6 +1039,47 @@ c_common_init (void)
+ return false;
+ }
+
++ if (c_language == clk_c) {
++ char *ev = getenv ("GCC_HONOUR_COPTS");
++ int evv;
++ if (ev == NULL)
++ evv = -1;
++ else if ((*ev == '0') || (*ev == '\0'))
++ evv = 0;
++ else if (*ev == '1')
++ evv = 1;
++ else if (*ev == '2')
++ evv = 2;
++ else if (*ev == 's')
++ evv = -1;
++ else {
++ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1");
++ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */
++ }
++ if (evv == 1) {
++ if (honour_copts == 0) {
++ error ("someone does not honour COPTS at all in lenient mode");
++ return false;
++ } else if (honour_copts != 1) {
++ warning (0, "someone does not honour COPTS correctly, passed %d times",
++ honour_copts);
++ }
++ } else if (evv == 2) {
++ if (honour_copts == 0) {
++ error ("someone does not honour COPTS at all in strict mode");
++ return false;
++ } else if (honour_copts != 1) {
++ error ("someone does not honour COPTS correctly, passed %d times",
++ honour_copts);
++ return false;
++ }
++ } else if (evv == 0) {
++ if (honour_copts != 1)
++ inform (0, "someone does not honour COPTS correctly, passed %d times",
++ honour_copts);
++ }
++ }
++
+ return true;
+ }
+
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -379,6 +379,10 @@ Werror-implicit-function-declaration
+ C ObjC RejectNegative Warning Alias(Werror=, implicit-function-declaration)
+ This switch is deprecated; use -Werror=implicit-function-declaration instead
+
++Werror-maybe-reset
++C ObjC C++ ObjC++
++; Documented in common.opt
++
+ Wfloat-equal
+ C ObjC C++ ObjC++ Var(warn_float_equal) Warning
+ Warn if testing floating point numbers for equality
+@@ -949,6 +953,9 @@ C++ ObjC++ Optimization Alias(fexception
+ fhonor-std
+ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
+
++fhonour-copts
++C ObjC C++ ObjC++ RejectNegative
++
+ fhosted
+ C ObjC
+ Assume normal C execution environment
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -541,6 +541,10 @@ Werror=
+ Common Joined
+ Treat specified warning as error
+
++Werror-maybe-reset
++Common
++If environment variable GCC_NO_WERROR is set, act as -Wno-error
++
+ Wextra
+ Common Var(extra_warnings) Warning
+ Print extra (possibly unwanted) warnings
+@@ -1242,6 +1246,9 @@ fguess-branch-probability
+ Common Report Var(flag_guess_branch_prob) Optimization
+ Enable guessing of branch probabilities
+
++fhonour-copts
++Common RejectNegative
++
+ ; Nonzero means ignore `#ident' directives. 0 means handle them.
+ ; Generate position-independent code for executables if possible
+ ; On SVR4 targets, it also controls whether or not to emit a
+--- a/gcc/opts.c
++++ b/gcc/opts.c
+@@ -468,8 +468,6 @@ static const struct default_options defa
+ { OPT_LEVELS_2_PLUS, OPT_fschedule_insns2, NULL, 1 },
+ #endif
+ { OPT_LEVELS_2_PLUS, OPT_fregmove, NULL, 1 },
+- { OPT_LEVELS_2_PLUS, OPT_fstrict_aliasing, NULL, 1 },
+- { OPT_LEVELS_2_PLUS, OPT_fstrict_overflow, NULL, 1 },
+ { OPT_LEVELS_2_PLUS, OPT_freorder_blocks, NULL, 1 },
+ { OPT_LEVELS_2_PLUS, OPT_freorder_functions, NULL, 1 },
+ { OPT_LEVELS_2_PLUS, OPT_ftree_vrp, NULL, 1 },
+@@ -489,6 +487,8 @@ static const struct default_options defa
+ { OPT_LEVELS_2_PLUS, OPT_fhoist_adjacent_loads, NULL, 1 },
+
+ /* -O3 optimizations. */
++ { OPT_LEVELS_3_PLUS, OPT_fstrict_aliasing, NULL, 1 },
++ { OPT_LEVELS_3_PLUS, OPT_fstrict_overflow, NULL, 1 },
+ { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
+ { OPT_LEVELS_3_PLUS, OPT_fpredictive_commoning, NULL, 1 },
+ /* Inlining of functions reducing size is a good idea with -Os
+@@ -1435,6 +1435,17 @@ common_handle_option (struct gcc_options
+ opts, opts_set, loc, dc);
+ break;
+
++ case OPT_Werror_maybe_reset:
++ {
++ char *ev = getenv ("GCC_NO_WERROR");
++ if ((ev != NULL) && (*ev != '0'))
++ warnings_are_errors = 0;
++ }
++ break;
++
++ case OPT_fhonour_copts:
++ break;
++
+ case OPT_Wlarger_than_:
+ opts->x_larger_than_size = value;
+ opts->x_warn_larger_than = value != -1;
+--- a/gcc/doc/cppopts.texi
++++ b/gcc/doc/cppopts.texi
+@@ -163,6 +163,11 @@ in older programs. This warning is on b
+ Make all warnings into hard errors. Source code which triggers warnings
+ will be rejected.
+
++ at item -Werror-maybe-reset
++ at opindex Werror-maybe-reset
++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
++variable is set to anything other than 0 or empty.
++
+ @item -Wsystem-headers
+ @opindex Wsystem-headers
+ Issue warnings for code in system headers. These are normally unhelpful
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -240,7 +240,7 @@ Objective-C and Objective-C++ Dialects}.
+ -Wconversion -Wcoverage-mismatch -Wno-cpp -Wno-deprecated @gol
+ -Wno-deprecated-declarations -Wdisabled-optimization @gol
+ -Wno-div-by-zero -Wdouble-promotion -Wempty-body -Wenum-compare @gol
+--Wno-endif-labels -Werror -Werror=* @gol
++-Wno-endif-labels -Werror -Werror=* -Werror-maybe-reset @gol
+ -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol
+ -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
+ -Wformat-security -Wformat-y2k @gol
+@@ -4817,6 +4817,22 @@ This option is only supported for C and
+ @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
+ @option{-Wno-pointer-sign}.
+
++ at item -Werror-maybe-reset
++ at opindex Werror-maybe-reset
++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
++variable is set to anything other than 0 or empty.
++
++ at item -fhonour-copts
++ at opindex fhonour-copts
++If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not
++given at least once, and warn if it is given more than once.
++If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not
++given exactly once.
++If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option
++is not given exactly once.
++The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}.
++This flag and environment variable only affect the C language.
++
+ @item -Wstack-protector
+ @opindex Wstack-protector
+ @opindex Wno-stack-protector
+@@ -6928,7 +6944,7 @@ so, the first branch is redirected to ei
+ second branch or a point immediately following it, depending on whether
+ the condition is known to be true or false.
+
+-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
++Enabled at levels @option{-O3}.
+
+ @item -fsplit-wide-types
+ @opindex fsplit-wide-types
+--- a/gcc/java/jvspec.c
++++ b/gcc/java/jvspec.c
+@@ -626,6 +626,7 @@ lang_specific_pre_link (void)
+ class name. Append dummy `.c' that can be stripped by set_input so %b
+ is correct. */
+ set_input (concat (main_class_name, "main.c", NULL));
++ putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */
+ err = do_spec (jvgenmain_spec);
+ if (err == 0)
+ {
diff --git a/toolchain/gcc/patches/arc-2015.06/920-specs_nonfatal_getenv.patch b/toolchain/gcc/patches/arc-2015.06/920-specs_nonfatal_getenv.patch
new file mode 100644
index 0000000..09768f5
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/920-specs_nonfatal_getenv.patch
@@ -0,0 +1,14 @@
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -8029,7 +8029,10 @@ getenv_spec_function (int argc, const ch
+
+ value = getenv (argv[0]);
+ if (!value)
+- fatal_error ("environment variable %qs not defined", argv[0]);
++ {
++ warning (0, "environment variable %qs not defined", argv[0]);
++ value = "";
++ }
+
+ /* We have to escape every character of the environment variable so
+ they are not interpreted as active spec characters. A
diff --git a/toolchain/gcc/patches/arc-2015.06/940-no-clobber-stamp-bits.patch b/toolchain/gcc/patches/arc-2015.06/940-no-clobber-stamp-bits.patch
new file mode 100644
index 0000000..dbecef2
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2015.06/940-no-clobber-stamp-bits.patch
@@ -0,0 +1,11 @@
+--- a/libstdc++-v3/include/Makefile.in
++++ b/libstdc++-v3/include/Makefile.in
+@@ -1342,7 +1342,7 @@
+ @$(STAMP) stamp-bits
+
+ stamp-bits-sup: stamp-bits ${bits_sup_headers}
+- @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null
++ @-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null
+ @$(STAMP) stamp-bits-sup
+
+ stamp-c_base: ${c_base_headers}
diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile
index f3bca77..d3fe164 100644
--- a/toolchain/gdb/Makefile
+++ b/toolchain/gdb/Makefile
@@ -7,11 +7,24 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gdb
+
+ifeq ($(CONFIG_arc),y)
+PKG_VERSION:=arc-2015.06-gdb
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2015.06-gdb/
+PKG_MD5SUM:=d318829bfd2ed62714817f0d25706825
+GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION)
+else
PKG_VERSION:=7.10
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/gdb
PKG_MD5SUM:=2a35bac41fa8e10bf04f3a0dd7f7f363
+GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION)
+endif
+
+HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GDB_DIR)
HOST_BUILD_PARALLEL:=1
@@ -30,7 +43,11 @@ HOST_CONFIGURE_ARGS = \
--disable-tui --disable-gdbtk --without-x \
--without-included-gettext \
--enable-threads \
- --with-expat
+ --with-expat \
+ --disable-binutils \
+ --disable-ld \
+ --disable-gas \
+ --disable-sim
define Host/Install
mkdir -p $(TOOLCHAIN_DIR)/bin
diff --git a/toolchain/uClibc/common.mk b/toolchain/uClibc/common.mk
index 895022c..3d0a501 100644
--- a/toolchain/uClibc/common.mk
+++ b/toolchain/uClibc/common.mk
@@ -23,6 +23,7 @@ HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/toolchain-build.mk
UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
+ -e 's/arc.*/arc/' \
-e 's/i.86/i386/' \
-e 's/sparc.*/sparc/' \
-e 's/arm.*/arm/g' \
diff --git a/toolchain/uClibc/config/arc b/toolchain/uClibc/config/arc
new file mode 100644
index 0000000..de1ffc4
--- /dev/null
+++ b/toolchain/uClibc/config/arc
@@ -0,0 +1,10 @@
+ARCH_ANY_ENDIAN=y
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+TARGET_ARCH="arc"
+TARGET_arc=y
+CONFIG_ARC_CPU_700=y
+# CONFIG_ARC_CPU_HS is not set
+CONFIG_ARC_PAGE_SIZE_8K=y
+# CONFIG_ARC_PAGE_SIZE_16K is not set
+# CONFIG_ARC_PAGE_SIZE_4K is not set