From 799110936e6345405c8c5790a3fa9cf69ff9af1e Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Wed, 25 Jun 2014 16:06:01 +0200 Subject: [PATCH 01/19] gcc: Add gcc package from git.openwrt.org/packages.git. Signed-off-by: Christian Beier --- devel/gcc/Makefile | 90 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 devel/gcc/Makefile diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile new file mode 100644 index 0000000000..3f69a21875 --- /dev/null +++ b/devel/gcc/Makefile @@ -0,0 +1,90 @@ +# +# Copyright (C) 2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk +PKG_NAME:=gcc +PKG_VERSION:=$(strip $(subst ",, $(CONFIG_GCC_VERSION)))#")) +PKG_RELEASE:=1 +PATCH_DIR=$(TOPDIR)/toolchain/gcc/patches/$(PKG_VERSION) +PKG_SOURCE_URL:=ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-$(PKG_VERSION) \ + http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(PKG_VERSION) \ + ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(PKG_VERSION) + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_MD5SUM:=354853e0b2da90c527e35aabb8d6f1e6 + +include $(INCLUDE_DIR)/package.mk + +SEP:=, +TARGET_LANGUAGES:="c$(if $(CONFIG_INSTALL_LIBSTDCPP),$(SEP)c++)$(if $(CONFIG_INSTALL_LIBGCJ),$(SEP)java)" +EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-biarch --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-uclibc) + +define Package/gcc + SECTION:=devel + CATEGORY:=Development + TITLE:=gcc + DEPENDS:=@TARGET_x86 @NO_STRIP +endef + +define Package/gcc/description + build a native toolchain for compiling on target +endef + +define Build/Prepare + $(call Build/Prepare/Default) + $(SED) 's,\(version_string.. = "[0-9\.]*\).*\(";\),\1 (OpenWrt-2.0)\2,' $(PKG_BUILD_DIR)/gcc/version.c + $(SED) 's,\(bug_report_url.. = "\).*\(";\),\1\2,' $(PKG_BUILD_DIR)/gcc/version.c + (cd $(PKG_BUILD_DIR)/libstdc++-v3; autoconf;); + $(SED) 's,gcc_no_link=yes,gcc_no_link=no,' $(PKG_BUILD_DIR)/libstdc++-v3/configure +endef + +define Build/Configure + (cd $(PKG_BUILD_DIR); rm -f config.cache; \ + SHELL="$(BASH)" \ + $(TARGET_CONFIGURE_OPTS) \ + $(PKG_BUILD_DIR)/configure \ + $(TARGET_CONFIGURE_ARGS) \ + --build=$(GNU_HOST_NAME) \ + --host=$(REAL_GNU_TARGET_NAME) \ + --target=$(REAL_GNU_TARGET_NAME) \ + --enable-languages=$(TARGET_LANGUAGES) \ + --enable-shared \ + --disable-__cxa_atexit \ + --enable-target-optspace \ + --with-gnu-ld \ + --disable-nls \ + --disable-libmudflap \ + --disable-multilib \ + $(EXTRA_TARGET) \ + $(SOFT_FLOAT_CONFIG_OPTION) \ + $(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \ + ); +endef + +define Build/Compile + export SHELL="$(BASH)"; $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" $(MAKE_ARGS) all install + # Set up the symlinks to enable lying about target name. + set -e; \ + (cd $(TOOLCHAIN_DIR); \ + ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \ + cd bin; \ + for app in $(REAL_GNU_TARGET_NAME)-* ; do \ + ln -sf $$$${app} \ + $(GNU_TARGET_NAME)$$$${app##$(REAL_GNU_TARGET_NAME)}; \ + done; \ + ); +endef + +define Package/gcc/install + $(INSTALL_DIR) $(1)/usr/lib/ + cp -r $(PKG_INSTALL_DIR)/* $(1) + cp -r $(TOOLCHAIN_DIR)/include $(1)/usr/ + cp $(TOOLCHAIN_DIR)/lib/crt* $(1)/usr/lib/ + cp $(TOOLCHAIN_DIR)/lib/libc.so $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,gcc)) From 758da3487e02930dfc15f9d147eff30cd00f2549 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Tue, 8 Jul 2014 14:46:56 +0200 Subject: [PATCH 02/19] gcc: Update GCC Makefile to let it build gcc 4.6 for target. Signed-off-by: Christian Beier --- devel/gcc/Makefile | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile index 3f69a21875..a4f7eccbdf 100644 --- a/devel/gcc/Makefile +++ b/devel/gcc/Makefile @@ -4,17 +4,17 @@ # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # +# +# NB: GCC building is a bit special, you need to have the gcc build-deps installed on the build machine as well, +# for instance mpfr, mpc and gmp development packages! +# include $(TOPDIR)/rules.mk PKG_NAME:=gcc -PKG_VERSION:=$(strip $(subst ",, $(CONFIG_GCC_VERSION)))#")) +PKG_VERSION:=linaro-4.6-2013.05 PKG_RELEASE:=1 -PATCH_DIR=$(TOPDIR)/toolchain/gcc/patches/$(PKG_VERSION) -PKG_SOURCE_URL:=ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-$(PKG_VERSION) \ - http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(PKG_VERSION) \ - ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(PKG_VERSION) - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_MD5SUM:=354853e0b2da90c527e35aabb8d6f1e6 +PKG_SOURCE_URL:=https://releases.linaro.org/13.05/components/toolchain/gcc-linaro/4.6/ +PKG_SOURCE:=gcc-$(PKG_VERSION).tar.bz2 +PKG_MD5SUM:=26b48802ae1203cd99415026fbf56ed7 include $(INCLUDE_DIR)/package.mk @@ -34,13 +34,15 @@ define Package/gcc/description endef define Build/Prepare - $(call Build/Prepare/Default) + $(PKG_UNPACK) +# we have to download additional stuff before patching + (cd $(PKG_BUILD_DIR) && ./contrib/download_prerequisites) + $(Build/Patch) $(SED) 's,\(version_string.. = "[0-9\.]*\).*\(";\),\1 (OpenWrt-2.0)\2,' $(PKG_BUILD_DIR)/gcc/version.c $(SED) 's,\(bug_report_url.. = "\).*\(";\),\1\2,' $(PKG_BUILD_DIR)/gcc/version.c - (cd $(PKG_BUILD_DIR)/libstdc++-v3; autoconf;); - $(SED) 's,gcc_no_link=yes,gcc_no_link=no,' $(PKG_BUILD_DIR)/libstdc++-v3/configure endef + define Build/Configure (cd $(PKG_BUILD_DIR); rm -f config.cache; \ SHELL="$(BASH)" \ @@ -51,16 +53,22 @@ define Build/Configure --host=$(REAL_GNU_TARGET_NAME) \ --target=$(REAL_GNU_TARGET_NAME) \ --enable-languages=$(TARGET_LANGUAGES) \ - --enable-shared \ --disable-__cxa_atexit \ --enable-target-optspace \ --with-gnu-ld \ --disable-nls \ --disable-libmudflap \ --disable-multilib \ + --disable-libgomp \ + --disable-libquadmath \ + --disable-decimal-float \ + --with-host-libstdcxx=-lstdc++ \ + --disable-libstdcxx-pch \ $(EXTRA_TARGET) \ $(SOFT_FLOAT_CONFIG_OPTION) \ $(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \ + $(if $(CONFIG_mips64)$(CONFIG_mips64el),--with-arch=mips64 \ + --with-abi=$(subst ",,$(CONFIG_MIPS64_ABI))) \ ); endef From 41f562c0664d9a956b3efaa53e3b81e3a03e734f Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Tue, 8 Jul 2014 14:47:22 +0200 Subject: [PATCH 03/19] gcc: Add README to gcc package explaining build-deps on host machine. Signed-off-by: Christian Beier --- devel/gcc/README | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 devel/gcc/README diff --git a/devel/gcc/README b/devel/gcc/README new file mode 100644 index 0000000000..f172bb900b --- /dev/null +++ b/devel/gcc/README @@ -0,0 +1,9 @@ +Native GCC that runs on target. + +Note that building this one is a bit tricky. First and foremost, your build machine +needs to have the gcc build-deps installed as well, i.e. mpfr, gmp and mpc, amongst +others. + +For now, this was only tested for a mips target. Others to be done... + +Christian Beier \ No newline at end of file From 9ff77b00007bc95f57712372af15035b54c02808 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Tue, 8 Jul 2014 14:48:40 +0200 Subject: [PATCH 04/19] gcc: Add patch that fixes a build error when building a 32bit toolchain on 64bit build machine. Signed-off-by: Christian Beier --- ...-dont-choke-when-building-32bit-on-64bit.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 devel/gcc/patches/002-dont-choke-when-building-32bit-on-64bit.patch diff --git a/devel/gcc/patches/002-dont-choke-when-building-32bit-on-64bit.patch b/devel/gcc/patches/002-dont-choke-when-building-32bit-on-64bit.patch new file mode 100644 index 0000000000..84729605d2 --- /dev/null +++ b/devel/gcc/patches/002-dont-choke-when-building-32bit-on-64bit.patch @@ -0,0 +1,15 @@ +diff --git a/gcc/real.h b/gcc/real.h +index 2ff84f6..fbb4b0e 100644 +--- a/gcc/real.h ++++ b/gcc/real.h +@@ -72,8 +72,10 @@ struct GTY(()) real_value { + + (REAL_VALUE_TYPE_SIZE%HOST_BITS_PER_WIDE_INT ? 1 : 0)) /* round up */ + + /* Verify the guess. */ ++#ifndef __LP64__ + extern char test_real_width + [sizeof(REAL_VALUE_TYPE) <= REAL_WIDTH*sizeof(HOST_WIDE_INT) ? 1 : -1]; ++#endif + + /* Calculate the format for CONST_DOUBLE. We need as many slots as + are necessary to overlay a REAL_VALUE_TYPE on them. This could be From a95a32ce4cabb426ab7b487b55cef7466d851550 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Tue, 8 Jul 2014 14:49:31 +0200 Subject: [PATCH 05/19] gcc: Add patch that fixes GCC building for MIPS. Signed-off-by: Christian Beier --- .../gcc/patches/003-mpfr-longlong-mips.patch | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 devel/gcc/patches/003-mpfr-longlong-mips.patch diff --git a/devel/gcc/patches/003-mpfr-longlong-mips.patch b/devel/gcc/patches/003-mpfr-longlong-mips.patch new file mode 100644 index 0000000000..0ab9fe5032 --- /dev/null +++ b/devel/gcc/patches/003-mpfr-longlong-mips.patch @@ -0,0 +1,38 @@ +diff -Naurd mpfr-2.4.2-a/mpfr-longlong.h mpfr-2.4.2-b/mpfr-longlong.h +--- -a/mpfr-2.4.2/mpfr-longlong.h 2009-11-30 02:43:08.000000000 +0000 ++++ -b/mpfr-2.4.2/mpfr-longlong.h 2009-12-18 12:04:29.000000000 +0000 +@@ -1011,7 +1011,15 @@ + #endif /* __m88000__ */ + + #if defined (__mips) && W_TYPE_SIZE == 32 +-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7 ++#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4) ++#define umul_ppmm(w1, w0, u, v) \ ++ do { \ ++ UDItype _r; \ ++ _r = (UDItype) u * v; \ ++ (w1) = _r >> 32; \ ++ (w0) = (USItype) _r; \ ++ } while (0) ++#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7 + #define umul_ppmm(w1, w0, u, v) \ + __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v)) + #else +@@ -1024,7 +1032,16 @@ + #endif /* __mips */ + + #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64 +-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7 ++#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4) ++typedef unsigned int UTItype __attribute__ ((mode (TI))); ++#define umul_ppmm(w1, w0, u, v) \ ++ do { \ ++ UTItype _r; \ ++ _r = (UTItype) u * v; \ ++ (w1) = _r >> 64; \ ++ (w0) = (UDItype) _r; \ ++ } while (0) ++#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7 + #define umul_ppmm(w1, w0, u, v) \ + __asm__ ("dmultu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v)) + #else From e1be3f55d8143031de4038c3427b36eccf359be9 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Tue, 8 Jul 2014 14:50:05 +0200 Subject: [PATCH 06/19] gcc: Add GCC 4.6 patches from official openwrt.git toolchain directory. Signed-off-by: Christian Beier --- devel/gcc/patches/010-documentation.patch | 23 ++ devel/gcc/patches/020-gcc_bug_54295.patch | 70 +++++ devel/gcc/patches/030-gcc_bug_48403.patch | 16 ++ devel/gcc/patches/040-gcc_bug_49696.patch | 65 +++++ devel/gcc/patches/100-uclibc-conf.patch | 33 +++ devel/gcc/patches/200-musl.patch | 240 +++++++++++++++++ .../gcc/patches/301-missing-execinfo_h.patch | 11 + devel/gcc/patches/302-c99-snprintf.patch | 11 + .../patches/305-libmudflap-susv3-legacy.patch | 47 ++++ .../patches/800-arm_v5te_no_ldrd_strd.patch | 11 + .../patches/810-arm-softfloat-libgcc.patch | 26 ++ devel/gcc/patches/820-libgcc_pic.patch | 36 +++ .../gcc/patches/830-arm_unbreak_armv4t.patch | 13 + .../840-armv4_pass_fix-v4bx_to_ld.patch | 19 ++ devel/gcc/patches/850-use_shared_libgcc.patch | 86 ++++++ .../gcc/patches/860-uclibc_use_eh_frame.patch | 29 ++ devel/gcc/patches/870-ppc_no_crtsavres.patch | 20 ++ devel/gcc/patches/880-no_java_section.patch | 11 + devel/gcc/patches/900-bad-mips16-crt | 9 + devel/gcc/patches/910-mbsd_multi.patch | 253 ++++++++++++++++++ .../patches/920-specs_nonfatal_getenv.patch | 14 + devel/gcc/patches/999-coldfire.patch | 11 + 22 files changed, 1054 insertions(+) create mode 100644 devel/gcc/patches/010-documentation.patch create mode 100644 devel/gcc/patches/020-gcc_bug_54295.patch create mode 100644 devel/gcc/patches/030-gcc_bug_48403.patch create mode 100644 devel/gcc/patches/040-gcc_bug_49696.patch create mode 100644 devel/gcc/patches/100-uclibc-conf.patch create mode 100644 devel/gcc/patches/200-musl.patch create mode 100644 devel/gcc/patches/301-missing-execinfo_h.patch create mode 100644 devel/gcc/patches/302-c99-snprintf.patch create mode 100644 devel/gcc/patches/305-libmudflap-susv3-legacy.patch create mode 100644 devel/gcc/patches/800-arm_v5te_no_ldrd_strd.patch create mode 100644 devel/gcc/patches/810-arm-softfloat-libgcc.patch create mode 100644 devel/gcc/patches/820-libgcc_pic.patch create mode 100644 devel/gcc/patches/830-arm_unbreak_armv4t.patch create mode 100644 devel/gcc/patches/840-armv4_pass_fix-v4bx_to_ld.patch create mode 100644 devel/gcc/patches/850-use_shared_libgcc.patch create mode 100644 devel/gcc/patches/860-uclibc_use_eh_frame.patch create mode 100644 devel/gcc/patches/870-ppc_no_crtsavres.patch create mode 100644 devel/gcc/patches/880-no_java_section.patch create mode 100644 devel/gcc/patches/900-bad-mips16-crt create mode 100644 devel/gcc/patches/910-mbsd_multi.patch create mode 100644 devel/gcc/patches/920-specs_nonfatal_getenv.patch create mode 100644 devel/gcc/patches/999-coldfire.patch diff --git a/devel/gcc/patches/010-documentation.patch b/devel/gcc/patches/010-documentation.patch new file mode 100644 index 0000000000..25773a3d31 --- /dev/null +++ b/devel/gcc/patches/010-documentation.patch @@ -0,0 +1,23 @@ +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -4251,18 +4251,10 @@ + 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/devel/gcc/patches/020-gcc_bug_54295.patch b/devel/gcc/patches/020-gcc_bug_54295.patch new file mode 100644 index 0000000000..5bef9eab04 --- /dev/null +++ b/devel/gcc/patches/020-gcc_bug_54295.patch @@ -0,0 +1,70 @@ +diff -urN a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c +--- a/gcc/tree-ssa-math-opts.c 2012-12-12 18:05:23.000000000 +0100 ++++ b/gcc/tree-ssa-math-opts.c 2013-04-29 15:54:00.051998936 +0200 +@@ -1280,6 +1280,47 @@ + return result; + } + ++/* Return true if stmt is a type conversion operation that can be stripped ++ when used in a widening multiply operation. */ ++static bool ++widening_mult_conversion_strippable_p (tree result_type, gimple stmt) ++{ ++ enum tree_code rhs_code = gimple_assign_rhs_code (stmt); ++ ++ if (TREE_CODE (result_type) == INTEGER_TYPE) ++ { ++ tree op_type; ++ tree inner_op_type; ++ ++ if (!CONVERT_EXPR_CODE_P (rhs_code)) ++ return false; ++ ++ op_type = TREE_TYPE (gimple_assign_lhs (stmt)); ++ ++ /* If the type of OP has the same precision as the result, then ++ we can strip this conversion. The multiply operation will be ++ selected to create the correct extension as a by-product. */ ++ if (TYPE_PRECISION (result_type) == TYPE_PRECISION (op_type)) ++ return true; ++ ++ /* We can also strip a conversion if it preserves the signed-ness of ++ the operation and doesn't narrow the range. */ ++ inner_op_type = TREE_TYPE (gimple_assign_rhs1 (stmt)); ++ ++ /* If the inner-most type is unsigned, then we can strip any ++ intermediate widening operation. If it's signed, then the ++ intermediate widening operation must also be signed. */ ++ if ((TYPE_UNSIGNED (inner_op_type) ++ || TYPE_UNSIGNED (op_type) == TYPE_UNSIGNED (inner_op_type)) ++ && TYPE_PRECISION (op_type) > TYPE_PRECISION (inner_op_type)) ++ return true; ++ ++ return false; ++ } ++ ++ return rhs_code == FIXED_CONVERT_EXPR; ++} ++ + /* Return true if RHS is a suitable operand for a widening multiplication, + assuming a target type of TYPE. + There are two cases: +@@ -1296,17 +1337,13 @@ + { + gimple stmt; + tree type1, rhs1; +- enum tree_code rhs_code; + + if (TREE_CODE (rhs) == SSA_NAME) + { + stmt = SSA_NAME_DEF_STMT (rhs); + if (is_gimple_assign (stmt)) + { +- rhs_code = gimple_assign_rhs_code (stmt); +- if (TREE_CODE (type) == INTEGER_TYPE +- ? !CONVERT_EXPR_CODE_P (rhs_code) +- : rhs_code != FIXED_CONVERT_EXPR) ++ if (! widening_mult_conversion_strippable_p (type, stmt)) + rhs1 = rhs; + else + { diff --git a/devel/gcc/patches/030-gcc_bug_48403.patch b/devel/gcc/patches/030-gcc_bug_48403.patch new file mode 100644 index 0000000000..69569de763 --- /dev/null +++ b/devel/gcc/patches/030-gcc_bug_48403.patch @@ -0,0 +1,16 @@ +--- a/gcc/haifa-sched.c ++++ b/gcc/haifa-sched.c +@@ -4654,10 +4654,12 @@ schedule_block (basic_block *target_bb) + + if (recog_memoized (insn) >= 0) + { ++ memcpy (temp_state, curr_state, dfa_state_size); + cost = state_transition (curr_state, insn); + if (sched_pressure != SCHED_PRESSURE_WEIGHTED) + gcc_assert (cost < 0); +- cycle_issued_insns++; ++ if (memcmp (temp_state, curr_state, dfa_state_size) != 0) ++ cycle_issued_insns++; + asm_p = false; + } + else diff --git a/devel/gcc/patches/040-gcc_bug_49696.patch b/devel/gcc/patches/040-gcc_bug_49696.patch new file mode 100644 index 0000000000..74b9a86a8e --- /dev/null +++ b/devel/gcc/patches/040-gcc_bug_49696.patch @@ -0,0 +1,65 @@ +--- a/gcc/config/mips/sync.md ++++ b/gcc/config/mips/sync.md +@@ -136,7 +136,7 @@ + [(match_operand:SI 1 "register_operand" "d") + (match_operand:SI 2 "register_operand" "d") + (atomic_hiqi_op:SI (match_dup 0) +- (match_operand:SI 3 "register_operand" "dJ"))] ++ (match_operand:SI 3 "reg_or_0_operand" "dJ"))] + UNSPEC_SYNC_OLD_OP_12)) + (clobber (match_scratch:SI 4 "=&d"))] + "GENERATE_LL_SC" +@@ -177,7 +177,7 @@ + [(match_operand:SI 2 "register_operand" "d") + (match_operand:SI 3 "register_operand" "d") + (atomic_hiqi_op:SI (match_dup 0) +- (match_operand:SI 4 "register_operand" "dJ"))] ++ (match_operand:SI 4 "reg_or_0_operand" "dJ"))] + UNSPEC_SYNC_OLD_OP_12)) + (clobber (match_scratch:SI 5 "=&d"))] + "GENERATE_LL_SC" +@@ -218,7 +218,7 @@ + (match_operand:SI 2 "register_operand" "d") + (match_operand:SI 3 "register_operand" "d") + (atomic_hiqi_op:SI (match_dup 0) +- (match_operand:SI 4 "register_operand" "dJ"))] ++ (match_operand:SI 4 "reg_or_0_operand" "dJ"))] + UNSPEC_SYNC_NEW_OP_12)) + (set (match_dup 1) + (unspec_volatile:SI +@@ -259,7 +259,7 @@ + [(match_operand:SI 1 "register_operand" "d") + (match_operand:SI 2 "register_operand" "d") + (match_dup 0) +- (match_operand:SI 3 "register_operand" "dJ")] ++ (match_operand:SI 3 "reg_or_0_operand" "dJ")] + UNSPEC_SYNC_OLD_OP_12)) + (clobber (match_scratch:SI 4 "=&d"))] + "GENERATE_LL_SC" +@@ -298,7 +298,7 @@ + (unspec_volatile:SI + [(match_operand:SI 2 "register_operand" "d") + (match_operand:SI 3 "register_operand" "d") +- (match_operand:SI 4 "register_operand" "dJ")] ++ (match_operand:SI 4 "reg_or_0_operand" "dJ")] + UNSPEC_SYNC_OLD_OP_12)) + (clobber (match_scratch:SI 5 "=&d"))] + "GENERATE_LL_SC" +@@ -337,7 +337,7 @@ + [(match_operand:SI 1 "memory_operand" "+R") + (match_operand:SI 2 "register_operand" "d") + (match_operand:SI 3 "register_operand" "d") +- (match_operand:SI 4 "register_operand" "dJ")] ++ (match_operand:SI 4 "reg_or_0_operand" "dJ")] + UNSPEC_SYNC_NEW_OP_12)) + (set (match_dup 1) + (unspec_volatile:SI +@@ -546,7 +546,7 @@ + (set (match_dup 1) + (unspec_volatile:SI [(match_operand:SI 2 "register_operand" "d") + (match_operand:SI 3 "register_operand" "d") +- (match_operand:SI 4 "arith_operand" "dJ")] ++ (match_operand:SI 4 "reg_or_0_operand" "dJ")] + UNSPEC_SYNC_EXCHANGE_12))] + "GENERATE_LL_SC" + { return mips_output_sync_loop (insn, operands); } diff --git a/devel/gcc/patches/100-uclibc-conf.patch b/devel/gcc/patches/100-uclibc-conf.patch new file mode 100644 index 0000000000..ff9ad94f62 --- /dev/null +++ b/devel/gcc/patches/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/devel/gcc/patches/200-musl.patch b/devel/gcc/patches/200-musl.patch new file mode 100644 index 0000000000..1cc5756dfb --- /dev/null +++ b/devel/gcc/patches/200-musl.patch @@ -0,0 +1,240 @@ +--- a/config.sub ++++ b/config.sub +@@ -125,6 +125,7 @@ esac + maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ ++ linux-musl* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -485,7 +485,7 @@ case ${target} in + esac + + # Common C libraries. +-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3" ++tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4" + + # Common parts for widely ported systems. + case ${target} in +@@ -598,6 +598,9 @@ case ${target} in + *-*-*uclibc*) + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" + ;; ++ *-*-*musl*) ++ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL" ++ ;; + *) + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" + ;; +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -78,6 +78,10 @@ + %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ + %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" + ++/* musl has no "classic" (i.e. broken) mode */ ++#undef MUSL_DYNAMIC_LINKER ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-arm.so.1" ++ + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to + use the GNU/Linux version, not the generic BPABI version. */ + #undef LINK_SPEC +--- a/gcc/config/i386/linux.h ++++ b/gcc/config/i386/linux.h +@@ -93,6 +93,7 @@ along with GCC; see the file COPYING3. + /* These macros may be overridden in k*bsd-gnu.h and i386/k*bsd-gnu.h. */ + #define LINK_EMULATION "elf_i386" + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1" + + #undef ASM_SPEC + #define ASM_SPEC \ +--- a/gcc/config/i386/linux64.h ++++ b/gcc/config/i386/linux64.h +@@ -65,6 +65,9 @@ see the files COPYING3 and COPYING.RUNTI + #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" + #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" + ++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1" ++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1" ++ + #if TARGET_64BIT_DEFAULT + #define SPEC_32 "m32" + #define SPEC_64 "!m32" +--- a/gcc/config/linux.h ++++ b/gcc/config/linux.h +@@ -33,10 +33,12 @@ see the files COPYING3 and COPYING.RUNTI + #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) + #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) + #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) ++#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) + #else + #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) + #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) + #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) ++#define OPTION_MUSL (linux_libc == LIBC_MUSL) + #endif + + #define LINUX_TARGET_OS_CPP_BUILTINS() \ +@@ -54,18 +56,21 @@ see the files COPYING3 and COPYING.RUNTI + uClibc or Bionic is the default C library and whether + -muclibc or -mglibc or -mbionic has been passed to change the default. */ + +-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \ +- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}" ++#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \ ++ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}" + + #if DEFAULT_LIBC == LIBC_GLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ +- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B) ++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ ++ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M) + #elif DEFAULT_LIBC == LIBC_UCLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ +- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B) ++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ ++ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M) + #elif DEFAULT_LIBC == LIBC_BIONIC +-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ +- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U) ++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ ++ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M) ++#elif DEFAULT_LIBC == LIBC_MUSL ++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ ++ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B) + #else + #error "Unsupported DEFAULT_LIBC" + #endif /* DEFAULT_LIBC */ +@@ -83,13 +88,13 @@ see the files COPYING3 and COPYING.RUNTI + + #define LINUX_DYNAMIC_LINKER \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \ +- BIONIC_DYNAMIC_LINKER) ++ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) + #define LINUX_DYNAMIC_LINKER32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \ +- BIONIC_DYNAMIC_LINKER32) ++ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) + #define LINUX_DYNAMIC_LINKER64 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \ +- BIONIC_DYNAMIC_LINKER64) ++ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) + + /* Determine whether the entire c99 runtime + is present in the runtime library. */ +--- a/gcc/config/linux.opt ++++ b/gcc/config/linux.opt +@@ -30,3 +30,7 @@ Use GNU C library + muclibc + Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic) + Use uClibc C library ++ ++mmusl ++Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc) ++Use musl C library +--- a/gcc/config/mips/linux.h ++++ b/gcc/config/mips/linux.h +@@ -63,6 +63,8 @@ along with GCC; see the file COPYING3. + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips.so.1" ++ + /* Borrowed from sparc/linux.h */ + #undef LINK_SPEC + #define LINK_SPEC \ +--- a/gcc/ginclude/stddef.h ++++ b/gcc/ginclude/stddef.h +@@ -184,6 +184,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; + #ifndef _GCC_SIZE_T + #ifndef _SIZET_ + #ifndef __size_t ++#ifndef __DEFINED_size_t /* musl */ + #define __size_t__ /* BeOS */ + #define __SIZE_T__ /* Cray Unicos/Mk */ + #define _SIZE_T +@@ -200,6 +201,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; + #define ___int_size_t_h + #define _GCC_SIZE_T + #define _SIZET_ ++#define __DEFINED_size_t /* musl */ + #if defined (__FreeBSD__) && (__FreeBSD__ >= 5) + /* __size_t is a typedef on FreeBSD 5!, must not trash it. */ + #else +@@ -214,6 +216,7 @@ typedef __SIZE_TYPE__ size_t; + typedef long ssize_t; + #endif /* __BEOS__ */ + #endif /* !(defined (__GNUG__) && defined (size_t)) */ ++#endif /* __DEFINED_size_t */ + #endif /* __size_t */ + #endif /* _SIZET_ */ + #endif /* _GCC_SIZE_T */ +--- a/libgomp/config/posix/time.c ++++ b/libgomp/config/posix/time.c +@@ -28,6 +28,8 @@ + The following implementation uses the most simple POSIX routines. + If present, POSIX 4 clocks should be used instead. */ + ++#define _POSIX_C_SOURCE 199309L /* for clocks */ ++ + #include "libgomp.h" + #include + #if TIME_WITH_SYS_TIME +--- a/libstdc++-v3/configure.host ++++ b/libstdc++-v3/configure.host +@@ -237,6 +237,13 @@ case "${host_os}" in + os_include_dir="os/bsd/freebsd" + ;; + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) ++ # check for musl by target ++ case "${host_os}" in ++ *-musl*) ++ os_include_dir="os/generic" ++ ;; ++ *) ++ + if [ "$uclibc" = "yes" ]; then + os_include_dir="os/uclibc" + elif [ "$bionic" = "yes" ]; then +@@ -245,6 +252,9 @@ case "${host_os}" in + os_include_dir="os/gnu-linux" + fi + ;; ++ ++ esac ++ ;; + hpux*) + os_include_dir="os/hpux" + ;; +--- a/gcc/config/mips/linux64.h ++++ b/gcc/config/mips/linux64.h +@@ -40,9 +40,12 @@ along with GCC; see the file COPYING3. + #define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1" + #define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0" + #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32" ++#define MUSL_DYNAMIC_LINKERN32 "/lib/ld-musl-mips.so.1" ++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-mips.so.1" ++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-mips.so.1" + #define LINUX_DYNAMIC_LINKERN32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \ +- BIONIC_DYNAMIC_LINKERN32) ++ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32) + + #undef LINK_SPEC + #define LINK_SPEC "\ +--- a/gcc/config/sparc/linux64.h 2013-09-10 10:02:45.663973856 +0100 ++++ b/gcc/config/sparc/linux64.h 2013-09-10 10:03:17.871972435 +0100 +@@ -104,6 +104,9 @@ + #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" + #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2" + ++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-sparc.so.1" ++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-sparc.so.1" ++ + #ifdef SPARC_BI_ARCH + + #undef SUBTARGET_EXTRA_SPECS diff --git a/devel/gcc/patches/301-missing-execinfo_h.patch b/devel/gcc/patches/301-missing-execinfo_h.patch new file mode 100644 index 0000000000..b3f1e68d3b --- /dev/null +++ b/devel/gcc/patches/301-missing-execinfo_h.patch @@ -0,0 +1,11 @@ +--- a/boehm-gc/include/gc.h ++++ b/boehm-gc/include/gc.h +@@ -503,7 +503,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_of + #if defined(__linux__) || defined(__GLIBC__) + # include + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \ +- && !defined(__ia64__) ++ && !defined(__ia64__) && !defined(__UCLIBC__) + # ifndef GC_HAVE_BUILTIN_BACKTRACE + # define GC_HAVE_BUILTIN_BACKTRACE + # endif diff --git a/devel/gcc/patches/302-c99-snprintf.patch b/devel/gcc/patches/302-c99-snprintf.patch new file mode 100644 index 0000000000..eda1854df1 --- /dev/null +++ b/devel/gcc/patches/302-c99-snprintf.patch @@ -0,0 +1,11 @@ +--- a/libstdc++-v3/include/c_global/cstdio ++++ b/libstdc++-v3/include/c_global/cstdio +@@ -137,7 +137,7 @@ namespace std + using ::vsprintf; + } // namespace + +-#if _GLIBCXX_USE_C99 ++#if _GLIBCXX_USE_C99 || defined __UCLIBC__ + + #undef snprintf + #undef vfscanf diff --git a/devel/gcc/patches/305-libmudflap-susv3-legacy.patch b/devel/gcc/patches/305-libmudflap-susv3-legacy.patch new file mode 100644 index 0000000000..8e2d15f81a --- /dev/null +++ b/devel/gcc/patches/305-libmudflap-susv3-legacy.patch @@ -0,0 +1,47 @@ +--- a/libmudflap/mf-hooks2.c ++++ b/libmudflap/mf-hooks2.c +@@ -421,7 +421,7 @@ WRAPPER2(void, bzero, void *s, size_t n) + { + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region"); +- bzero (s, n); ++ memset (s, 0, n); + } + + +@@ -431,7 +431,7 @@ WRAPPER2(void, bcopy, const void *src, v + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src"); + MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest"); +- bcopy (src, dest, n); ++ memmove (dest, src, n); + } + + +@@ -441,7 +441,7 @@ WRAPPER2(int, bcmp, const void *s1, cons + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg"); + MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg"); +- return bcmp (s1, s2, n); ++ return n == 0 ? 0 : memcmp (s1, s2, n); + } + + +@@ -450,7 +450,7 @@ WRAPPER2(char *, index, const char *s, i + size_t n = strlen (s); + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region"); +- return index (s, c); ++ return strchr (s, c); + } + + +@@ -459,7 +459,7 @@ WRAPPER2(char *, rindex, const char *s, + size_t n = strlen (s); + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region"); +- return rindex (s, c); ++ return strrchr (s, c); + } + + /* XXX: stpcpy, memccpy */ diff --git a/devel/gcc/patches/800-arm_v5te_no_ldrd_strd.patch b/devel/gcc/patches/800-arm_v5te_no_ldrd_strd.patch new file mode 100644 index 0000000000..4b7770d5d9 --- /dev/null +++ b/devel/gcc/patches/800-arm_v5te_no_ldrd_strd.patch @@ -0,0 +1,11 @@ +--- a/gcc/config/arm/arm.h ++++ b/gcc/config/arm/arm.h +@@ -232,7 +232,7 @@ extern void (*arm_lang_output_object_att + #define TARGET_BACKTRACE (leaf_function_p () \ + ? TARGET_TPCS_LEAF_FRAME \ + : TARGET_TPCS_FRAME) +-#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN) ++#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN) + #define TARGET_AAPCS_BASED \ + (arm_abi != ARM_ABI_APCS && arm_abi != ARM_ABI_ATPCS) + diff --git a/devel/gcc/patches/810-arm-softfloat-libgcc.patch b/devel/gcc/patches/810-arm-softfloat-libgcc.patch new file mode 100644 index 0000000000..60cfde4078 --- /dev/null +++ b/devel/gcc/patches/810-arm-softfloat-libgcc.patch @@ -0,0 +1,26 @@ +--- 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}}" + +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc" ++#define LIBGCC_SPEC "-lgcc" + + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" + +--- a/gcc/config/arm/t-linux ++++ b/gcc/config/arm/t-linux +@@ -23,7 +23,11 @@ TARGET_LIBGCC2_CFLAGS = -fomit-frame-poi + + LIB1ASMSRC = arm/lib1funcs.asm + LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ +- _arm_addsubdf3 _arm_addsubsf3 ++ _arm_addsubdf3 _arm_addsubsf3 \ ++ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ ++ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ ++ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ ++ _arm_fixsfsi _arm_fixunssfsi + + # MULTILIB_OPTIONS = mhard-float/msoft-float + # MULTILIB_DIRNAMES = hard-float soft-float diff --git a/devel/gcc/patches/820-libgcc_pic.patch b/devel/gcc/patches/820-libgcc_pic.patch new file mode 100644 index 0000000000..3760ac2b9b --- /dev/null +++ b/devel/gcc/patches/820-libgcc_pic.patch @@ -0,0 +1,36 @@ +--- a/libgcc/Makefile.in ++++ b/libgcc/Makefile.in +@@ -747,11 +747,12 @@ $(libgcov-objects): %$(objext): $(gcc_sr + + # 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)"; \ +@@ -773,7 +774,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 +@@ -954,6 +955,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/devel/gcc/patches/830-arm_unbreak_armv4t.patch b/devel/gcc/patches/830-arm_unbreak_armv4t.patch new file mode 100644 index 0000000000..7e2ed6987b --- /dev/null +++ b/devel/gcc/patches/830-arm_unbreak_armv4t.patch @@ -0,0 +1,13 @@ +http://sourceware.org/ml/crossgcc/2008-05/msg00009.html + +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -46,7 +46,7 @@ + The ARM10TDMI core is the default for armv5t, so set + SUBTARGET_CPU_DEFAULT to achieve this. */ + #undef SUBTARGET_CPU_DEFAULT +-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi ++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi + + /* TARGET_BIG_ENDIAN_DEFAULT is set in + config.gcc for big endian configurations. */ diff --git a/devel/gcc/patches/840-armv4_pass_fix-v4bx_to_ld.patch b/devel/gcc/patches/840-armv4_pass_fix-v4bx_to_ld.patch new file mode 100644 index 0000000000..3be371be63 --- /dev/null +++ b/devel/gcc/patches/840-armv4_pass_fix-v4bx_to_ld.patch @@ -0,0 +1,19 @@ +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -82,10 +82,15 @@ + #undef MUSL_DYNAMIC_LINKER + #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-arm.so.1" + ++/* For armv4 we pass --fix-v4bx to linker to support EABI */ ++#undef TARGET_FIX_V4BX_SPEC ++#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ ++ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" ++ + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to + use the GNU/Linux version, not the generic BPABI version. */ + #undef LINK_SPEC +-#define LINK_SPEC BE8_LINK_SPEC \ ++#define LINK_SPEC BE8_LINK_SPEC TARGET_FIX_V4BX_SPEC \ + LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ + LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) + diff --git a/devel/gcc/patches/850-use_shared_libgcc.patch b/devel/gcc/patches/850-use_shared_libgcc.patch new file mode 100644 index 0000000000..61e1035d35 --- /dev/null +++ b/devel/gcc/patches/850-use_shared_libgcc.patch @@ -0,0 +1,86 @@ +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -115,10 +115,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.asm, so ensure an error if this definition + is used. */ +--- a/gcc/config/arm/linux-elf.h ++++ b/gcc/config/arm/linux-elf.h +@@ -60,8 +60,6 @@ + %{shared:-lc} \ + %{!shared:%{profile:-lc_p}%{!profile:-lc}}" + +-#define LIBGCC_SPEC "-lgcc" +- + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" + + #define LINUX_TARGET_LINK_SPEC "%{h*} \ +--- a/gcc/config/linux.h ++++ b/gcc/config/linux.h +@@ -52,6 +52,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/gcc/config/rs6000/linux.h ++++ b/gcc/config/rs6000/linux.h +@@ -88,6 +88,8 @@ + #define USE_LD_AS_NEEDED 1 + #endif + ++#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" ++ + #undef TARGET_VERSION + #define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)"); + +--- a/gcc/mkmap-symver.awk ++++ b/gcc/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/libgcc/Makefile.in ++++ b/libgcc/Makefile.in +@@ -269,6 +269,12 @@ ifeq ($(enable_shared),yes) + install-libunwind = install-libunwind + endif + ++else ++# Not enable_shared. ++iterator = $(srcdir)/empty.mk $(patsubst %,$(srcdir)/static-object.mk,$(iter-items)) ++endif ++ ++ + # For -fvisibility=hidden. We need both a -fvisibility=hidden on + # the command line, and a #define to prevent libgcc2.h etc from + # overriding that with #pragmas. +@@ -291,13 +297,6 @@ else + gen-hide-list = echo > $@ + endif + +-else +-# Not enable_shared. +-iterator = $(srcdir)/empty.mk $(patsubst %,$(srcdir)/static-object.mk,$(iter-items)) +-vis_hide = +-gen-hide-list = echo > \$@ +-endif +- + ifneq ($(EXTRA_PARTS),) + extra-parts = libgcc-extra-parts + INSTALL_PARTS = $(EXTRA_PARTS) diff --git a/devel/gcc/patches/860-uclibc_use_eh_frame.patch b/devel/gcc/patches/860-uclibc_use_eh_frame.patch new file mode 100644 index 0000000000..381a14bc9a --- /dev/null +++ b/devel/gcc/patches/860-uclibc_use_eh_frame.patch @@ -0,0 +1,29 @@ +--- a/gcc/crtstuff.c ++++ b/gcc/crtstuff.c +@@ -100,15 +100,20 @@ call_ ## FUNC (void) \ + #if defined(OBJECT_FORMAT_ELF) \ + && !defined(OBJECT_FORMAT_FLAT) \ + && defined(HAVE_LD_EH_FRAME_HDR) \ +- && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \ +- && defined(__GLIBC__) && __GLIBC__ >= 2 ++ && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) + #include + /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h. + But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */ +-# if !defined(__UCLIBC__) \ +- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \ +- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) +-# define USE_PT_GNU_EH_FRAME ++# if defined(__UCLIBC__) ++# if (__UCLIBC_MAJOR__ > 0 || __UCLIBC_MINOR__ > 9 || \ ++ (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ >= 33)) ++# define USE_PT_GNU_EH_FRAME ++# endif ++# elif defined(__GLIBC__) ++# if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \ ++ || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) ++# define USE_PT_GNU_EH_FRAME ++# endif + # endif + #endif + #if defined(EH_FRAME_SECTION_NAME) && !defined(USE_PT_GNU_EH_FRAME) diff --git a/devel/gcc/patches/870-ppc_no_crtsavres.patch b/devel/gcc/patches/870-ppc_no_crtsavres.patch new file mode 100644 index 0000000000..0e15ffc391 --- /dev/null +++ b/devel/gcc/patches/870-ppc_no_crtsavres.patch @@ -0,0 +1,20 @@ +--- a/gcc/config/rs6000/sysv4.h ++++ b/gcc/config/rs6000/sysv4.h +@@ -248,13 +248,13 @@ do { \ + + /* Define cutoff for using external functions to save floating point. + When optimizing for size, use external functions when profitable. */ +-#define FP_SAVE_INLINE(FIRST_REG) (optimize_size \ ++#define FP_SAVE_INLINE(FIRST_REG) (1 || (optimize_size \ + ? ((FIRST_REG) == 62 \ + || (FIRST_REG) == 63) \ +- : (FIRST_REG) < 64) ++ : (FIRST_REG) < 64)) + /* And similarly for general purpose registers. */ +-#define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 32 \ +- && !optimize_size) ++#define GP_SAVE_INLINE(FIRST_REG) (1 || ((FIRST_REG) < 32 \ ++ && !optimize_size)) + + /* Put jump tables in read-only memory, rather than in .text. */ + #define JUMP_TABLES_IN_TEXT_SECTION 0 diff --git a/devel/gcc/patches/880-no_java_section.patch b/devel/gcc/patches/880-no_java_section.patch new file mode 100644 index 0000000000..404b7d31f7 --- /dev/null +++ b/devel/gcc/patches/880-no_java_section.patch @@ -0,0 +1,11 @@ +--- a/gcc/defaults.h ++++ b/gcc/defaults.h +@@ -383,7 +383,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/devel/gcc/patches/900-bad-mips16-crt b/devel/gcc/patches/900-bad-mips16-crt new file mode 100644 index 0000000000..5bb2ffb488 --- /dev/null +++ b/devel/gcc/patches/900-bad-mips16-crt @@ -0,0 +1,9 @@ +--- gcc/gcc/config/mips/t-libgcc-mips16~ 2013-03-26 09:09:34.209077496 -0400 ++++ gcc/gcc/config/mips/t-libgcc-mips16 2013-03-26 18:21:01.717303669 -0400 +@@ -43,3 +43,6 @@ + + # Version these symbols if building libgcc.so. + SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver ++ ++CRTSTUFF_T_CFLAGS += -mno-mips16 ++CRTSTUFF_T_CFLAGS_S += -mno-mips16 diff --git a/devel/gcc/patches/910-mbsd_multi.patch b/devel/gcc/patches/910-mbsd_multi.patch new file mode 100644 index 0000000000..51bbc7f2bc --- /dev/null +++ b/devel/gcc/patches/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 + with copyright assignment to the FSF in effect. + +--- a/gcc/c-family/c-opts.c ++++ b/gcc/c-family/c-opts.c +@@ -103,6 +103,9 @@ static size_t deferred_count; + /* Number of deferred options scanned for -include. */ + static size_t include_cursor; + ++/* 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_cxx0x (int); +@@ -441,6 +444,9 @@ c_common_handle_option (size_t scode, co + global_dc->warning_as_error_requested = value; + break; + ++ case OPT_Werror_maybe_reset: ++ break; ++ + case OPT_Wformat: + set_Wformat (value); + break; +@@ -584,6 +590,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; +@@ -1058,6 +1070,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 +@@ -363,6 +363,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 +@@ -794,6 +798,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 +@@ -520,6 +520,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 +@@ -1156,6 +1160,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 +@@ -477,8 +477,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 }, +@@ -494,6 +492,8 @@ static const struct default_options defa + { OPT_LEVELS_2_PLUS, OPT_falign_functions, 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 +@@ -1405,6 +1405,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 +@@ -164,6 +164,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 +@@ -4498,6 +4498,22 @@ This option is only supported for C and + @option{-Wall} and by @option{-pedantic}, 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 +@@ -6317,7 +6333,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 +@@ -627,6 +627,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/devel/gcc/patches/920-specs_nonfatal_getenv.patch b/devel/gcc/patches/920-specs_nonfatal_getenv.patch new file mode 100644 index 0000000000..5055ae898e --- /dev/null +++ b/devel/gcc/patches/920-specs_nonfatal_getenv.patch @@ -0,0 +1,14 @@ +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -7772,7 +7772,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/devel/gcc/patches/999-coldfire.patch b/devel/gcc/patches/999-coldfire.patch new file mode 100644 index 0000000000..0913f3497e --- /dev/null +++ b/devel/gcc/patches/999-coldfire.patch @@ -0,0 +1,11 @@ +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -1805,7 +1805,7 @@ m68k-*-linux*) # Motorola m68k's runnin + default_m68k_cpu=68020 + default_cf_cpu=5475 + with_arch=${with_arch:-m68k} +- tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h m68k/linux.h ./sysroot-suffix.h" ++ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h m68k/linux.h" + extra_options="${extra_options} m68k/ieee.opt" + tm_defines="${tm_defines} MOTOROLA=1" + tmake_file="${tmake_file} m68k/t-floatlib m68k/t-linux m68k/t-mlibs" From 5ad8b4ff1e08d43e40138442fba08c228a2acb8a Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Tue, 8 Jul 2014 15:50:40 +0200 Subject: [PATCH 07/19] gcc: The variable is simply called CONFIGURE_ARGS and already contains the host,build, target triplet plus right prefixes. Signed-off-by: Christian Beier --- devel/gcc/Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile index a4f7eccbdf..c7c946fd01 100644 --- a/devel/gcc/Makefile +++ b/devel/gcc/Makefile @@ -48,10 +48,7 @@ define Build/Configure SHELL="$(BASH)" \ $(TARGET_CONFIGURE_OPTS) \ $(PKG_BUILD_DIR)/configure \ - $(TARGET_CONFIGURE_ARGS) \ - --build=$(GNU_HOST_NAME) \ - --host=$(REAL_GNU_TARGET_NAME) \ - --target=$(REAL_GNU_TARGET_NAME) \ + $(CONFIGURE_ARGS) \ --enable-languages=$(TARGET_LANGUAGES) \ --disable-__cxa_atexit \ --enable-target-optspace \ From 0401ca4ca194072e1306974f6d24559ae3b30392 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Tue, 8 Jul 2014 16:39:00 +0200 Subject: [PATCH 08/19] gcc: Add myself as maintainer. Signed-off-by: Christian Beier --- devel/gcc/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile index c7c946fd01..a005675074 100644 --- a/devel/gcc/Makefile +++ b/devel/gcc/Makefile @@ -26,6 +26,7 @@ define Package/gcc SECTION:=devel CATEGORY:=Development TITLE:=gcc + MAINTAINER:=Christian Beier DEPENDS:=@TARGET_x86 @NO_STRIP endef From e63c24482817dd89431cad38a6c0208eda6e9f87 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Tue, 8 Jul 2014 17:28:14 +0200 Subject: [PATCH 09/19] gcc: Do not ship .info and .man files. Signed-off-by: Christian Beier --- devel/gcc/patches/010-documentation.patch | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/devel/gcc/patches/010-documentation.patch b/devel/gcc/patches/010-documentation.patch index 25773a3d31..bf3af82371 100644 --- a/devel/gcc/patches/010-documentation.patch +++ b/devel/gcc/patches/010-documentation.patch @@ -1,6 +1,8 @@ +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index 9b6af49..a5404be 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in -@@ -4251,18 +4251,10 @@ +@@ -4267,18 +4267,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) doc/gccint.info: $(TEXI_GCCINT_FILES) doc/cppinternals.info: $(TEXI_CPPINT_FILES) @@ -21,3 +23,12 @@ doc/cpp.dvi: $(TEXI_CPP_FILES) doc/gcc.dvi: $(TEXI_GCC_FILES) +@@ -4496,7 +4488,7 @@ maintainer-clean: + # Install the driver last so that the window when things are + # broken is small. + install: install-common $(INSTALL_HEADERS) \ +- install-cpp install-man install-info install-@POSUB@ \ ++ install-cpp install-@POSUB@ \ + install-driver install-lto-wrapper + + ifeq ($(enable_plugin),yes) From ee43a57b74a6b7bac5940a406d416f876cc89d9a Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Tue, 8 Jul 2014 17:35:31 +0200 Subject: [PATCH 10/19] gcc: Depend on binutils package. Signed-off-by: Christian Beier --- devel/gcc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile index a005675074..a69d4176e5 100644 --- a/devel/gcc/Makefile +++ b/devel/gcc/Makefile @@ -27,7 +27,7 @@ define Package/gcc CATEGORY:=Development TITLE:=gcc MAINTAINER:=Christian Beier - DEPENDS:=@TARGET_x86 @NO_STRIP + DEPENDS:= +binutils endef define Package/gcc/description From 13e9670993cfa7f28596505e75752ac25c300e71 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Tue, 8 Jul 2014 19:01:26 +0200 Subject: [PATCH 11/19] gcc: Enable parallel GCC builds. Signed-off-by: Christian Beier --- devel/gcc/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile index a69d4176e5..0fe5914fad 100644 --- a/devel/gcc/Makefile +++ b/devel/gcc/Makefile @@ -16,6 +16,8 @@ PKG_SOURCE_URL:=https://releases.linaro.org/13.05/components/toolchain/gcc-linar PKG_SOURCE:=gcc-$(PKG_VERSION).tar.bz2 PKG_MD5SUM:=26b48802ae1203cd99415026fbf56ed7 +PKG_BUILD_PARALLEL:=1 + include $(INCLUDE_DIR)/package.mk SEP:=, From 9b24b13654420360ad11447a81a11900a668aa3b Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Tue, 15 Jul 2014 10:21:09 +0200 Subject: [PATCH 12/19] gcc: Heavy Makefile modification, now builds and runs on target. * Use the same GCC version as the Attitude Adjustment toolchain. * Use REAL_GNU_TARGET_NAME that contains the _uclibc suffix. Otherwise the linker on the target is not found. * Revamped install section to install only needed binaries and omit static .a libs. Signed-off-by: Christian Beier --- devel/gcc/Makefile | 66 ++++++++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile index 0fe5914fad..ba0b9c2a80 100644 --- a/devel/gcc/Makefile +++ b/devel/gcc/Makefile @@ -9,33 +9,45 @@ # for instance mpfr, mpc and gmp development packages! # include $(TOPDIR)/rules.mk -PKG_NAME:=gcc -PKG_VERSION:=linaro-4.6-2013.05 -PKG_RELEASE:=1 -PKG_SOURCE_URL:=https://releases.linaro.org/13.05/components/toolchain/gcc-linaro/4.6/ -PKG_SOURCE:=gcc-$(PKG_VERSION).tar.bz2 -PKG_MD5SUM:=26b48802ae1203cd99415026fbf56ed7 +PKG_NAME:=gcc +PKG_VERSION:=4.6.3 +PKG_RELEASE:=1 +PKG_SOURCE_URL:=ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-$(PKG_VERSION) \ + http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(PKG_VERSION) \ + ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(PKG_VERSION) + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_MD5SUM:=773092fe5194353b02bb0110052a972e +PKG_INSTALL:=1 +PKG_FIXUP:=libtool PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk SEP:=, TARGET_LANGUAGES:="c$(if $(CONFIG_INSTALL_LIBSTDCPP),$(SEP)c++)$(if $(CONFIG_INSTALL_LIBGCJ),$(SEP)java)" -EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-biarch --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-uclibc) define Package/gcc SECTION:=devel CATEGORY:=Development TITLE:=gcc MAINTAINER:=Christian Beier - DEPENDS:= +binutils + DEPENDS:= +binutils +libstdcpp endef define Package/gcc/description build a native toolchain for compiling on target endef +STRIP:=$(STAGING_DIR_HOST)/bin/sstrip +RSTRIP:= \ + NM="$(TARGET_CROSS)nm" \ + STRIP="$(STRIP) --strip-debug" \ + STRIP_KMOD="$(TARGET_CROSS)strip --strip-debug" \ + $(SCRIPT_DIR)/rstrip.sh + + define Build/Prepare $(PKG_UNPACK) # we have to download additional stuff before patching @@ -52,7 +64,11 @@ define Build/Configure $(TARGET_CONFIGURE_OPTS) \ $(PKG_BUILD_DIR)/configure \ $(CONFIGURE_ARGS) \ + --build=$(GNU_HOST_NAME) \ + --host=$(REAL_GNU_TARGET_NAME) \ + --target=$(REAL_GNU_TARGET_NAME) \ --enable-languages=$(TARGET_LANGUAGES) \ + --enable-shared \ --disable-__cxa_atexit \ --enable-target-optspace \ --with-gnu-ld \ @@ -61,10 +77,12 @@ define Build/Configure --disable-multilib \ --disable-libgomp \ --disable-libquadmath \ + --disable-libssp \ --disable-decimal-float \ - --with-host-libstdcxx=-lstdc++ \ --disable-libstdcxx-pch \ - $(EXTRA_TARGET) \ + --with-host-libstdcxx=-lstdc++ \ + --prefix=/usr \ + --libexecdir=/usr/lib \ $(SOFT_FLOAT_CONFIG_OPTION) \ $(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \ $(if $(CONFIG_mips64)$(CONFIG_mips64el),--with-arch=mips64 \ @@ -75,24 +93,22 @@ endef define Build/Compile export SHELL="$(BASH)"; $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \ DESTDIR="$(PKG_INSTALL_DIR)" $(MAKE_ARGS) all install - # Set up the symlinks to enable lying about target name. - set -e; \ - (cd $(TOOLCHAIN_DIR); \ - ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \ - cd bin; \ - for app in $(REAL_GNU_TARGET_NAME)-* ; do \ - ln -sf $$$${app} \ - $(GNU_TARGET_NAME)$$$${app##$(REAL_GNU_TARGET_NAME)}; \ - done; \ - ); endef define Package/gcc/install - $(INSTALL_DIR) $(1)/usr/lib/ - cp -r $(PKG_INSTALL_DIR)/* $(1) - cp -r $(TOOLCHAIN_DIR)/include $(1)/usr/ - cp $(TOOLCHAIN_DIR)/lib/crt* $(1)/usr/lib/ - cp $(TOOLCHAIN_DIR)/lib/libc.so $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) + cp -ar $(PKG_INSTALL_DIR)/usr/include $(1)/usr + cp -a $(PKG_INSTALL_DIR)/usr/bin/{$(REAL_GNU_TARGET_NAME)-{g++,gcc},cpp,gcov} $(1)/usr/bin + ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/c++ + ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/g++ + ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/$(REAL_GNU_TARGET_NAME)-c++ + ln -s $(REAL_GNU_TARGET_NAME)-gcc $(1)/usr/bin/gcc + ln -s $(REAL_GNU_TARGET_NAME)-gcc $(1)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc-$(PKG_VERSION) + cp -ar $(PKG_INSTALL_DIR)/usr/lib/gcc $(1)/usr/lib + $(RM) $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/*.a + cp -ar $(TOOLCHAIN_DIR)/include $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) + cp -a $(TOOLCHAIN_DIR)/lib/*.{o,so*} $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) + cp -a $(TOOLCHAIN_DIR)/lib/uclibc_nonshared.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) endef $(eval $(call BuildPackage,gcc)) From bae28d4faa6c6a3163bdced68b53e86d24026b74 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Tue, 15 Jul 2014 10:25:25 +0200 Subject: [PATCH 13/19] gcc: Remove patches that don't apply to 4.6.3. Signed-off-by: Christian Beier --- devel/gcc/patches/020-gcc_bug_54295.patch | 70 ----------------------- devel/gcc/patches/030-gcc_bug_48403.patch | 16 ------ 2 files changed, 86 deletions(-) delete mode 100644 devel/gcc/patches/020-gcc_bug_54295.patch delete mode 100644 devel/gcc/patches/030-gcc_bug_48403.patch diff --git a/devel/gcc/patches/020-gcc_bug_54295.patch b/devel/gcc/patches/020-gcc_bug_54295.patch deleted file mode 100644 index 5bef9eab04..0000000000 --- a/devel/gcc/patches/020-gcc_bug_54295.patch +++ /dev/null @@ -1,70 +0,0 @@ -diff -urN a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c ---- a/gcc/tree-ssa-math-opts.c 2012-12-12 18:05:23.000000000 +0100 -+++ b/gcc/tree-ssa-math-opts.c 2013-04-29 15:54:00.051998936 +0200 -@@ -1280,6 +1280,47 @@ - return result; - } - -+/* Return true if stmt is a type conversion operation that can be stripped -+ when used in a widening multiply operation. */ -+static bool -+widening_mult_conversion_strippable_p (tree result_type, gimple stmt) -+{ -+ enum tree_code rhs_code = gimple_assign_rhs_code (stmt); -+ -+ if (TREE_CODE (result_type) == INTEGER_TYPE) -+ { -+ tree op_type; -+ tree inner_op_type; -+ -+ if (!CONVERT_EXPR_CODE_P (rhs_code)) -+ return false; -+ -+ op_type = TREE_TYPE (gimple_assign_lhs (stmt)); -+ -+ /* If the type of OP has the same precision as the result, then -+ we can strip this conversion. The multiply operation will be -+ selected to create the correct extension as a by-product. */ -+ if (TYPE_PRECISION (result_type) == TYPE_PRECISION (op_type)) -+ return true; -+ -+ /* We can also strip a conversion if it preserves the signed-ness of -+ the operation and doesn't narrow the range. */ -+ inner_op_type = TREE_TYPE (gimple_assign_rhs1 (stmt)); -+ -+ /* If the inner-most type is unsigned, then we can strip any -+ intermediate widening operation. If it's signed, then the -+ intermediate widening operation must also be signed. */ -+ if ((TYPE_UNSIGNED (inner_op_type) -+ || TYPE_UNSIGNED (op_type) == TYPE_UNSIGNED (inner_op_type)) -+ && TYPE_PRECISION (op_type) > TYPE_PRECISION (inner_op_type)) -+ return true; -+ -+ return false; -+ } -+ -+ return rhs_code == FIXED_CONVERT_EXPR; -+} -+ - /* Return true if RHS is a suitable operand for a widening multiplication, - assuming a target type of TYPE. - There are two cases: -@@ -1296,17 +1337,13 @@ - { - gimple stmt; - tree type1, rhs1; -- enum tree_code rhs_code; - - if (TREE_CODE (rhs) == SSA_NAME) - { - stmt = SSA_NAME_DEF_STMT (rhs); - if (is_gimple_assign (stmt)) - { -- rhs_code = gimple_assign_rhs_code (stmt); -- if (TREE_CODE (type) == INTEGER_TYPE -- ? !CONVERT_EXPR_CODE_P (rhs_code) -- : rhs_code != FIXED_CONVERT_EXPR) -+ if (! widening_mult_conversion_strippable_p (type, stmt)) - rhs1 = rhs; - else - { diff --git a/devel/gcc/patches/030-gcc_bug_48403.patch b/devel/gcc/patches/030-gcc_bug_48403.patch deleted file mode 100644 index 69569de763..0000000000 --- a/devel/gcc/patches/030-gcc_bug_48403.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/gcc/haifa-sched.c -+++ b/gcc/haifa-sched.c -@@ -4654,10 +4654,12 @@ schedule_block (basic_block *target_bb) - - if (recog_memoized (insn) >= 0) - { -+ memcpy (temp_state, curr_state, dfa_state_size); - cost = state_transition (curr_state, insn); - if (sched_pressure != SCHED_PRESSURE_WEIGHTED) - gcc_assert (cost < 0); -- cycle_issued_insns++; -+ if (memcmp (temp_state, curr_state, dfa_state_size) != 0) -+ cycle_issued_insns++; - asm_p = false; - } - else From 75dd400ae6fbc6504eaeb4effabf9cb53cdacd39 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Tue, 15 Jul 2014 10:31:39 +0200 Subject: [PATCH 14/19] gcc: Remove notes that mpfr-dev and the like are needed on the build machine. That's not true, at least for GCC 4.6.3. Signed-off-by: Christian Beier --- devel/gcc/Makefile | 4 +--- devel/gcc/README | 9 ++++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile index ba0b9c2a80..99a4911a54 100644 --- a/devel/gcc/Makefile +++ b/devel/gcc/Makefile @@ -5,9 +5,7 @@ # See /LICENSE for more information. # # -# NB: GCC building is a bit special, you need to have the gcc build-deps installed on the build machine as well, -# for instance mpfr, mpc and gmp development packages! -# + include $(TOPDIR)/rules.mk PKG_NAME:=gcc diff --git a/devel/gcc/README b/devel/gcc/README index f172bb900b..6cbc80d2b6 100644 --- a/devel/gcc/README +++ b/devel/gcc/README @@ -1,9 +1,8 @@ Native GCC that runs on target. -Note that building this one is a bit tricky. First and foremost, your build machine -needs to have the gcc build-deps installed as well, i.e. mpfr, gmp and mpc, amongst -others. +To save disk space, this GCC only supports dynamic linking on the target box, +there are no static libraries shipped. -For now, this was only tested for a mips target. Others to be done... +For now, this was only tested on a mips target. Others to be done... -Christian Beier \ No newline at end of file + Christian Beier \ No newline at end of file From b9683bf7df51e2dd05549c1fcce4f39fa8109cf4 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Wed, 16 Jul 2014 14:50:03 +0200 Subject: [PATCH 15/19] gcc: Ship all *nonshared*.a static libs. Particularly, this fixes linking with pthreads. Signed-off-by: Christian Beier --- devel/gcc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile index 99a4911a54..2a03a663bc 100644 --- a/devel/gcc/Makefile +++ b/devel/gcc/Makefile @@ -106,7 +106,7 @@ define Package/gcc/install $(RM) $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/*.a cp -ar $(TOOLCHAIN_DIR)/include $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) cp -a $(TOOLCHAIN_DIR)/lib/*.{o,so*} $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) - cp -a $(TOOLCHAIN_DIR)/lib/uclibc_nonshared.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) + cp -a $(TOOLCHAIN_DIR)/lib/*nonshared*.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) endef $(eval $(call BuildPackage,gcc)) From c704c2f503f17593236ac49f00195e7bc537a796 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Sun, 10 Aug 2014 18:00:40 +0200 Subject: [PATCH 16/19] gcc: Build gcc version 4.8.3, refresh patches from openwrt.git. Signed-off-by: Christian Beier --- devel/gcc/Makefile | 4 +- devel/gcc/patches/010-documentation.patch | 13 +- devel/gcc/patches/040-gcc_bug_49696.patch | 65 ------ devel/gcc/patches/200-musl.patch | 185 +++++++++++++----- .../gcc/patches/301-missing-execinfo_h.patch | 11 -- devel/gcc/patches/302-c99-snprintf.patch | 11 -- .../patches/305-libmudflap-susv3-legacy.patch | 47 ----- .../patches/800-arm_v5te_no_ldrd_strd.patch | 16 +- .../patches/810-arm-softfloat-libgcc.patch | 39 ++-- devel/gcc/patches/820-libgcc_pic.patch | 6 +- .../gcc/patches/830-arm_unbreak_armv4t.patch | 2 +- .../840-armv4_pass_fix-v4bx_to_ld.patch | 2 +- devel/gcc/patches/850-use_shared_libgcc.patch | 67 ++----- .../gcc/patches/860-uclibc_use_eh_frame.patch | 6 +- devel/gcc/patches/870-ppc_no_crtsavres.patch | 31 ++- devel/gcc/patches/880-no_java_section.patch | 2 +- ...ad-mips16-crt => 900-bad-mips16-crt.patch} | 6 +- devel/gcc/patches/910-mbsd_multi.patch | 46 ++--- .../patches/920-specs_nonfatal_getenv.patch | 2 +- devel/gcc/patches/999-coldfire.patch | 11 -- 20 files changed, 224 insertions(+), 348 deletions(-) delete mode 100644 devel/gcc/patches/040-gcc_bug_49696.patch delete mode 100644 devel/gcc/patches/301-missing-execinfo_h.patch delete mode 100644 devel/gcc/patches/302-c99-snprintf.patch delete mode 100644 devel/gcc/patches/305-libmudflap-susv3-legacy.patch rename devel/gcc/patches/{900-bad-mips16-crt => 900-bad-mips16-crt.patch} (51%) delete mode 100644 devel/gcc/patches/999-coldfire.patch diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile index 2a03a663bc..3048557264 100644 --- a/devel/gcc/Makefile +++ b/devel/gcc/Makefile @@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gcc -PKG_VERSION:=4.6.3 +PKG_VERSION:=4.8.3 PKG_RELEASE:=1 PKG_SOURCE_URL:=ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-$(PKG_VERSION) \ http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(PKG_VERSION) \ ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_MD5SUM:=773092fe5194353b02bb0110052a972e +PKG_MD5SUM:=7c60f24fab389f77af203d2516ee110f PKG_INSTALL:=1 PKG_FIXUP:=libtool PKG_BUILD_PARALLEL:=1 diff --git a/devel/gcc/patches/010-documentation.patch b/devel/gcc/patches/010-documentation.patch index bf3af82371..3f604ee470 100644 --- a/devel/gcc/patches/010-documentation.patch +++ b/devel/gcc/patches/010-documentation.patch @@ -1,8 +1,6 @@ -diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index 9b6af49..a5404be 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in -@@ -4267,18 +4267,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) +@@ -4326,18 +4326,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) doc/gccint.info: $(TEXI_GCCINT_FILES) doc/cppinternals.info: $(TEXI_CPPINT_FILES) @@ -23,12 +21,3 @@ index 9b6af49..a5404be 100644 doc/cpp.dvi: $(TEXI_CPP_FILES) doc/gcc.dvi: $(TEXI_GCC_FILES) -@@ -4496,7 +4488,7 @@ maintainer-clean: - # Install the driver last so that the window when things are - # broken is small. - install: install-common $(INSTALL_HEADERS) \ -- install-cpp install-man install-info install-@POSUB@ \ -+ install-cpp install-@POSUB@ \ - install-driver install-lto-wrapper - - ifeq ($(enable_plugin),yes) diff --git a/devel/gcc/patches/040-gcc_bug_49696.patch b/devel/gcc/patches/040-gcc_bug_49696.patch deleted file mode 100644 index 74b9a86a8e..0000000000 --- a/devel/gcc/patches/040-gcc_bug_49696.patch +++ /dev/null @@ -1,65 +0,0 @@ ---- a/gcc/config/mips/sync.md -+++ b/gcc/config/mips/sync.md -@@ -136,7 +136,7 @@ - [(match_operand:SI 1 "register_operand" "d") - (match_operand:SI 2 "register_operand" "d") - (atomic_hiqi_op:SI (match_dup 0) -- (match_operand:SI 3 "register_operand" "dJ"))] -+ (match_operand:SI 3 "reg_or_0_operand" "dJ"))] - UNSPEC_SYNC_OLD_OP_12)) - (clobber (match_scratch:SI 4 "=&d"))] - "GENERATE_LL_SC" -@@ -177,7 +177,7 @@ - [(match_operand:SI 2 "register_operand" "d") - (match_operand:SI 3 "register_operand" "d") - (atomic_hiqi_op:SI (match_dup 0) -- (match_operand:SI 4 "register_operand" "dJ"))] -+ (match_operand:SI 4 "reg_or_0_operand" "dJ"))] - UNSPEC_SYNC_OLD_OP_12)) - (clobber (match_scratch:SI 5 "=&d"))] - "GENERATE_LL_SC" -@@ -218,7 +218,7 @@ - (match_operand:SI 2 "register_operand" "d") - (match_operand:SI 3 "register_operand" "d") - (atomic_hiqi_op:SI (match_dup 0) -- (match_operand:SI 4 "register_operand" "dJ"))] -+ (match_operand:SI 4 "reg_or_0_operand" "dJ"))] - UNSPEC_SYNC_NEW_OP_12)) - (set (match_dup 1) - (unspec_volatile:SI -@@ -259,7 +259,7 @@ - [(match_operand:SI 1 "register_operand" "d") - (match_operand:SI 2 "register_operand" "d") - (match_dup 0) -- (match_operand:SI 3 "register_operand" "dJ")] -+ (match_operand:SI 3 "reg_or_0_operand" "dJ")] - UNSPEC_SYNC_OLD_OP_12)) - (clobber (match_scratch:SI 4 "=&d"))] - "GENERATE_LL_SC" -@@ -298,7 +298,7 @@ - (unspec_volatile:SI - [(match_operand:SI 2 "register_operand" "d") - (match_operand:SI 3 "register_operand" "d") -- (match_operand:SI 4 "register_operand" "dJ")] -+ (match_operand:SI 4 "reg_or_0_operand" "dJ")] - UNSPEC_SYNC_OLD_OP_12)) - (clobber (match_scratch:SI 5 "=&d"))] - "GENERATE_LL_SC" -@@ -337,7 +337,7 @@ - [(match_operand:SI 1 "memory_operand" "+R") - (match_operand:SI 2 "register_operand" "d") - (match_operand:SI 3 "register_operand" "d") -- (match_operand:SI 4 "register_operand" "dJ")] -+ (match_operand:SI 4 "reg_or_0_operand" "dJ")] - UNSPEC_SYNC_NEW_OP_12)) - (set (match_dup 1) - (unspec_volatile:SI -@@ -546,7 +546,7 @@ - (set (match_dup 1) - (unspec_volatile:SI [(match_operand:SI 2 "register_operand" "d") - (match_operand:SI 3 "register_operand" "d") -- (match_operand:SI 4 "arith_operand" "dJ")] -+ (match_operand:SI 4 "reg_or_0_operand" "dJ")] - UNSPEC_SYNC_EXCHANGE_12))] - "GENERATE_LL_SC" - { return mips_output_sync_loop (insn, operands); } diff --git a/devel/gcc/patches/200-musl.patch b/devel/gcc/patches/200-musl.patch index 1cc5756dfb..2e6df47e45 100644 --- a/devel/gcc/patches/200-musl.patch +++ b/devel/gcc/patches/200-musl.patch @@ -1,16 +1,6 @@ ---- a/config.sub -+++ b/config.sub -@@ -125,6 +125,7 @@ esac - maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` - case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ -+ linux-musl* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ --- a/gcc/config.gcc +++ b/gcc/config.gcc -@@ -485,7 +485,7 @@ case ${target} in +@@ -549,7 +549,7 @@ case ${target} in esac # Common C libraries. @@ -19,7 +9,7 @@ # Common parts for widely ported systems. case ${target} in -@@ -598,6 +598,9 @@ case ${target} in +@@ -652,6 +652,9 @@ case ${target} in *-*-*uclibc*) tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" ;; @@ -31,7 +21,7 @@ ;; --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h -@@ -78,6 +78,10 @@ +@@ -77,6 +77,10 @@ %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" @@ -44,29 +34,24 @@ #undef LINK_SPEC --- a/gcc/config/i386/linux.h +++ b/gcc/config/i386/linux.h -@@ -93,6 +93,7 @@ along with GCC; see the file COPYING3. - /* These macros may be overridden in k*bsd-gnu.h and i386/k*bsd-gnu.h. */ - #define LINK_EMULATION "elf_i386" +@@ -21,3 +21,4 @@ along with GCC; see the file COPYING3. + + #define GNU_USER_LINK_EMULATION "elf_i386" #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1" - - #undef ASM_SPEC - #define ASM_SPEC \ --- a/gcc/config/i386/linux64.h +++ b/gcc/config/i386/linux64.h -@@ -65,6 +65,9 @@ see the files COPYING3 and COPYING.RUNTI +@@ -30,3 +30,7 @@ see the files COPYING3 and COPYING.RUNTI #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" - + #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" ++ +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1" +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1" -+ - #if TARGET_64BIT_DEFAULT - #define SPEC_32 "m32" - #define SPEC_64 "!m32" ++#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1" --- a/gcc/config/linux.h +++ b/gcc/config/linux.h -@@ -33,10 +33,12 @@ see the files COPYING3 and COPYING.RUNTI +@@ -32,10 +32,12 @@ see the files COPYING3 and COPYING.RUNTI #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) @@ -78,8 +63,8 @@ +#define OPTION_MUSL (linux_libc == LIBC_MUSL) #endif - #define LINUX_TARGET_OS_CPP_BUILTINS() \ -@@ -54,18 +56,21 @@ see the files COPYING3 and COPYING.RUNTI + #define GNU_USER_TARGET_OS_CPP_BUILTINS() \ +@@ -53,18 +55,21 @@ see the files COPYING3 and COPYING.RUNTI uClibc or Bionic is the default C library and whether -muclibc or -mglibc or -mbionic has been passed to change the default. */ @@ -109,20 +94,24 @@ #else #error "Unsupported DEFAULT_LIBC" #endif /* DEFAULT_LIBC */ -@@ -83,13 +88,13 @@ see the files COPYING3 and COPYING.RUNTI +@@ -84,16 +89,16 @@ see the files COPYING3 and COPYING.RUNTI - #define LINUX_DYNAMIC_LINKER \ + #define GNU_USER_DYNAMIC_LINKER \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \ - BIONIC_DYNAMIC_LINKER) + BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) - #define LINUX_DYNAMIC_LINKER32 \ + #define GNU_USER_DYNAMIC_LINKER32 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \ - BIONIC_DYNAMIC_LINKER32) + BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) - #define LINUX_DYNAMIC_LINKER64 \ + #define GNU_USER_DYNAMIC_LINKER64 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \ - BIONIC_DYNAMIC_LINKER64) + BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) + #define GNU_USER_DYNAMIC_LINKERX32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \ +- BIONIC_DYNAMIC_LINKERX32) ++ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32) /* Determine whether the entire c99 runtime is present in the runtime library. */ @@ -138,18 +127,67 @@ +Use musl C library --- a/gcc/config/mips/linux.h +++ b/gcc/config/mips/linux.h -@@ -63,6 +63,8 @@ along with GCC; see the file COPYING3. +@@ -18,3 +18,5 @@ along with GCC; see the file COPYING3. + . */ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" - -+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips.so.1" + - /* Borrowed from sparc/linux.h */ - #undef LINK_SPEC - #define LINK_SPEC \ ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips.so.1" +--- a/gcc/config/rs6000/linux64.h ++++ b/gcc/config/rs6000/linux64.h +@@ -364,17 +364,21 @@ extern int dot_symbols; + #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1" + #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" + #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" ++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1" ++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1" + #if DEFAULT_LIBC == LIBC_UCLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" + #elif DEFAULT_LIBC == LIBC_GLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" ++#elif DEFAULT_LIBC == LIBC_MUSL ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" + #else + #error "Unsupported DEFAULT_LIBC" + #endif + #define GNU_USER_DYNAMIC_LINKER32 \ +- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32) ++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) + #define GNU_USER_DYNAMIC_LINKER64 \ +- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64) ++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) + + + #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \ +--- a/gcc/config/rs6000/sysv4.h ++++ b/gcc/config/rs6000/sysv4.h +@@ -789,15 +789,18 @@ extern int fixuplabelno; + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1" + #if DEFAULT_LIBC == LIBC_UCLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" ++#elif DEFAULT_LIBC == LIBC_MUSL ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" + #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" + #else + #error "Unsupported DEFAULT_LIBC" + #endif + #define GNU_USER_DYNAMIC_LINKER \ +- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) ++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) + + #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ + %{rdynamic:-export-dynamic} \ --- a/gcc/ginclude/stddef.h +++ b/gcc/ginclude/stddef.h -@@ -184,6 +184,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; +@@ -181,6 +181,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; #ifndef _GCC_SIZE_T #ifndef _SIZET_ #ifndef __size_t @@ -157,14 +195,14 @@ #define __size_t__ /* BeOS */ #define __SIZE_T__ /* Cray Unicos/Mk */ #define _SIZE_T -@@ -200,6 +201,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; +@@ -197,6 +198,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; #define ___int_size_t_h #define _GCC_SIZE_T #define _SIZET_ +#define __DEFINED_size_t /* musl */ - #if defined (__FreeBSD__) && (__FreeBSD__ >= 5) - /* __size_t is a typedef on FreeBSD 5!, must not trash it. */ - #else + #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \ + || defined(__FreeBSD_kernel__) + /* __size_t is a typedef on FreeBSD 5, must not trash it. */ @@ -214,6 +216,7 @@ typedef __SIZE_TYPE__ size_t; typedef long ssize_t; #endif /* __BEOS__ */ @@ -184,9 +222,54 @@ #include "libgomp.h" #include #if TIME_WITH_SYS_TIME +--- a/libitm/config/arm/hwcap.cc ++++ b/libitm/config/arm/hwcap.cc +@@ -40,7 +40,11 @@ int GTM_hwcap HIDDEN = 0 + + #ifdef __linux__ + #include ++#ifdef __GLIBC__ + #include ++#else ++#include ++#endif + #include + + static void __attribute__((constructor)) +--- a/libitm/config/linux/x86/tls.h ++++ b/libitm/config/linux/x86/tls.h +@@ -25,16 +25,19 @@ + #ifndef LIBITM_X86_TLS_H + #define LIBITM_X86_TLS_H 1 + +-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) ++#if defined(__GLIBC_PREREQ) ++#if __GLIBC_PREREQ(2, 10) + /* Use slots in the TCB head rather than __thread lookups. + GLIBC has reserved words 10 through 13 for TM. */ + #define HAVE_ARCH_GTM_THREAD 1 + #define HAVE_ARCH_GTM_THREAD_DISP 1 + #endif ++#endif + + #include "config/generic/tls.h" + +-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) ++#if defined(__GLIBC_PREREQ) ++#if __GLIBC_PREREQ(2, 10) + namespace GTM HIDDEN { + + #ifdef __x86_64__ +@@ -101,5 +104,6 @@ static inline void set_abi_disp(struct a + + } // namespace GTM + #endif /* >= GLIBC 2.10 */ ++#endif + + #endif // LIBITM_X86_TLS_H --- a/libstdc++-v3/configure.host +++ b/libstdc++-v3/configure.host -@@ -237,6 +237,13 @@ case "${host_os}" in +@@ -264,6 +264,13 @@ case "${host_os}" in os_include_dir="os/bsd/freebsd" ;; gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) @@ -200,7 +283,7 @@ if [ "$uclibc" = "yes" ]; then os_include_dir="os/uclibc" elif [ "$bionic" = "yes" ]; then -@@ -245,6 +252,9 @@ case "${host_os}" in +@@ -272,6 +279,9 @@ case "${host_os}" in os_include_dir="os/gnu-linux" fi ;; @@ -212,22 +295,19 @@ ;; --- a/gcc/config/mips/linux64.h +++ b/gcc/config/mips/linux64.h -@@ -40,9 +40,12 @@ along with GCC; see the file COPYING3. +@@ -27,6 +27,9 @@ along with GCC; see the file COPYING3. #define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1" #define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0" #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32" +#define MUSL_DYNAMIC_LINKERN32 "/lib/ld-musl-mips.so.1" +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-mips.so.1" +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-mips.so.1" - #define LINUX_DYNAMIC_LINKERN32 \ + #define GNU_USER_DYNAMIC_LINKERN32 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \ - BIONIC_DYNAMIC_LINKERN32) + BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32) - - #undef LINK_SPEC - #define LINK_SPEC "\ ---- a/gcc/config/sparc/linux64.h 2013-09-10 10:02:45.663973856 +0100 -+++ b/gcc/config/sparc/linux64.h 2013-09-10 10:03:17.871972435 +0100 +--- a/gcc/config/sparc/linux64.h 2013-09-10 10:02:45.663973856 +0100 ++++ b/gcc/config/sparc/linux64.h 2013-09-10 10:03:17.871972435 +0100 @@ -104,6 +104,9 @@ #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2" @@ -238,3 +318,4 @@ #ifdef SPARC_BI_ARCH #undef SUBTARGET_EXTRA_SPECS + diff --git a/devel/gcc/patches/301-missing-execinfo_h.patch b/devel/gcc/patches/301-missing-execinfo_h.patch deleted file mode 100644 index b3f1e68d3b..0000000000 --- a/devel/gcc/patches/301-missing-execinfo_h.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/boehm-gc/include/gc.h -+++ b/boehm-gc/include/gc.h -@@ -503,7 +503,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_of - #if defined(__linux__) || defined(__GLIBC__) - # include - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \ -- && !defined(__ia64__) -+ && !defined(__ia64__) && !defined(__UCLIBC__) - # ifndef GC_HAVE_BUILTIN_BACKTRACE - # define GC_HAVE_BUILTIN_BACKTRACE - # endif diff --git a/devel/gcc/patches/302-c99-snprintf.patch b/devel/gcc/patches/302-c99-snprintf.patch deleted file mode 100644 index eda1854df1..0000000000 --- a/devel/gcc/patches/302-c99-snprintf.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/libstdc++-v3/include/c_global/cstdio -+++ b/libstdc++-v3/include/c_global/cstdio -@@ -137,7 +137,7 @@ namespace std - using ::vsprintf; - } // namespace - --#if _GLIBCXX_USE_C99 -+#if _GLIBCXX_USE_C99 || defined __UCLIBC__ - - #undef snprintf - #undef vfscanf diff --git a/devel/gcc/patches/305-libmudflap-susv3-legacy.patch b/devel/gcc/patches/305-libmudflap-susv3-legacy.patch deleted file mode 100644 index 8e2d15f81a..0000000000 --- a/devel/gcc/patches/305-libmudflap-susv3-legacy.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/libmudflap/mf-hooks2.c -+++ b/libmudflap/mf-hooks2.c -@@ -421,7 +421,7 @@ WRAPPER2(void, bzero, void *s, size_t n) - { - TRACE ("%s\n", __PRETTY_FUNCTION__); - MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region"); -- bzero (s, n); -+ memset (s, 0, n); - } - - -@@ -431,7 +431,7 @@ WRAPPER2(void, bcopy, const void *src, v - TRACE ("%s\n", __PRETTY_FUNCTION__); - MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src"); - MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest"); -- bcopy (src, dest, n); -+ memmove (dest, src, n); - } - - -@@ -441,7 +441,7 @@ WRAPPER2(int, bcmp, const void *s1, cons - TRACE ("%s\n", __PRETTY_FUNCTION__); - MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg"); - MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg"); -- return bcmp (s1, s2, n); -+ return n == 0 ? 0 : memcmp (s1, s2, n); - } - - -@@ -450,7 +450,7 @@ WRAPPER2(char *, index, const char *s, i - size_t n = strlen (s); - TRACE ("%s\n", __PRETTY_FUNCTION__); - MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region"); -- return index (s, c); -+ return strchr (s, c); - } - - -@@ -459,7 +459,7 @@ WRAPPER2(char *, rindex, const char *s, - size_t n = strlen (s); - TRACE ("%s\n", __PRETTY_FUNCTION__); - MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region"); -- return rindex (s, c); -+ return strrchr (s, c); - } - - /* XXX: stpcpy, memccpy */ diff --git a/devel/gcc/patches/800-arm_v5te_no_ldrd_strd.patch b/devel/gcc/patches/800-arm_v5te_no_ldrd_strd.patch index 4b7770d5d9..ae4f6516ad 100644 --- a/devel/gcc/patches/800-arm_v5te_no_ldrd_strd.patch +++ b/devel/gcc/patches/800-arm_v5te_no_ldrd_strd.patch @@ -1,11 +1,11 @@ --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h -@@ -232,7 +232,7 @@ extern void (*arm_lang_output_object_att - #define TARGET_BACKTRACE (leaf_function_p () \ - ? TARGET_TPCS_LEAF_FRAME \ - : TARGET_TPCS_FRAME) --#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN) -+#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN) - #define TARGET_AAPCS_BASED \ - (arm_abi != ARM_ABI_APCS && arm_abi != ARM_ABI_ATPCS) +@@ -271,7 +271,7 @@ extern void (*arm_lang_output_object_att + /* Thumb-1 only. */ + #define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm) +-#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN \ ++#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \ + && !TARGET_THUMB1) + + /* The following two macros concern the ability to execute coprocessor diff --git a/devel/gcc/patches/810-arm-softfloat-libgcc.patch b/devel/gcc/patches/810-arm-softfloat-libgcc.patch index 60cfde4078..33cf8add30 100644 --- a/devel/gcc/patches/810-arm-softfloat-libgcc.patch +++ b/devel/gcc/patches/810-arm-softfloat-libgcc.patch @@ -1,26 +1,25 @@ ---- 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}}" - --#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc" -+#define LIBGCC_SPEC "-lgcc" - - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" - ---- a/gcc/config/arm/t-linux -+++ b/gcc/config/arm/t-linux -@@ -23,7 +23,11 @@ TARGET_LIBGCC2_CFLAGS = -fomit-frame-poi - - LIB1ASMSRC = arm/lib1funcs.asm +--- a/libgcc/config/arm/t-linux ++++ b/libgcc/config/arm/t-linux +@@ -1,6 +1,10 @@ + LIB1ASMSRC = arm/lib1funcs.S LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ -- _arm_addsubdf3 _arm_addsubsf3 -+ _arm_addsubdf3 _arm_addsubsf3 \ +- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 ++ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ + _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ + _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ + _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ + _arm_fixsfsi _arm_fixunssfsi - # MULTILIB_OPTIONS = mhard-float/msoft-float - # MULTILIB_DIRNAMES = hard-float soft-float + # Just for these, we omit the frame pointer since it makes such a big + # difference. +--- a/gcc/config/arm/linux-elf.h ++++ b/gcc/config/arm/linux-elf.h +@@ -55,8 +55,6 @@ + %{shared:-lc} \ + %{!shared:%{profile:-lc_p}%{!profile:-lc}}" + +-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" +- + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" + + #define LINUX_TARGET_LINK_SPEC "%{h*} \ diff --git a/devel/gcc/patches/820-libgcc_pic.patch b/devel/gcc/patches/820-libgcc_pic.patch index 3760ac2b9b..7a0ac7353e 100644 --- a/devel/gcc/patches/820-libgcc_pic.patch +++ b/devel/gcc/patches/820-libgcc_pic.patch @@ -1,6 +1,6 @@ --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in -@@ -747,11 +747,12 @@ $(libgcov-objects): %$(objext): $(gcc_sr +@@ -865,11 +865,12 @@ $(libgcov-objects): %$(objext): $(srcdir # Static libraries. libgcc.a: $(libgcc-objects) @@ -14,7 +14,7 @@ -rm -f $@ objects="$(objects)"; \ -@@ -773,7 +774,7 @@ libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_E +@@ -891,7 +892,7 @@ libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_E endif ifeq ($(enable_shared),yes) @@ -23,7 +23,7 @@ ifneq ($(LIBUNWIND),) all: libunwind$(SHLIB_EXT) endif -@@ -954,6 +955,10 @@ install-shared: +@@ -1058,6 +1059,10 @@ install-shared: chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a diff --git a/devel/gcc/patches/830-arm_unbreak_armv4t.patch b/devel/gcc/patches/830-arm_unbreak_armv4t.patch index 7e2ed6987b..37f8f2a54d 100644 --- a/devel/gcc/patches/830-arm_unbreak_armv4t.patch +++ b/devel/gcc/patches/830-arm_unbreak_armv4t.patch @@ -2,7 +2,7 @@ http://sourceware.org/ml/crossgcc/2008-05/msg00009.html --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h -@@ -46,7 +46,7 @@ +@@ -45,7 +45,7 @@ The ARM10TDMI core is the default for armv5t, so set SUBTARGET_CPU_DEFAULT to achieve this. */ #undef SUBTARGET_CPU_DEFAULT diff --git a/devel/gcc/patches/840-armv4_pass_fix-v4bx_to_ld.patch b/devel/gcc/patches/840-armv4_pass_fix-v4bx_to_ld.patch index 3be371be63..e938905ab9 100644 --- a/devel/gcc/patches/840-armv4_pass_fix-v4bx_to_ld.patch +++ b/devel/gcc/patches/840-armv4_pass_fix-v4bx_to_ld.patch @@ -1,6 +1,6 @@ --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h -@@ -82,10 +82,15 @@ +@@ -81,10 +81,15 @@ #undef MUSL_DYNAMIC_LINKER #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-arm.so.1" diff --git a/devel/gcc/patches/850-use_shared_libgcc.patch b/devel/gcc/patches/850-use_shared_libgcc.patch index 61e1035d35..2c7369fc25 100644 --- a/devel/gcc/patches/850-use_shared_libgcc.patch +++ b/devel/gcc/patches/850-use_shared_libgcc.patch @@ -1,6 +1,6 @@ --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h -@@ -115,10 +115,6 @@ +@@ -114,10 +114,6 @@ #define ENDFILE_SPEC \ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) @@ -9,22 +9,11 @@ -#undef LIBGCC_SPEC - /* Clear the instruction cache from `beg' to `end'. This is - implemented in lib1funcs.asm, so ensure an error if this definition + implemented in lib1funcs.S, so ensure an error if this definition is used. */ ---- a/gcc/config/arm/linux-elf.h -+++ b/gcc/config/arm/linux-elf.h -@@ -60,8 +60,6 @@ - %{shared:-lc} \ - %{!shared:%{profile:-lc_p}%{!profile:-lc}}" - --#define LIBGCC_SPEC "-lgcc" -- - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" - - #define LINUX_TARGET_LINK_SPEC "%{h*} \ --- a/gcc/config/linux.h +++ b/gcc/config/linux.h -@@ -52,6 +52,10 @@ see the files COPYING3 and COPYING.RUNTI +@@ -51,6 +51,10 @@ see the files COPYING3 and COPYING.RUNTI builtin_assert ("system=posix"); \ } while (0) @@ -35,19 +24,8 @@ /* 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/gcc/config/rs6000/linux.h -+++ b/gcc/config/rs6000/linux.h -@@ -88,6 +88,8 @@ - #define USE_LD_AS_NEEDED 1 - #endif - -+#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" -+ - #undef TARGET_VERSION - #define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)"); - ---- a/gcc/mkmap-symver.awk -+++ b/gcc/mkmap-symver.awk +--- 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]); @@ -55,32 +33,15 @@ - printf ("\n local:\n\t*;\n};\n"); + printf ("\n\t*;\n};\n"); } ---- a/libgcc/Makefile.in -+++ b/libgcc/Makefile.in -@@ -269,6 +269,12 @@ ifeq ($(enable_shared),yes) - install-libunwind = install-libunwind - endif +--- 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)" -+else -+# Not enable_shared. -+iterator = $(srcdir)/empty.mk $(patsubst %,$(srcdir)/static-object.mk,$(iter-items)) -+endif ++#undef LIBGCC_SPEC ++#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" + -+ - # For -fvisibility=hidden. We need both a -fvisibility=hidden on - # the command line, and a #define to prevent libgcc2.h etc from - # overriding that with #pragmas. -@@ -291,13 +297,6 @@ else - gen-hide-list = echo > $@ - endif + #undef LINK_SHLIB_SPEC + #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" --else --# Not enable_shared. --iterator = $(srcdir)/empty.mk $(patsubst %,$(srcdir)/static-object.mk,$(iter-items)) --vis_hide = --gen-hide-list = echo > \$@ --endif -- - ifneq ($(EXTRA_PARTS),) - extra-parts = libgcc-extra-parts - INSTALL_PARTS = $(EXTRA_PARTS) diff --git a/devel/gcc/patches/860-uclibc_use_eh_frame.patch b/devel/gcc/patches/860-uclibc_use_eh_frame.patch index 381a14bc9a..0464bd7d26 100644 --- a/devel/gcc/patches/860-uclibc_use_eh_frame.patch +++ b/devel/gcc/patches/860-uclibc_use_eh_frame.patch @@ -1,5 +1,5 @@ ---- a/gcc/crtstuff.c -+++ b/gcc/crtstuff.c +--- a/libgcc/crtstuff.c ++++ b/libgcc/crtstuff.c @@ -100,15 +100,20 @@ call_ ## FUNC (void) \ #if defined(OBJECT_FORMAT_ELF) \ && !defined(OBJECT_FORMAT_FLAT) \ @@ -26,4 +26,4 @@ +# endif # endif #endif - #if defined(EH_FRAME_SECTION_NAME) && !defined(USE_PT_GNU_EH_FRAME) + diff --git a/devel/gcc/patches/870-ppc_no_crtsavres.patch b/devel/gcc/patches/870-ppc_no_crtsavres.patch index 0e15ffc391..d8c460a92d 100644 --- a/devel/gcc/patches/870-ppc_no_crtsavres.patch +++ b/devel/gcc/patches/870-ppc_no_crtsavres.patch @@ -1,20 +1,11 @@ ---- a/gcc/config/rs6000/sysv4.h -+++ b/gcc/config/rs6000/sysv4.h -@@ -248,13 +248,13 @@ do { \ - - /* Define cutoff for using external functions to save floating point. - When optimizing for size, use external functions when profitable. */ --#define FP_SAVE_INLINE(FIRST_REG) (optimize_size \ -+#define FP_SAVE_INLINE(FIRST_REG) (1 || (optimize_size \ - ? ((FIRST_REG) == 62 \ - || (FIRST_REG) == 63) \ -- : (FIRST_REG) < 64) -+ : (FIRST_REG) < 64)) - /* And similarly for general purpose registers. */ --#define GP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 32 \ -- && !optimize_size) -+#define GP_SAVE_INLINE(FIRST_REG) (1 || ((FIRST_REG) < 32 \ -+ && !optimize_size)) - - /* Put jump tables in read-only memory, rather than in .text. */ - #define JUMP_TABLES_IN_TEXT_SECTION 0 +--- a/gcc/config/rs6000/rs6000.c ++++ b/gcc/config/rs6000/rs6000.c +@@ -17653,7 +17653,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/devel/gcc/patches/880-no_java_section.patch b/devel/gcc/patches/880-no_java_section.patch index 404b7d31f7..def6c9f4a0 100644 --- a/devel/gcc/patches/880-no_java_section.patch +++ b/devel/gcc/patches/880-no_java_section.patch @@ -1,6 +1,6 @@ --- a/gcc/defaults.h +++ b/gcc/defaults.h -@@ -383,7 +383,7 @@ see the files COPYING3 and COPYING.RUNTI +@@ -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. */ diff --git a/devel/gcc/patches/900-bad-mips16-crt b/devel/gcc/patches/900-bad-mips16-crt.patch similarity index 51% rename from devel/gcc/patches/900-bad-mips16-crt rename to devel/gcc/patches/900-bad-mips16-crt.patch index 5bb2ffb488..dd6e9dc889 100644 --- a/devel/gcc/patches/900-bad-mips16-crt +++ b/devel/gcc/patches/900-bad-mips16-crt.patch @@ -1,6 +1,6 @@ ---- gcc/gcc/config/mips/t-libgcc-mips16~ 2013-03-26 09:09:34.209077496 -0400 -+++ gcc/gcc/config/mips/t-libgcc-mips16 2013-03-26 18:21:01.717303669 -0400 -@@ -43,3 +43,6 @@ +--- a/libgcc/config/mips/t-mips16 ++++ b/libgcc/config/mips/t-mips16 +@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 # Version these symbols if building libgcc.so. SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver diff --git a/devel/gcc/patches/910-mbsd_multi.patch b/devel/gcc/patches/910-mbsd_multi.patch index 51bbc7f2bc..d04dc7d91a 100644 --- a/devel/gcc/patches/910-mbsd_multi.patch +++ b/devel/gcc/patches/910-mbsd_multi.patch @@ -19,27 +19,27 @@ --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c -@@ -103,6 +103,9 @@ static size_t deferred_count; - /* Number of deferred options scanned for -include. */ - static size_t include_cursor; +@@ -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_cxx0x (int); -@@ -441,6 +444,9 @@ c_common_handle_option (size_t scode, co - global_dc->warning_as_error_requested = value; + 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_Wformat: - set_Wformat (value); + case OPT_Winvalid_pch: + cpp_opts->warn_invalid_pch = value; break; -@@ -584,6 +590,12 @@ c_common_handle_option (size_t scode, co +@@ -491,6 +497,12 @@ c_common_handle_option (size_t scode, co flag_no_builtin = !value; break; @@ -52,7 +52,7 @@ case OPT_fconstant_string_class_: constant_string_class_name = arg; break; -@@ -1058,6 +1070,47 @@ c_common_init (void) +@@ -1027,6 +1039,47 @@ c_common_init (void) return false; } @@ -102,7 +102,7 @@ --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt -@@ -363,6 +363,10 @@ Werror-implicit-function-declaration +@@ -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 @@ -113,7 +113,7 @@ Wfloat-equal C ObjC C++ ObjC++ Var(warn_float_equal) Warning Warn if testing floating point numbers for equality -@@ -794,6 +798,9 @@ C++ ObjC++ Optimization Alias(fexception +@@ -949,6 +953,9 @@ C++ ObjC++ Optimization Alias(fexception fhonor-std C++ ObjC++ Ignore Warn(switch %qs is no longer supported) @@ -125,7 +125,7 @@ Assume normal C execution environment --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -520,6 +520,10 @@ Werror= +@@ -541,6 +541,10 @@ Werror= Common Joined Treat specified warning as error @@ -136,7 +136,7 @@ Wextra Common Var(extra_warnings) Warning Print extra (possibly unwanted) warnings -@@ -1156,6 +1160,9 @@ fguess-branch-probability +@@ -1242,6 +1246,9 @@ fguess-branch-probability Common Report Var(flag_guess_branch_prob) Optimization Enable guessing of branch probabilities @@ -148,7 +148,7 @@ ; On SVR4 targets, it also controls whether or not to emit a --- a/gcc/opts.c +++ b/gcc/opts.c -@@ -477,8 +477,6 @@ static const struct default_options defa +@@ -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 }, @@ -157,8 +157,8 @@ { 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 }, -@@ -494,6 +492,8 @@ static const struct default_options defa - { OPT_LEVELS_2_PLUS, OPT_falign_functions, NULL, 1 }, +@@ -488,6 +486,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 }, @@ -166,7 +166,7 @@ { 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 -@@ -1405,6 +1405,17 @@ common_handle_option (struct gcc_options +@@ -1423,6 +1423,17 @@ common_handle_option (struct gcc_options opts, opts_set, loc, dc); break; @@ -186,7 +186,7 @@ opts->x_warn_larger_than = value != -1; --- a/gcc/doc/cppopts.texi +++ b/gcc/doc/cppopts.texi -@@ -164,6 +164,11 @@ in older programs. This warning is on b +@@ -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. @@ -209,8 +209,8 @@ -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol -Wformat-security -Wformat-y2k @gol -@@ -4498,6 +4498,22 @@ This option is only supported for C and - @option{-Wall} and by @option{-pedantic}, which can be disabled with +@@ -4808,6 +4808,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 @@ -232,7 +232,7 @@ @item -Wstack-protector @opindex Wstack-protector @opindex Wno-stack-protector -@@ -6317,7 +6333,7 @@ so, the first branch is redirected to ei +@@ -6919,7 +6935,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. @@ -243,7 +243,7 @@ @opindex fsplit-wide-types --- a/gcc/java/jvspec.c +++ b/gcc/java/jvspec.c -@@ -627,6 +627,7 @@ lang_specific_pre_link (void) +@@ -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)); diff --git a/devel/gcc/patches/920-specs_nonfatal_getenv.patch b/devel/gcc/patches/920-specs_nonfatal_getenv.patch index 5055ae898e..4baa966930 100644 --- a/devel/gcc/patches/920-specs_nonfatal_getenv.patch +++ b/devel/gcc/patches/920-specs_nonfatal_getenv.patch @@ -1,6 +1,6 @@ --- a/gcc/gcc.c +++ b/gcc/gcc.c -@@ -7772,7 +7772,10 @@ getenv_spec_function (int argc, const ch +@@ -8003,7 +8003,10 @@ getenv_spec_function (int argc, const ch value = getenv (argv[0]); if (!value) diff --git a/devel/gcc/patches/999-coldfire.patch b/devel/gcc/patches/999-coldfire.patch deleted file mode 100644 index 0913f3497e..0000000000 --- a/devel/gcc/patches/999-coldfire.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -1805,7 +1805,7 @@ m68k-*-linux*) # Motorola m68k's runnin - default_m68k_cpu=68020 - default_cf_cpu=5475 - with_arch=${with_arch:-m68k} -- tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h m68k/linux.h ./sysroot-suffix.h" -+ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h m68k/linux.h" - extra_options="${extra_options} m68k/ieee.opt" - tm_defines="${tm_defines} MOTOROLA=1" - tmake_file="${tmake_file} m68k/t-floatlib m68k/t-linux m68k/t-mlibs" From f24052dd61775722a17d6ccdd15caf136da65a8c Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Sun, 10 Aug 2014 19:37:28 +0200 Subject: [PATCH 17/19] gcc: Specify target languages the right way. There are no CONFIG_INSTALL_* vars in the SDK anymore. Signed-off-by: Christian Beier --- devel/gcc/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile index 3048557264..b7828ba50a 100644 --- a/devel/gcc/Makefile +++ b/devel/gcc/Makefile @@ -23,8 +23,7 @@ PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk -SEP:=, -TARGET_LANGUAGES:="c$(if $(CONFIG_INSTALL_LIBSTDCPP),$(SEP)c++)$(if $(CONFIG_INSTALL_LIBGCJ),$(SEP)java)" +TARGET_LANGUAGES:="c,c++" define Package/gcc SECTION:=devel From 304e86ff28f0d8b157787a2b6183fa1068896f63 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Tue, 12 Aug 2014 11:04:38 +0200 Subject: [PATCH 18/19] gcc: Get rid of those sed substitutions and use proper ./configure args instead. Signed-off-by: Christian Beier --- devel/gcc/Makefile | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile index b7828ba50a..2eb1cfbbe5 100644 --- a/devel/gcc/Makefile +++ b/devel/gcc/Makefile @@ -24,6 +24,17 @@ PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk TARGET_LANGUAGES:="c,c++" +BUGURL=https://dev.openwrt.org/ +PKGVERSION=OpenWrt GCC $(PKG_VERSION) + +STRIP:=$(STAGING_DIR_HOST)/bin/sstrip +RSTRIP:= \ + NM="$(TARGET_CROSS)nm" \ + STRIP="$(STRIP) --strip-debug" \ + STRIP_KMOD="$(TARGET_CROSS)strip --strip-debug" \ + $(SCRIPT_DIR)/rstrip.sh + + define Package/gcc SECTION:=devel @@ -37,21 +48,12 @@ define Package/gcc/description build a native toolchain for compiling on target endef -STRIP:=$(STAGING_DIR_HOST)/bin/sstrip -RSTRIP:= \ - NM="$(TARGET_CROSS)nm" \ - STRIP="$(STRIP) --strip-debug" \ - STRIP_KMOD="$(TARGET_CROSS)strip --strip-debug" \ - $(SCRIPT_DIR)/rstrip.sh - define Build/Prepare $(PKG_UNPACK) # we have to download additional stuff before patching (cd $(PKG_BUILD_DIR) && ./contrib/download_prerequisites) $(Build/Patch) - $(SED) 's,\(version_string.. = "[0-9\.]*\).*\(";\),\1 (OpenWrt-2.0)\2,' $(PKG_BUILD_DIR)/gcc/version.c - $(SED) 's,\(bug_report_url.. = "\).*\(";\),\1\2,' $(PKG_BUILD_DIR)/gcc/version.c endef @@ -65,6 +67,8 @@ define Build/Configure --host=$(REAL_GNU_TARGET_NAME) \ --target=$(REAL_GNU_TARGET_NAME) \ --enable-languages=$(TARGET_LANGUAGES) \ + --with-bugurl=$(BUGURL) \ + --with-pkgversion="$(PKGVERSION)" \ --enable-shared \ --disable-__cxa_atexit \ --enable-target-optspace \ From 372787d29b8a4ac02c8d4b24e48a9a54a1cafc50 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Tue, 12 Aug 2014 12:57:37 +0200 Subject: [PATCH 19/19] gcc: Use strip instead of sstrip as sstrip somehow stops the on-target compilation from working properly. Signed-off-by: Christian Beier --- devel/gcc/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile index 2eb1cfbbe5..c8d87335e9 100644 --- a/devel/gcc/Makefile +++ b/devel/gcc/Makefile @@ -27,15 +27,15 @@ TARGET_LANGUAGES:="c,c++" BUGURL=https://dev.openwrt.org/ PKGVERSION=OpenWrt GCC $(PKG_VERSION) -STRIP:=$(STAGING_DIR_HOST)/bin/sstrip +# not using sstrip here as this fucks up the .so's somehow +STRIP:=$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)strip RSTRIP:= \ - NM="$(TARGET_CROSS)nm" \ - STRIP="$(STRIP) --strip-debug" \ - STRIP_KMOD="$(TARGET_CROSS)strip --strip-debug" \ + NM="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)nm" \ + STRIP="$(STRIP)" \ + STRIP_KMOD="$(STRIP) --strip-debug" \ $(SCRIPT_DIR)/rstrip.sh - define Package/gcc SECTION:=devel CATEGORY:=Development