summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.8.inc187
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.8/0037-gcc-4.8-PR56797.patch66
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.8/0051-fix-unwind-race.patch33
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.8/0052-PR-rtl-optimization-61801.patch36
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.8/target-gcc-includedir.patch81
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9.inc196
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch30
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9/0037-gcc-4.8-PR56797.patch66
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9/0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch138
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9/0052-Fix-GCC-targeting-E500-SPE-errors-with-the-_Decimal64-type.patch98
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch66
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch61
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9/0055-dwarf-reg-processing-helper.patch148
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9/0056-define-default-cfa-register-mapping.patch75
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9/0057-aarch64-config.patch32
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch113
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch59
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch55
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9/0061-target-gcc-includedir.patch81
-rw-r--r--meta/recipes-devtools/gcc/gcc-common.inc48
-rw-r--r--meta/recipes-devtools/gcc/gcc-configure-common.inc80
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-canadian.inc35
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-initial.inc38
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross.inc31
-rw-r--r--meta/recipes-devtools/gcc/gcc-multilib-config.inc35
-rw-r--r--meta/recipes-devtools/gcc/gcc-runtime.inc185
-rw-r--r--meta/recipes-devtools/gcc/gcc-sanitizers.inc119
-rw-r--r--meta/recipes-devtools/gcc/gcc-sanitizers_4.8.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-shared-source.inc9
-rw-r--r--meta/recipes-devtools/gcc/gcc-source.inc35
-rw-r--r--meta/recipes-devtools/gcc/gcc-source_4.8.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-source_4.9.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-target.inc119
-rw-r--r--meta/recipes-devtools/gcc/libgcc-common.inc6
-rw-r--r--meta/recipes-devtools/gcc/libgcc.inc42
-rw-r--r--meta/recipes-devtools/gcc/libgfortran.inc31
37 files changed, 1673 insertions, 769 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.8.inc b/meta/recipes-devtools/gcc/gcc-4.8.inc
index 9f2928b78a..06e6982d93 100644
--- a/meta/recipes-devtools/gcc/gcc-4.8.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.8.inc
@@ -15,62 +15,66 @@ NATIVEDEPS = "mpfr-native gmp-native libmpc-native zlib-native"
LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
- file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
- file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
- file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
- file://COPYING.RUNTIME;md5=fe60d87048567d4fe8c8a0ed2448bcc8"
-
-SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
- file://0002-uclibc-conf.patch \
- file://0003-gcc-uclibc-locale-ctype_touplow_t.patch \
- file://0004-uclibc-locale.patch \
- file://0005-uclibc-locale-no__x.patch \
- file://0006-uclibc-locale-wchar_fix.patch \
- file://0007-uclibc-locale-update.patch \
- file://0008-missing-execinfo_h.patch \
- file://0009-c99-snprintf.patch \
- file://0010-c99-complex-ugly-hack.patch \
- file://0011-index_macro.patch \
- file://0012-libmudflap-susv3-legacy.patch \
- file://0013-libstdc-namespace.patch \
- file://0014-sh-pr24836.patch \
- file://0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch \
- file://0016-gcc-poison-system-directories.patch \
- file://0017-gcc-poison-dir-extend.patch \
- file://0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \
- file://0019-64-bit-multilib-hack.patch \
- file://0020-optional-libstdc.patch \
- file://0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch \
- file://0022-COLLECT_GCC_OPTIONS.patch \
- file://0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \
- file://0024-PR-target-32219.patch \
- file://0025-fortran-cross-compile-hack.patch \
- file://0026-libgcc-sjlj-check.patch \
- file://0027-cpp-honor-sysroot.patch \
- file://0028-MIPS64-Default-to-N64-ABI.patch \
- file://0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
- file://0030-gcc-Fix-argument-list-too-long-error.patch \
- file://0031-Disable-sdt.patch \
- file://0032-libtool.patch \
- file://0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
- file://0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
- file://0035-wcast-qual-PR-55383.patch \
- file://0037-gcc-4.8-PR56797.patch \
- file://0038-gcc-4.8-build-args.patch \
- file://0039-gcc-4.8-PR57717.patch \
- file://0040-fix-g++-sysroot.patch \
- file://0041-libtool-avoid-libdir.patch \
- file://0042-pr57748.patch \
- file://0043-cpp.patch \
- file://0044-gengtypes.patch \
- file://0045-gcc-4.8-PR57717-PowerPC-E500v2.patch \
- file://0046-libatomic-deptracking.patch \
- file://0047-repomembug.patch \
- file://0048-PR58854_fix_arm_apcs_epilogue.patch \
- file://0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \
- file://0050-PR-target-58595.patch \
- "
+LIC_FILES_CHKSUM = "\
+ file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+ file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
+ file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+ file://COPYING.RUNTIME;md5=fe60d87048567d4fe8c8a0ed2448bcc8 \
+"
+
+SRC_URI = "\
+ ${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
+ file://0002-uclibc-conf.patch \
+ file://0003-gcc-uclibc-locale-ctype_touplow_t.patch \
+ file://0004-uclibc-locale.patch \
+ file://0005-uclibc-locale-no__x.patch \
+ file://0006-uclibc-locale-wchar_fix.patch \
+ file://0007-uclibc-locale-update.patch \
+ file://0008-missing-execinfo_h.patch \
+ file://0009-c99-snprintf.patch \
+ file://0010-c99-complex-ugly-hack.patch \
+ file://0011-index_macro.patch \
+ file://0012-libmudflap-susv3-legacy.patch \
+ file://0013-libstdc-namespace.patch \
+ file://0014-sh-pr24836.patch \
+ file://0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch \
+ file://0016-gcc-poison-system-directories.patch \
+ file://0017-gcc-poison-dir-extend.patch \
+ file://0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \
+ file://0019-64-bit-multilib-hack.patch \
+ file://0020-optional-libstdc.patch \
+ file://0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch \
+ file://0022-COLLECT_GCC_OPTIONS.patch \
+ file://0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \
+ file://0024-PR-target-32219.patch \
+ file://0025-fortran-cross-compile-hack.patch \
+ file://0026-libgcc-sjlj-check.patch \
+ file://0027-cpp-honor-sysroot.patch \
+ file://0028-MIPS64-Default-to-N64-ABI.patch \
+ file://0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
+ file://0030-gcc-Fix-argument-list-too-long-error.patch \
+ file://0031-Disable-sdt.patch \
+ file://0032-libtool.patch \
+ file://0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
+ file://0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
+ file://0035-wcast-qual-PR-55383.patch \
+ file://0038-gcc-4.8-build-args.patch \
+ file://0039-gcc-4.8-PR57717.patch \
+ file://0040-fix-g++-sysroot.patch \
+ file://0041-libtool-avoid-libdir.patch \
+ file://0042-pr57748.patch \
+ file://0043-cpp.patch \
+ file://0044-gengtypes.patch \
+ file://0045-gcc-4.8-PR57717-PowerPC-E500v2.patch \
+ file://0046-libatomic-deptracking.patch \
+ file://0047-repomembug.patch \
+ file://0048-PR58854_fix_arm_apcs_epilogue.patch \
+ file://0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \
+ file://0050-PR-target-58595.patch \
+ file://0052-PR-rtl-optimization-61801.patch \
+ file://target-gcc-includedir.patch \
+"
SRC_URI[md5sum] = "a3d7d63b9cb6b6ea049469a0c4a43c9d"
SRC_URI[sha256sum] = "09dc2276c73424bbbfda1dbddc62bbbf900c9f185acf7f3e1d773ce2d7e3cdc8"
@@ -83,40 +87,47 @@ JAVA = ""
LTO = "--enable-lto"
-EXTRA_OECONF_BASE = " ${LTO} \
- --enable-libssp \
- --disable-bootstrap \
- --disable-libmudflap \
- --with-system-zlib \
- --with-linker-hash-style=${LINKER_HASH_STYLE} \
- --enable-linker-build-id \
- --with-ppl=no \
- --with-cloog=no \
- --enable-checking=release \
- --enable-cheaders=c_global "
-
-EXTRA_OECONF_INITIAL = "--disable-libmudflap \
- --disable-libgomp \
- --disable-libssp \
- --disable-libquadmath \
- --with-system-zlib \
- --disable-lto \
- --disable-plugin \
- --enable-decimal-float=no"
-
-EXTRA_OECONF_INTERMEDIATE = "--disable-libmudflap \
- --disable-libgomp \
- --disable-libquadmath \
- --with-system-zlib \
- --disable-lto \
- --disable-plugin \
- --disable-libssp"
+EXTRA_OECONF_BASE = "\
+ ${LTO} \
+ --enable-libssp \
+ --disable-bootstrap \
+ --disable-libmudflap \
+ --with-system-zlib \
+ --with-linker-hash-style=${LINKER_HASH_STYLE} \
+ --enable-linker-build-id \
+ --with-ppl=no \
+ --with-cloog=no \
+ --enable-checking=release \
+ --enable-cheaders=c_global \
+"
+
+EXTRA_OECONF_INITIAL = "\
+ --disable-libmudflap \
+ --disable-libgomp \
+ --disable-libssp \
+ --disable-libquadmath \
+ --with-system-zlib \
+ --disable-lto \
+ --disable-plugin \
+ --enable-decimal-float=no \
+"
+
+EXTRA_OECONF_INTERMEDIATE = "\
+ --disable-libmudflap \
+ --disable-libgomp \
+ --disable-libquadmath \
+ --with-system-zlib \
+ --disable-lto \
+ --disable-plugin \
+ --disable-libssp \
+"
EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
-EXTRA_OECONF_PATHS = " \
- --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \
- --with-sysroot=${STAGING_DIR_TARGET} \
- --with-build-sysroot=${STAGING_DIR_TARGET}"
+EXTRA_OECONF_PATHS = "\
+ --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++/${BINV} \
+ --with-sysroot=${STAGING_DIR_TARGET} \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0037-gcc-4.8-PR56797.patch b/meta/recipes-devtools/gcc/gcc-4.8/0037-gcc-4.8-PR56797.patch
deleted file mode 100644
index b5d7b864fd..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.8/0037-gcc-4.8-PR56797.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-Upstream-Status: Backport
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-From patchwork Fri Apr 19 09:34:49 2013
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [ARM] Fix PR56797
-Date: Thu, 18 Apr 2013 23:34:49 -0000
-From: Greta Yorsh <Greta.Yorsh@arm.com>
-X-Patchwork-Id: 237891
-Message-Id: <000801ce3ce1$23fbdd60$6bf39820$@yorsh@arm.com>
-To: "GCC Patches" <gcc-patches@gcc.gnu.org>
-Cc: <raj.khem@gmail.com>, "Richard Earnshaw" <Richard.Earnshaw@arm.com>,
- "Ramana Radhakrishnan" <Ramana.Radhakrishnan@arm.com>
-
-Fix PR56797
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56797
-
-The problem is that peephole optimizer thinks it can generate an ldm, but
-the pattern for ldm no longer matches, because after r188738 it requires
-that if one of the destination registers is SP then the base register must
-be SP, and it's not SP in the test case.
-
-The test case fails on armv5t but doesn't fail on armv6t2 or armv7-a because
-peephole doesn't trigger there (because there is a different epilogue
-sequence). It looks like a latent problem for other architecture or CPUs.
-
-This patch adds this condition to the peephole optimizer.
-
-No regression on qemu for arm-none-eabi and fixes the test reported in the
-PR. I couldn't minimize the test sufficiently to include it in the
-testsuite.
-
-Ok for trunk?
-
-Thanks,
-Greta
-
-gcc/
-
-2013-04-18 Greta Yorsh <Greta.Yorsh@arm.com>
-
- PR target/56797
- * config/arm/arm.c (load_multiple_sequence): Require SP
- as base register for loads if SP is in the register list.
-
-
-diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
-index d00849c..60fef78 100644
---- a/gcc/config/arm/arm.c
-+++ b/gcc/config/arm/arm.c
-@@ -10347,6 +10347,13 @@ load_multiple_sequence (rtx *operands, int nops, int *regs, int *saved_order,
- || (i != nops - 1 && unsorted_regs[i] == base_reg))
- return 0;
-
-+ /* Don't allow SP to be loaded unless it is also the base
-+ register. It guarantees that SP is reset correctly when
-+ an LDM instruction is interruptted. Otherwise, we might
-+ end up with a corrupt stack. */
-+ if (unsorted_regs[i] == SP_REGNUM && base_reg != SP_REGNUM)
-+ return 0;
-+
- unsorted_offsets[i] = INTVAL (offset);
- if (i == 0 || unsorted_offsets[i] < unsorted_offsets[order[0]])
- order[0] = i;
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0051-fix-unwind-race.patch b/meta/recipes-devtools/gcc/gcc-4.8/0051-fix-unwind-race.patch
deleted file mode 100644
index e4fff127b3..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.8/0051-fix-unwind-race.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-These is a race over the installation of files into the include/ directory between:
-
-| (cd `${PWDCMD-pwd}`/include ; \| tar -cf - .; exit 0) | (cd /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-oecore/build/build/tmp-eglibc/work/armv5te-oe-linux-gnueabi/gcc-cross-initial/4.8.2-r0/image/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-oecore/build/build/tmp-eglibc/sysroots/x86_64-linux/usr/lib/armv5te-oe-linux-gnueabi.gcc-cross-initial/gcc/arm-oe-linux-gnueabi/4.8.2/include; tar xpf - )
-
-and
-
-| /bin/install -c -m 644 unwind.h /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-oecore/build/build/tmp-eglibc/work/armv5te-oe-linux-gnueabi/gcc-cross-initial/4.8.2-r0/image/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-oecore/build/build/tmp-eglibc/sysroots/x86_64-linux/usr/lib/armv5te-oe-linux-gnueabi.gcc-cross-initial/gcc/arm-oe-linux-gnueabi/4.8.2/include
-| /bin/install: cannot create regular file '/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-oecore/build/build/tmp-eglibc/work/armv5te-oe-linux-gnueabi/gcc-cross-initial/4.8.2-r0/image/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-oecore/build/build/tmp-eglibc/sysroots/x86_64-linux/usr/lib/armv5te-oe-linux-gnueabi.gcc-cross-initial/gcc/arm-oe-linux-gnueabi/4.8.2/include/unwind.h': File exists
-| make[1]: *** [install-unwind_h] Error 1
-
-which under the right circumstances leads to the above build failure. Since we don't
-need two copies of this file and we don't use install-no-fixincludes, we can disable
-the libgcc installation.
-
-RP 2014/04/10
-
-Upstream-Status: Pending [would need a rewrite into an acceptable patch form]
-
-Index: gcc-4.8.2/libgcc/Makefile.in
-===================================================================
---- gcc-4.8.2.orig/libgcc/Makefile.in 2013-02-04 19:06:20.000000000 +0000
-+++ gcc-4.8.2/libgcc/Makefile.in 2014-04-10 09:58:33.018748787 +0000
-@@ -1020,8 +1020,8 @@
- # This is however useful for "install-no-fixincludes" case, when only the gcc
- # internal headers are copied by gcc's install.
- install-unwind_h:
-- $(mkinstalldirs) $(DESTDIR)$(libsubdir)/include
-- $(INSTALL_DATA) unwind.h $(DESTDIR)$(libsubdir)/include
-+# $(mkinstalldirs) $(DESTDIR)$(libsubdir)/include
-+# $(INSTALL_DATA) unwind.h $(DESTDIR)$(libsubdir)/include
-
- all: install-unwind_h-forbuild
-
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0052-PR-rtl-optimization-61801.patch b/meta/recipes-devtools/gcc/gcc-4.8/0052-PR-rtl-optimization-61801.patch
new file mode 100644
index 0000000000..300b2042b2
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0052-PR-rtl-optimization-61801.patch
@@ -0,0 +1,36 @@
+From 8dfe30973ab03f0480f1e249f320e78f210dc230 Mon Sep 17 00:00:00 2001
+From: rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Thu, 17 Jul 2014 07:49:44 +0000
+Subject: [PATCH] 2014-07-17 Richard Biener <rguenther@suse.de>
+
+ PR rtl-optimization/61801
+ * sched-deps.c (sched_analyze_2): For ASM_OPERANDS and
+ ASM_INPUT don't set reg_pending_barrier if it appears in a
+ debug-insn.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@212740 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61801]
+Signed-off-by: Peter A. Bigot <pab@pabigot.com>
+
+---
+ gcc/sched-deps.c | 3 ++-
+
+diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
+index 07857f2..4ac2542 100644
+--- a/gcc/sched-deps.c
++++ b/gcc/sched-deps.c
+@@ -2744,7 +2744,8 @@ sched_analyze_2 (struct deps_desc *deps, rtx x, rtx insn)
+ Consider for instance a volatile asm that changes the fpu rounding
+ mode. An insn should not be moved across this even if it only uses
+ pseudo-regs because it might give an incorrectly rounded result. */
+- if (code != ASM_OPERANDS || MEM_VOLATILE_P (x))
++ if ((code != ASM_OPERANDS || MEM_VOLATILE_P (x))
++ && !DEBUG_INSN_P (insn))
+ reg_pending_barrier = TRUE_BARRIER;
+
+ /* For all ASM_OPERANDS, we must traverse the vector of input operands.
+--
+1.8.5.5
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/target-gcc-includedir.patch b/meta/recipes-devtools/gcc/gcc-4.8/target-gcc-includedir.patch
new file mode 100644
index 0000000000..f48c66dcac
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/target-gcc-includedir.patch
@@ -0,0 +1,81 @@
+Ensure target gcc headers can be included
+
+There are a few headers installed as part of the OpenEmbedded
+gcc-runtime target (omp.h, ssp/*.h). Being installed from a recipe
+built for the target architecture, these are within the target
+sysroot and not cross/nativesdk; thus they weren't able to be
+found by gcc with the existing search paths. Add support for
+picking up these headers under the sysroot supplied on the gcc
+command line in order to resolve this.
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Upstream-Status: Pending
+
+--- a/gcc/Makefile.in 2014-12-23 11:57:33.327873331 +0000
++++ b/gcc/Makefile.in 2015-01-21 11:32:35.447305394 +0000
+@@ -587,6 +587,7 @@
+
+ # Directory in which the compiler finds libraries etc.
+ libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version)
++libsubdir_target = gcc/$(target_noncanonical)/$(version)
+ # Directory in which the compiler finds executables
+ libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(version)
+ # Directory in which all plugin resources are installed
+@@ -2534,6 +2535,7 @@
+
+ PREPROCESSOR_DEFINES = \
+ -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
++ -DGCC_INCLUDE_SUBDIR_TARGET=\"$(libsubdir_target)/include\" \
+ -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \
+ -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
+ -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \
+--- a/gcc/cppdefault.c 2015-01-13 17:40:26.131012725 +0000
++++ b/gcc/cppdefault.c 2015-01-21 11:30:08.928426492 +0000
+@@ -59,6 +59,10 @@
+ /* This is the dir for gcc's private headers. */
+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
+ #endif
++#ifdef GCC_INCLUDE_SUBDIR_TARGET
++ /* This is the dir for gcc's private headers under the specified sysroot. */
++ { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 },
++#endif
+ #ifdef LOCAL_INCLUDE_DIR
+ /* /usr/local/include comes before the fixincluded header files. */
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
+diff --git a/gcc/defaults.h b/gcc/defaults.h
+index f94ae17..d98b40b 100644
+--- a/gcc/defaults.h
++++ b/gcc/defaults.h
+@@ -1390,4 +1390,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+
+ #endif /* GCC_INSN_FLAGS_H */
+
++/* Default prefixes to attach to command names. */
++
++#ifndef STANDARD_STARTFILE_PREFIX_1
++#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
++#endif
++#ifndef STANDARD_STARTFILE_PREFIX_2
++#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
++#endif
++
+ #endif /* ! GCC_DEFAULTS_H */
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 9f0b781..174fca8 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1189,13 +1189,6 @@ static const char *gcc_libexec_prefix;
+
+ /* Default prefixes to attach to command names. */
+
+-#ifndef STANDARD_STARTFILE_PREFIX_1
+-#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+-#endif
+-#ifndef STANDARD_STARTFILE_PREFIX_2
+-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
+-#endif
+-
+ #ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */
+ #undef MD_EXEC_PREFIX
+ #undef MD_STARTFILE_PREFIX
diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc b/meta/recipes-devtools/gcc/gcc-4.9.inc
index 185dbba822..3af87d1cc6 100644
--- a/meta/recipes-devtools/gcc/gcc-4.9.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
@@ -2,11 +2,11 @@ require gcc-common.inc
# Third digit in PV should be incremented after a minor release
-PV = "4.9.0"
+PV = "4.9.2"
# BINV should be incremented to a revision after a minor gcc release
-BINV = "4.9.0"
+BINV = "4.9.2"
FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-4.9:"
@@ -15,60 +15,71 @@ NATIVEDEPS = "mpfr-native gmp-native libmpc-native zlib-native"
LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
- file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
- file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
- file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
- file://COPYING.RUNTIME;md5=fe60d87048567d4fe8c8a0ed2448bcc8"
-
-SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
- file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \
- file://0002-uclibc-conf.patch \
- file://0003-gcc-uclibc-locale-ctype_touplow_t.patch \
- file://0004-uclibc-locale.patch \
- file://0005-uclibc-locale-no__x.patch \
- file://0006-uclibc-locale-wchar_fix.patch \
- file://0007-uclibc-locale-update.patch \
- file://0008-missing-execinfo_h.patch \
- file://0009-c99-snprintf.patch \
- file://0010-c99-complex-ugly-hack.patch \
- file://0011-index_macro.patch \
- file://0013-libstdc-namespace.patch \
- file://0014-sh-pr24836.patch \
- file://0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch \
- file://0016-gcc-poison-system-directories.patch \
- file://0017-gcc-poison-dir-extend.patch \
- file://0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \
- file://0019-64-bit-multilib-hack.patch \
- file://0020-optional-libstdc.patch \
- file://0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch \
- file://0022-COLLECT_GCC_OPTIONS.patch \
- file://0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \
- file://0024-PR-target-32219.patch \
- file://0025-fortran-cross-compile-hack.patch \
- file://0026-libgcc-sjlj-check.patch \
- file://0027-cpp-honor-sysroot.patch \
- file://0028-MIPS64-Default-to-N64-ABI.patch \
- file://0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
- file://0030-gcc-Fix-argument-list-too-long-error.patch \
- file://0031-Disable-sdt.patch \
- file://0032-libtool.patch \
- file://0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
- file://0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
- file://0037-gcc-4.8-PR56797.patch \
- file://0040-fix-g++-sysroot.patch \
- file://0041-libtool-avoid-libdir.patch \
- file://0043-cpp.patch \
- file://0044-gengtypes.patch \
- file://0046-libatomic-deptracking.patch \
- file://0047-repomembug.patch \
- file://0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \
- file://0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch \
- file://0051-eabispe.patch \
- file://0052-Fix-GCC-targeting-E500-SPE-errors-with-the-_Decimal64-type.patch \
- "
-SRC_URI[md5sum] = "9709b49ae0e904cbb0a6a1b62853b556"
-SRC_URI[sha256sum] = "b9b047a97bade9c1c89970bc8e211ff57b7b8998a1730a80a653d329f8ed1257"
+LIC_FILES_CHKSUM = "\
+ file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+ file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
+ file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+ file://COPYING.RUNTIME;md5=fe60d87048567d4fe8c8a0ed2448bcc8 \
+"
+
+SRC_URI = "\
+ ${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
+ file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \
+ file://0002-uclibc-conf.patch \
+ file://0003-gcc-uclibc-locale-ctype_touplow_t.patch \
+ file://0004-uclibc-locale.patch \
+ file://0005-uclibc-locale-no__x.patch \
+ file://0006-uclibc-locale-wchar_fix.patch \
+ file://0007-uclibc-locale-update.patch \
+ file://0008-missing-execinfo_h.patch \
+ file://0009-c99-snprintf.patch \
+ file://0010-c99-complex-ugly-hack.patch \
+ file://0011-index_macro.patch \
+ file://0013-libstdc-namespace.patch \
+ file://0014-sh-pr24836.patch \
+ file://0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch \
+ file://0016-gcc-poison-system-directories.patch \
+ file://0017-gcc-poison-dir-extend.patch \
+ file://0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \
+ file://0019-64-bit-multilib-hack.patch \
+ file://0020-optional-libstdc.patch \
+ file://0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch \
+ file://0022-COLLECT_GCC_OPTIONS.patch \
+ file://0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \
+ file://0024-PR-target-32219.patch \
+ file://0025-fortran-cross-compile-hack.patch \
+ file://0026-libgcc-sjlj-check.patch \
+ file://0027-cpp-honor-sysroot.patch \
+ file://0028-MIPS64-Default-to-N64-ABI.patch \
+ file://0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
+ file://0030-gcc-Fix-argument-list-too-long-error.patch \
+ file://0031-Disable-sdt.patch \
+ file://0032-libtool.patch \
+ file://0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
+ file://0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
+ file://0040-fix-g++-sysroot.patch \
+ file://0041-libtool-avoid-libdir.patch \
+ file://0043-cpp.patch \
+ file://0044-gengtypes.patch \
+ file://0046-libatomic-deptracking.patch \
+ file://0047-repomembug.patch \
+ file://0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \
+ file://0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch \
+ file://0051-eabispe.patch \
+ file://0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch \
+ file://0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch \
+ file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \
+ file://0055-dwarf-reg-processing-helper.patch \
+ file://0056-define-default-cfa-register-mapping.patch \
+ file://0057-aarch64-config.patch \
+ file://0058-gcc-r212171.patch \
+ file://0059-gcc-PR-rtl-optimization-63348.patch \
+ file://0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch \
+ file://0061-target-gcc-includedir.patch \
+"
+SRC_URI[md5sum] = "4df8ee253b7f3863ad0b86359cd39c43"
+SRC_URI[sha256sum] = "2020c98295856aa13fda0f2f3a4794490757fc24bcca918d52cc8b4917b972dd"
S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
@@ -79,40 +90,45 @@ JAVA = ""
LTO = "--enable-lto"
-EXTRA_OECONF_BASE = " ${LTO} \
- --enable-libssp \
- --disable-bootstrap \
- --disable-libmudflap \
- --with-system-zlib \
- --with-linker-hash-style=${LINKER_HASH_STYLE} \
- --enable-linker-build-id \
- --with-ppl=no \
- --with-cloog=no \
- --enable-checking=release \
- --enable-cheaders=c_global "
-
-EXTRA_OECONF_INITIAL = "--disable-libmudflap \
- --disable-libgomp \
- --disable-libssp \
- --disable-libquadmath \
- --with-system-zlib \
- --disable-lto \
- --disable-plugin \
- --enable-decimal-float=no"
-
-EXTRA_OECONF_INTERMEDIATE = "--disable-libmudflap \
- --disable-libgomp \
- --disable-libquadmath \
- --with-system-zlib \
- --disable-lto \
- --disable-plugin \
- --disable-libssp"
+EXTRA_OECONF_BASE = "\
+ ${LTO} \
+ --enable-libssp \
+ --disable-bootstrap \
+ --disable-libmudflap \
+ --with-system-zlib \
+ --with-linker-hash-style=${LINKER_HASH_STYLE} \
+ --enable-linker-build-id \
+ --with-ppl=no \
+ --with-cloog=no \
+ --enable-checking=release \
+ --enable-cheaders=c_global \
+"
+
+EXTRA_OECONF_INITIAL = "\
+ --disable-libmudflap \
+ --disable-libgomp \
+ --disable-libssp \
+ --disable-libquadmath \
+ --with-system-zlib \
+ --disable-lto \
+ --disable-plugin \
+ --enable-decimal-float=no \
+"
+
+EXTRA_OECONF_INTERMEDIATE = "\
+ --disable-libmudflap \
+ --disable-libgomp \
+ --disable-libquadmath \
+ --with-system-zlib \
+ --disable-lto \
+ --disable-plugin \
+ --disable-libssp \
+"
EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
-EXTRA_OECONF_PATHS = " \
- --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \
- --with-sysroot=${STAGING_DIR_TARGET} \
- --with-build-sysroot=${STAGING_DIR_TARGET}"
-
-
+EXTRA_OECONF_PATHS = "\
+ --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch b/meta/recipes-devtools/gcc/gcc-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
index 9e4435cf59..fddfe9e5e8 100644
--- a/meta/recipes-devtools/gcc/gcc-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
@@ -1,4 +1,4 @@
-From 46d52439052f0876a92dcf8a0ab9c60d75c8030b Mon Sep 17 00:00:00 2001
+From f7d49ca445e60faa1b5256c6b4f96c1ee5c0e353 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 Mar 2013 09:17:25 +0400
Subject: [PATCH 23/35] Use the defaults.h in ${B} instead of ${S}, and t-oe
@@ -11,6 +11,14 @@ gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
+
+While compiling gcc-crosssdk-initial-x86_64 on some host, there is
+occasionally failure that test the existance of default.h doesn't
+work, the reason is tm_include_list='** defaults.h' rather than
+tm_include_list='** ./defaults.h'
+
+So we add the test condition for this situation.
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
gcc/Makefile.in | 2 +-
gcc/configure | 4 ++--
@@ -19,10 +27,10 @@ Upstream-Status: Pending
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
-index 90a2bba..2320497 100644
+index d1ab22f..15fe4b6 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
-@@ -469,7 +469,7 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
+@@ -483,7 +483,7 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
xmake_file=@xmake_file@
@@ -32,10 +40,10 @@ index 90a2bba..2320497 100644
TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@
TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@
diff --git a/gcc/configure b/gcc/configure
-index bdab45a..d587993 100755
+index 5399b2b..60a04bd 100755
--- a/gcc/configure
+++ b/gcc/configure
-@@ -11539,8 +11539,8 @@ for f in $tm_file; do
+@@ -11631,8 +11631,8 @@ for f in $tm_file; do
tm_include_list="${tm_include_list} $f"
;;
defaults.h )
@@ -47,10 +55,10 @@ index bdab45a..d587993 100755
* )
tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
diff --git a/gcc/configure.ac b/gcc/configure.ac
-index 5f5c909..5e5e84f 100644
+index f87c3b6..460e0d9 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
-@@ -1720,8 +1720,8 @@ for f in $tm_file; do
+@@ -1740,8 +1740,8 @@ for f in $tm_file; do
tm_include_list="${tm_include_list} $f"
;;
defaults.h )
@@ -62,7 +70,7 @@ index 5f5c909..5e5e84f 100644
* )
tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
-index 29fdfc7..e048dce 100644
+index c7146ed..b153f45 100644
--- a/gcc/mkconfig.sh
+++ b/gcc/mkconfig.sh
@@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then
@@ -70,11 +78,11 @@ index 29fdfc7..e048dce 100644
echo '#ifdef IN_GCC' >> ${output}T
for file in "$@"; do
- if test x"$file" = x"defaults.h"; then
-+ if test x"$file" = x"./defaults.h"; then
++ if test x"$file" = x"./defaults.h" -o x"$file" = x"defaults.h"; then
postpone_defaults_h="yes"
else
echo "# include \"$file\"" >> ${output}T
-@@ -103,7 +103,7 @@ esac
+@@ -106,7 +106,7 @@ esac
# If we postponed including defaults.h, add the #include now.
if test x"$postpone_defaults_h" = x"yes"; then
@@ -84,5 +92,5 @@ index 29fdfc7..e048dce 100644
# Add multiple inclusion protection guard, part two.
--
-1.7.10.4
+1.9.1
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0037-gcc-4.8-PR56797.patch b/meta/recipes-devtools/gcc/gcc-4.9/0037-gcc-4.8-PR56797.patch
deleted file mode 100644
index b5d7b864fd..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.9/0037-gcc-4.8-PR56797.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-Upstream-Status: Backport
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-From patchwork Fri Apr 19 09:34:49 2013
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [ARM] Fix PR56797
-Date: Thu, 18 Apr 2013 23:34:49 -0000
-From: Greta Yorsh <Greta.Yorsh@arm.com>
-X-Patchwork-Id: 237891
-Message-Id: <000801ce3ce1$23fbdd60$6bf39820$@yorsh@arm.com>
-To: "GCC Patches" <gcc-patches@gcc.gnu.org>
-Cc: <raj.khem@gmail.com>, "Richard Earnshaw" <Richard.Earnshaw@arm.com>,
- "Ramana Radhakrishnan" <Ramana.Radhakrishnan@arm.com>
-
-Fix PR56797
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56797
-
-The problem is that peephole optimizer thinks it can generate an ldm, but
-the pattern for ldm no longer matches, because after r188738 it requires
-that if one of the destination registers is SP then the base register must
-be SP, and it's not SP in the test case.
-
-The test case fails on armv5t but doesn't fail on armv6t2 or armv7-a because
-peephole doesn't trigger there (because there is a different epilogue
-sequence). It looks like a latent problem for other architecture or CPUs.
-
-This patch adds this condition to the peephole optimizer.
-
-No regression on qemu for arm-none-eabi and fixes the test reported in the
-PR. I couldn't minimize the test sufficiently to include it in the
-testsuite.
-
-Ok for trunk?
-
-Thanks,
-Greta
-
-gcc/
-
-2013-04-18 Greta Yorsh <Greta.Yorsh@arm.com>
-
- PR target/56797
- * config/arm/arm.c (load_multiple_sequence): Require SP
- as base register for loads if SP is in the register list.
-
-
-diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
-index d00849c..60fef78 100644
---- a/gcc/config/arm/arm.c
-+++ b/gcc/config/arm/arm.c
-@@ -10347,6 +10347,13 @@ load_multiple_sequence (rtx *operands, int nops, int *regs, int *saved_order,
- || (i != nops - 1 && unsorted_regs[i] == base_reg))
- return 0;
-
-+ /* Don't allow SP to be loaded unless it is also the base
-+ register. It guarantees that SP is reset correctly when
-+ an LDM instruction is interruptted. Otherwise, we might
-+ end up with a corrupt stack. */
-+ if (unsorted_regs[i] == SP_REGNUM && base_reg != SP_REGNUM)
-+ return 0;
-+
- unsorted_offsets[i] = INTVAL (offset);
- if (i == 0 || unsorted_offsets[i] < unsorted_offsets[order[0]])
- order[0] = i;
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch b/meta/recipes-devtools/gcc/gcc-4.9/0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch
new file mode 100644
index 0000000000..f6958b32c9
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch
@@ -0,0 +1,138 @@
+From d626297e87e19251a284ea1e9360e831b48999ca Mon Sep 17 00:00:00 2001
+From: mpf <mpf@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Thu, 4 Sep 2014 08:32:05 +0000
+Subject: [PATCH] Add target hook to override DWARF2 frame register size
+
+gcc/
+
+ * target.def (TARGET_DWARF_FRAME_REG_MODE): New target hook.
+ * targhooks.c (default_dwarf_frame_reg_mode): New function.
+ * targhooks.h (default_dwarf_frame_reg_mode): New prototype.
+ * doc/tm.texi.in (TARGET_DWARF_FRAME_REG_MODE): Document.
+ * doc/tm.texi: Regenerate.
+ * dwarf2cfi.c (expand_builtin_init_dwarf_reg_sizes): Abstract mode
+ selection logic to default_dwarf_frame_reg_mode.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214898 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [gcc 5.0]
+
+---
+ gcc/ChangeLog | 10 ++++++++++
+ gcc/doc/tm.texi | 7 +++++++
+ gcc/doc/tm.texi.in | 2 ++
+ gcc/dwarf2cfi.c | 4 +---
+ gcc/target.def | 11 +++++++++++
+ gcc/targhooks.c | 13 +++++++++++++
+ gcc/targhooks.h | 1 +
+ 7 files changed, 45 insertions(+), 3 deletions(-)
+
+Index: gcc-4.9.2/gcc/doc/tm.texi
+===================================================================
+--- gcc-4.9.2.orig/gcc/doc/tm.texi
++++ gcc-4.9.2/gcc/doc/tm.texi
+@@ -9017,6 +9017,13 @@ register in Dwarf. Otherwise, this hook
+ If not defined, the default is to return @code{NULL_RTX}.
+ @end deftypefn
+
++@deftypefn {Target Hook} {enum machine_mode} TARGET_DWARF_FRAME_REG_MODE (int @var{regno})
++Given a register, this hook should return the mode which the
++corresponding Dwarf frame register should have. This is normally
++used to return a smaller mode than the raw mode to prevent call
++clobbered parts of a register altering the frame register size
++@end deftypefn
++
+ @deftypefn {Target Hook} void TARGET_INIT_DWARF_REG_SIZES_EXTRA (tree @var{address})
+ If some registers are represented in Dwarf-2 unwind information in
+ multiple pieces, define this hook to fill in information about the
+Index: gcc-4.9.2/gcc/doc/tm.texi.in
+===================================================================
+--- gcc-4.9.2.orig/gcc/doc/tm.texi.in
++++ gcc-4.9.2/gcc/doc/tm.texi.in
+@@ -6745,6 +6745,8 @@ the target supports DWARF 2 frame unwind
+
+ @hook TARGET_DWARF_REGISTER_SPAN
+
++@hook TARGET_DWARF_FRAME_REG_MODE
++
+ @hook TARGET_INIT_DWARF_REG_SIZES_EXTRA
+
+ @hook TARGET_ASM_TTYPE
+Index: gcc-4.9.2/gcc/dwarf2cfi.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/dwarf2cfi.c
++++ gcc-4.9.2/gcc/dwarf2cfi.c
+@@ -271,11 +271,9 @@ expand_builtin_init_dwarf_reg_sizes (tre
+ if (rnum < DWARF_FRAME_REGISTERS)
+ {
+ HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
+- enum machine_mode save_mode = reg_raw_mode[i];
+ HOST_WIDE_INT size;
++ enum machine_mode save_mode = targetm.dwarf_frame_reg_mode (i);
+
+- if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
+- save_mode = choose_hard_reg_mode (i, 1, true);
+ if (dnum == DWARF_FRAME_RETURN_COLUMN)
+ {
+ if (save_mode == VOIDmode)
+Index: gcc-4.9.2/gcc/target.def
+===================================================================
+--- gcc-4.9.2.orig/gcc/target.def
++++ gcc-4.9.2/gcc/target.def
+@@ -3218,6 +3218,17 @@ If not defined, the default is to return
+ rtx, (rtx reg),
+ hook_rtx_rtx_null)
+
++/* Given a register return the mode of the corresponding DWARF frame
++ register. */
++DEFHOOK
++(dwarf_frame_reg_mode,
++ "Given a register, this hook should return the mode which the\n\
++corresponding Dwarf frame register should have. This is normally\n\
++used to return a smaller mode than the raw mode to prevent call\n\
++clobbered parts of a register altering the frame register size",
++ enum machine_mode, (int regno),
++ default_dwarf_frame_reg_mode)
++
+ /* If expand_builtin_init_dwarf_reg_sizes needs to fill in table
+ entries not corresponding directly to registers below
+ FIRST_PSEUDO_REGISTER, this hook should generate the necessary
+Index: gcc-4.9.2/gcc/targhooks.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/targhooks.c
++++ gcc-4.9.2/gcc/targhooks.c
+@@ -1438,6 +1438,19 @@ default_debug_unwind_info (void)
+ return UI_NONE;
+ }
+
++/* Determine the correct mode for a Dwarf frame register that represents
++ register REGNO. */
++
++enum machine_mode
++default_dwarf_frame_reg_mode (int regno)
++{
++ enum machine_mode save_mode = reg_raw_mode[regno];
++
++ if (HARD_REGNO_CALL_PART_CLOBBERED (regno, save_mode))
++ save_mode = choose_hard_reg_mode (regno, 1, true);
++ return save_mode;
++}
++
+ /* To be used by targets where reg_raw_mode doesn't return the right
+ mode for registers used in apply_builtin_return and apply_builtin_arg. */
+
+Index: gcc-4.9.2/gcc/targhooks.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/targhooks.h
++++ gcc-4.9.2/gcc/targhooks.h
+@@ -194,6 +194,7 @@ extern int default_label_align_max_skip
+ extern int default_jump_align_max_skip (rtx);
+ extern section * default_function_section(tree decl, enum node_frequency freq,
+ bool startup, bool exit);
++extern enum machine_mode default_dwarf_frame_reg_mode (int);
+ extern enum machine_mode default_get_reg_raw_mode (int);
+
+ extern void *default_get_pch_validity (size_t *);
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0052-Fix-GCC-targeting-E500-SPE-errors-with-the-_Decimal64-type.patch b/meta/recipes-devtools/gcc/gcc-4.9/0052-Fix-GCC-targeting-E500-SPE-errors-with-the-_Decimal64-type.patch
deleted file mode 100644
index b4be18e212..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.9/0052-Fix-GCC-targeting-E500-SPE-errors-with-the-_Decimal64-type.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-From e44a6d438db4848c2a555be773568a3cf7994206 Mon Sep 17 00:00:00 2001
-From: Alexandru-Cezar Sardan <alexandru.sardan-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
-Date: Mon, 26 May 2014 12:11:13 +0300
-Subject: [PATCH] Fix E500 with SPE errors with the _Decimal64 type
-
-[gcc]
-2014-04-21 Michael Meissner <meissner-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
-
- PR target/60735
- * config/rs6000/rs6000.md (mov<mode>_softfloat32, FMOVE64 case):
- If mode is DDmode and TARGET_E500_DOUBLE allow move.
-
- * config/rs6000/rs6000.c (rs6000_debug_reg_global): Print some
- more debug information for E500 if -mdebug=reg.
-
-[gcc/testsuite]
-2014-04-21 Michael Meissner <meissner-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
-
- PR target/60735
- * gcc.target/powerpc/pr60735.c: New test. Insure _Decimal64 does
- not cause errors if -mspe.
-
-Upstream status: Accepted
-
-This solves upstream bug 60735
-(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60735).
-
-Patch taken from https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=209664
----
- gcc/config/rs6000/rs6000.c | 18 ++++++++++++++++++
- gcc/config/rs6000/rs6000.md | 3 ++-
- gcc/testsuite/gcc.target/powerpc/pr60735.c | 11 +++++++++++
- 3 files changed, 31 insertions(+), 1 deletion(-)
- create mode 100644 gcc/testsuite/gcc.target/powerpc/pr60735.c
-
-diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
-index 494efc5..6dcf440 100644
---- a/gcc/config/rs6000/rs6000.c
-+++ b/gcc/config/rs6000/rs6000.c
-@@ -2283,6 +2283,24 @@ rs6000_debug_reg_global (void)
- if (rs6000_float_gprs)
- fprintf (stderr, DEBUG_FMT_S, "float_gprs", "true");
-
-+ fprintf (stderr, DEBUG_FMT_S, "fprs",
-+ (TARGET_FPRS ? "true" : "false"));
-+
-+ fprintf (stderr, DEBUG_FMT_S, "single_float",
-+ (TARGET_SINGLE_FLOAT ? "true" : "false"));
-+
-+ fprintf (stderr, DEBUG_FMT_S, "double_float",
-+ (TARGET_DOUBLE_FLOAT ? "true" : "false"));
-+
-+ fprintf (stderr, DEBUG_FMT_S, "soft_float",
-+ (TARGET_SOFT_FLOAT ? "true" : "false"));
-+
-+ fprintf (stderr, DEBUG_FMT_S, "e500_single",
-+ (TARGET_E500_SINGLE ? "true" : "false"));
-+
-+ fprintf (stderr, DEBUG_FMT_S, "e500_double",
-+ (TARGET_E500_DOUBLE ? "true" : "false"));
-+
- if (TARGET_LINK_STACK)
- fprintf (stderr, DEBUG_FMT_S, "link_stack", "true");
-
-diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
-index 64c9e7c..9cefe15 100644
---- a/gcc/config/rs6000/rs6000.md
-+++ b/gcc/config/rs6000/rs6000.md
-@@ -9395,7 +9395,8 @@
- (match_operand:FMOVE64 1 "input_operand" "r,Y,r,G,H,F"))]
- "! TARGET_POWERPC64
- && ((TARGET_FPRS && TARGET_SINGLE_FLOAT)
-- || TARGET_SOFT_FLOAT || TARGET_E500_SINGLE)
-+ || TARGET_SOFT_FLOAT || TARGET_E500_SINGLE
-+ || (<MODE>mode == DDmode && TARGET_E500_DOUBLE))
- && (gpc_reg_operand (operands[0], <MODE>mode)
- || gpc_reg_operand (operands[1], <MODE>mode))"
- "#"
-diff --git a/gcc/testsuite/gcc.target/powerpc/pr60735.c b/gcc/testsuite/gcc.target/powerpc/pr60735.c
-new file mode 100644
-index 0000000..9bac30b
---- /dev/null
-+++ b/gcc/testsuite/gcc.target/powerpc/pr60735.c
-@@ -0,0 +1,11 @@
-+/* { dg-do compile } */
-+/* { dg-options "-mcpu=8548 -mspe -mabi=spe -O2" } */
-+/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } { "*" } { "" } } */
-+
-+/* In PR60735, the type _Decimal64 generated an insn not found message. */
-+
-+void
-+pr60735 (_Decimal64 *p, _Decimal64 *q)
-+{
-+ *p = *q;
-+}
---
-1.7.9.5
-
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch b/meta/recipes-devtools/gcc/gcc-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch
new file mode 100644
index 0000000000..23b445c9eb
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch
@@ -0,0 +1,66 @@
+From a22a222c8f9299f6c07a0274388ade7d4ab8c28d Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Fri, 20 Jun 2014 16:41:08 -0400
+Subject: [PATCH] gcc: fix segfault from calling free on non-malloc'd area
+
+We see the following on a 32bit gcc installed on 64 bit host:
+
+ Reading symbols from ./i586-pokymllib32-linux-gcc...done.
+ (gdb) run
+ Starting program: x86-pokymllib32-linux/lib32-gcc/4.9.0-r0/image/usr/bin/i586-pokymllib32-linux-gcc
+
+ Program received signal SIGSEGV, Segmentation fault.
+ 0xf7e957e0 in free () from /lib/i386-linux-gnu/libc.so.6
+ (gdb) bt
+ #0 0xf7e957e0 in free () from /lib/i386-linux-gnu/libc.so.6
+ #1 0x0804b73c in set_multilib_dir () at gcc-4.9.0/gcc/gcc.c:7827
+ #2 main (argc=1, argv=0xffffd504) at gcc-4.9.0/gcc/gcc.c:6688
+ (gdb)
+
+The problem arises because we conditionally assign the pointer we
+eventually free, and the conditional may assign the pointer to the
+non-malloc'd internal string "." which fails when we free it here:
+
+ if (multilib_dir == NULL && multilib_os_dir != NULL
+ && strcmp (multilib_os_dir, ".") == 0)
+ {
+ free (CONST_CAST (char *, multilib_os_dir));
+ ...
+
+As suggested by Jakub, ensure the "." case is also malloc'd via
+xstrdup() and hence the pointer for the "." case can be freed.
+
+Cc: Jakub Jelinek <jakub@redhat.com>
+Cc: Jeff Law <law@redhat.com>
+Cc: Matthias Klose <doko@ubuntu.com>
+CC: Tobias Burnus <burnus@net-b.de>
+Upstream-Status: Accepted [ https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02069.html ]
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 9ac18e60d801..168acf7eb0c9 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -7790,10 +7790,15 @@ set_multilib_dir (void)
+ q2++;
+ if (*q2 == ':')
+ ml_end = q2;
+- new_multilib_os_dir = XNEWVEC (char, ml_end - q);
+- memcpy (new_multilib_os_dir, q + 1, ml_end - q - 1);
+- new_multilib_os_dir[ml_end - q - 1] = '\0';
+- multilib_os_dir = *new_multilib_os_dir ? new_multilib_os_dir : ".";
++ if (ml_end - q == 1)
++ multilib_os_dir = xstrdup (".");
++ else
++ {
++ new_multilib_os_dir = XNEWVEC (char, ml_end - q);
++ memcpy (new_multilib_os_dir, q + 1, ml_end - q - 1);
++ new_multilib_os_dir[ml_end - q - 1] = '\0';
++ multilib_os_dir = new_multilib_os_dir;
++ }
+
+ if (q2 < end && *q2 == ':')
+ {
+--
+1.9.2
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch b/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
new file mode 100644
index 0000000000..4c98ca273a
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
@@ -0,0 +1,61 @@
+gcc/Makefile.in: fix parallel building failure
+
+The gcc-ar.o, gcc-nm.o, gcc-ranlib.o and errors.o included
+config.h which was a generated file. But no explicity rule
+to clarify the dependency. There was potential building
+failure while parallel make.
+
+For gcc-ar.o, gcc-nm.o and gcc-ranlib.o, they were compiled from one C
+source file gcc-ar.c, we add them to ALL_HOST_BACKEND_OBJS, so the
+'$(ALL_HOST_OBJS) : | $(generated_files)' rule could work for these
+objects.
+
+For errors.o, it is part of gengtype, and the gengtype generator program
+is special: Two versions are built. One is for the build machine, and one
+is for the host. We refered what gengtype-parse.o did (which also is part
+of gengtype).
+
+[GCC #61899]
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61899
+
+Upstream-Status: Send to gcc-patches@gcc.gnu.org mailing list
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/Makefile.in | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 6475cba..56e50bb 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -1481,13 +1481,16 @@ OBJS-libcommon-target = $(common_out_object_file) prefix.o params.o \
+ opts.o opts-common.o options.o vec.o hooks.o common/common-targhooks.o \
+ hash-table.o file-find.o
+
++# Objects compiled from one C source file gcc-ar.c
++OBJS-gcc-ar = gcc-ar.o gcc-nm.o gcc-ranlib.o
++
+ # This lists all host objects for the front ends.
+ ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS))
+
+ ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \
+ $(OBJS-libcommon-target) @TREEBROWSER@ main.o c-family/cppspec.o \
+ $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) \
+- lto-wrapper.o
++ lto-wrapper.o $(OBJS-gcc-ar)
+
+ # This lists all host object files, whether they are included in this
+ # compilation or not.
+@@ -2437,6 +2440,8 @@ gengtype-parse.o: $(CONFIG_H)
+ CFLAGS-build/gengtype-parse.o += -DGENERATOR_FILE
+ build/gengtype-parse.o: $(BCONFIG_H)
+
++errors.o : $(CONFIG_H)
++
+ gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
+ gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
+ $(XREGEX_H)
+--
+1.8.1.2
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0055-dwarf-reg-processing-helper.patch b/meta/recipes-devtools/gcc/gcc-4.9/0055-dwarf-reg-processing-helper.patch
new file mode 100644
index 0000000000..557dab0f31
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0055-dwarf-reg-processing-helper.patch
@@ -0,0 +1,148 @@
+From 4fd39f1329379e00f958394adde6be96f0caf21f Mon Sep 17 00:00:00 2001
+From: hainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 5 Dec 2014 16:53:22 +0000
+Subject: [PATCH] 2014-12-05 Olivier Hainque <hainque@adacore.com>
+
+ * dwarf2cfi.c (init_one_dwarf_reg_size): New helper, processing
+ one particular reg for expand_builtin_init_dwarf_reg_sizes.
+ (expand_builtin_init_dwarf_reg_sizes): Rework to use helper and
+ account for dwarf register spans.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218428 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [gcc 5.0]
+
+---
+ gcc/ChangeLog | 7 +++++
+ gcc/dwarf2cfi.c | 98 +++++++++++++++++++++++++++++++++++++++++++++------------
+ 2 files changed, 85 insertions(+), 20 deletions(-)
+
+Index: gcc-4.9.2/gcc/dwarf2cfi.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/dwarf2cfi.c
++++ gcc-4.9.2/gcc/dwarf2cfi.c
+@@ -252,7 +252,59 @@ init_return_column_size (enum machine_mo
+ gen_int_mode (size, mode));
+ }
+
+-/* Generate code to initialize the register size table. */
++/* Datastructure used by expand_builtin_init_dwarf_reg_sizes and
++ init_one_dwarf_reg_size to communicate on what has been done by the
++ latter. */
++
++typedef struct
++{
++ /* Whether the dwarf return column was initialized. */
++ bool wrote_return_column;
++
++ /* For each hard register REGNO, whether init_one_dwarf_reg_size
++ was given REGNO to process already. */
++ bool processed_regno [FIRST_PSEUDO_REGISTER];
++
++} init_one_dwarf_reg_state;
++
++/* Helper for expand_builtin_init_dwarf_reg_sizes. Generate code to
++ initialize the dwarf register size table entry corresponding to register
++ REGNO in REGMODE. TABLE is the table base address, SLOTMODE is the mode to
++ use for the size entry to initialize, and INIT_STATE is the communication
++ datastructure conveying what we're doing to our caller. */
++
++static
++void init_one_dwarf_reg_size (int regno, machine_mode regmode,
++ rtx table, machine_mode slotmode,
++ init_one_dwarf_reg_state *init_state)
++{
++ const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
++ const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
++
++ const HOST_WIDE_INT slotoffset = rnum * GET_MODE_SIZE (slotmode);
++ const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
++
++ init_state->processed_regno[regno] = true;
++
++ if (rnum >= DWARF_FRAME_REGISTERS)
++ return;
++
++ if (dnum == DWARF_FRAME_RETURN_COLUMN)
++ {
++ if (regmode == VOIDmode)
++ return;
++ init_state->wrote_return_column = true;
++ }
++
++ if (slotoffset < 0)
++ return;
++
++ emit_move_insn (adjust_address (table, slotmode, slotoffset),
++ gen_int_mode (regsize, slotmode));
++}
++
++/* Generate code to initialize the dwarf register size table located
++ at the provided ADDRESS. */
+
+ void
+ expand_builtin_init_dwarf_reg_sizes (tree address)
+@@ -261,35 +313,40 @@ expand_builtin_init_dwarf_reg_sizes (tre
+ enum machine_mode mode = TYPE_MODE (char_type_node);
+ rtx addr = expand_normal (address);
+ rtx mem = gen_rtx_MEM (BLKmode, addr);
+- bool wrote_return_column = false;
++
++ init_one_dwarf_reg_state init_state;
++
++ memset ((char *)&init_state, 0, sizeof (init_state));
+
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+- unsigned int dnum = DWARF_FRAME_REGNUM (i);
+- unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
+-
+- if (rnum < DWARF_FRAME_REGISTERS)
+- {
+- HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
+- HOST_WIDE_INT size;
+- enum machine_mode save_mode = targetm.dwarf_frame_reg_mode (i);
++ machine_mode save_mode;
++ rtx span;
+
+- if (dnum == DWARF_FRAME_RETURN_COLUMN)
++ /* No point in processing a register multiple times. This could happen
++ with register spans, e.g. when a reg is first processed as a piece of
++ a span, then as a register on its own later on. */
++
++ if (init_state.processed_regno[i])
++ continue;
++
++ save_mode = targetm.dwarf_frame_reg_mode (i);
++ span = targetm.dwarf_register_span (gen_rtx_REG (save_mode, i));
++ if (!span)
++ init_one_dwarf_reg_size (i, save_mode, mem, mode, &init_state);
++ else
++ {
++ for (int si = 0; si < XVECLEN (span, 0); si++)
+ {
+- if (save_mode == VOIDmode)
+- continue;
+- wrote_return_column = true;
+- }
+- size = GET_MODE_SIZE (save_mode);
+- if (offset < 0)
+- continue;
++ rtx reg = XVECEXP (span, 0, si);
++ init_one_dwarf_reg_size
++ (REGNO (reg), GET_MODE (reg), mem, mode, &init_state);
++ }
+
+- emit_move_insn (adjust_address (mem, mode, offset),
+- gen_int_mode (size, mode));
+ }
+ }
+
+- if (!wrote_return_column)
++ if (!init_state.wrote_return_column)
+ init_return_column_size (mode, mem, DWARF_FRAME_RETURN_COLUMN);
+
+ #ifdef DWARF_ALT_FRAME_RETURN_COLUMN
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0056-define-default-cfa-register-mapping.patch b/meta/recipes-devtools/gcc/gcc-4.9/0056-define-default-cfa-register-mapping.patch
new file mode 100644
index 0000000000..3b6c94c492
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0056-define-default-cfa-register-mapping.patch
@@ -0,0 +1,75 @@
+From c0235a33de8c4f78cce35b2a8c2035c83fe1bd14 Mon Sep 17 00:00:00 2001
+From: hainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 5 Dec 2014 17:01:42 +0000
+Subject: [PATCH] 2014-12-05 Olivier Hainque <hainque@adacore.com>
+
+ gcc/
+ * defaults.h: (DWARF_REG_TO_UNWIND_COLUMN): Define default.
+ * dwarf2cfi.c (init_one_dwarf_reg_size): Honor
+ DWARF_REG_TO_UNWIND_COLUMN.
+
+ libgcc/
+ * unwind-dw2.c (DWARF_REG_TO_UNWIND_COLUMN): Remove default def,
+ now provided by defaults.h.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218429 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [gcc 5.0]
+
+---
+ gcc/ChangeLog | 6 ++++++
+ gcc/defaults.h | 5 +++++
+ gcc/dwarf2cfi.c | 3 ++-
+ libgcc/ChangeLog | 5 +++++
+ libgcc/unwind-dw2.c | 4 ----
+ 5 files changed, 18 insertions(+), 5 deletions(-)
+
+Index: gcc-4.9.2/gcc/defaults.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/defaults.h
++++ gcc-4.9.2/gcc/defaults.h
+@@ -438,6 +438,11 @@ see the files COPYING3 and COPYING.RUNTI
+ #define DWARF_FRAME_REGNUM(REG) DBX_REGISTER_NUMBER (REG)
+ #endif
+
++/* The mapping from dwarf CFA reg number to internal dwarf reg numbers. */
++#ifndef DWARF_REG_TO_UNWIND_COLUMN
++#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
++#endif
++
+ /* Map register numbers held in the call frame info that gcc has
+ collected using DWARF_FRAME_REGNUM to those that should be output in
+ .debug_frame and .eh_frame. */
+Index: gcc-4.9.2/gcc/dwarf2cfi.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/dwarf2cfi.c
++++ gcc-4.9.2/gcc/dwarf2cfi.c
+@@ -280,8 +280,9 @@ void init_one_dwarf_reg_size (int regno,
+ {
+ const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
+ const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
++ const unsigned int dcol = DWARF_REG_TO_UNWIND_COLUMN (rnum);
+
+- const HOST_WIDE_INT slotoffset = rnum * GET_MODE_SIZE (slotmode);
++ const HOST_WIDE_INT slotoffset = dcol * GET_MODE_SIZE (slotmode);
+ const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
+
+ init_state->processed_regno[regno] = true;
+Index: gcc-4.9.2/libgcc/unwind-dw2.c
+===================================================================
+--- gcc-4.9.2.orig/libgcc/unwind-dw2.c
++++ gcc-4.9.2/libgcc/unwind-dw2.c
+@@ -55,10 +55,6 @@
+ #define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS
+ #endif
+
+-#ifndef DWARF_REG_TO_UNWIND_COLUMN
+-#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
+-#endif
+-
+ /* ??? For the public function interfaces, we tend to gcc_assert that the
+ column numbers are in range. For the dwarf2 unwind info this does happen,
+ although so far in a case that doesn't actually matter.
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0057-aarch64-config.patch b/meta/recipes-devtools/gcc/gcc-4.9/0057-aarch64-config.patch
new file mode 100644
index 0000000000..f29559698a
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0057-aarch64-config.patch
@@ -0,0 +1,32 @@
+Disable the MULTILIB_OSDIRNAMES and other multilib options.
+
+Hard coding the MULTILIB_OSDIRNAMES with ../lib64 is causing problems on
+systems where the libdir is NOT set to /lib64. This is allowed by the ABI, as
+long as the dynamic loader is present in /lib.
+
+We simply want to use the default rules in gcc to find and configure the
+normal libdir.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: gcc-4.9.1/gcc/config/aarch64/t-aarch64-linux
+===================================================================
+--- gcc-4.9.1.orig/gcc/config/aarch64/t-aarch64-linux
++++ gcc-4.9.1/gcc/config/aarch64/t-aarch64-linux
+@@ -21,11 +21,11 @@
+ LIB1ASMSRC = aarch64/lib1funcs.asm
+ LIB1ASMFUNCS = _aarch64_sync_cache_range
+
+-AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
+-MULTILIB_OSDIRNAMES = .=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
+-MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
++#AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
++#MULTILIB_OSDIRNAMES = .=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
++#MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
+
+ # Disable the multilib for linux-gnu targets for the time being; focus
+ # on the baremetal targets.
+-MULTILIB_OPTIONS =
+-MULTILIB_DIRNAMES =
++#MULTILIB_OPTIONS =
++#MULTILIB_DIRNAMES =
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch b/meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch
new file mode 100644
index 0000000000..4b312d4fa9
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch
@@ -0,0 +1,113 @@
+From ca03cf1b133d66eb978c68f6dbc345e9aabcba88 Mon Sep 17 00:00:00 2001
+From: uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Mon, 30 Jun 2014 19:30:52 +0000
+Subject: [PATCH] r212171
+
+* except.c (emit_note_eh_region_end): New helper
+ function. (convert_to_eh_region_ranges): Use
+ emit_note_eh_region_end to emit EH_REGION_END note.
+ * jump.c (cleanup_barriers): Do not split a call and its
+ corresponding CALL_ARG_LOCATION note.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212171 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-status: Backport [https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=212171]
+Signed-off-by: Baoshan Pang <baoshan.pang@windriver.com>
+---
+ gcc/except.c | 23 ++++++++++++++++++-----
+ gcc/jump.c | 19 +++++++++++++++----
+ 2 files changed, 33 insertions(+), 9 deletions(-)
+
+diff --git a/gcc/except.c b/gcc/except.c
+index dc5c1d2..7ac114f 100644
+--- a/gcc/except.c
++++ b/gcc/except.c
+@@ -2466,6 +2466,20 @@ add_call_site (rtx landing_pad, int action, int section)
+ return call_site_base + crtl->eh.call_site_record_v[section]->length () - 1;
+ }
+
++static rtx
++emit_note_eh_region_end (rtx insn)
++{
++ rtx next = NEXT_INSN (insn);
++
++ /* Make sure we do not split a call and its corresponding
++ CALL_ARG_LOCATION note. */
++ if (next && NOTE_P (next)
++ && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
++ insn = next;
++
++ return emit_note_after (NOTE_INSN_EH_REGION_END, insn);
++}
++
+ /* Turn REG_EH_REGION notes back into NOTE_INSN_EH_REGION notes.
+ The new note numbers will not refer to region numbers, but
+ instead to call site entries. */
+@@ -2544,8 +2558,8 @@ convert_to_eh_region_ranges (void)
+ note = emit_note_before (NOTE_INSN_EH_REGION_BEG,
+ first_no_action_insn_before_switch);
+ NOTE_EH_HANDLER (note) = call_site;
+- note = emit_note_after (NOTE_INSN_EH_REGION_END,
+- last_no_action_insn_before_switch);
++ note
++ = emit_note_eh_region_end (last_no_action_insn_before_switch);
+ NOTE_EH_HANDLER (note) = call_site;
+ gcc_assert (last_action != -3
+ || (last_action_insn
+@@ -2569,8 +2583,7 @@ convert_to_eh_region_ranges (void)
+ first_no_action_insn = NULL_RTX;
+ }
+
+- note = emit_note_after (NOTE_INSN_EH_REGION_END,
+- last_action_insn);
++ note = emit_note_eh_region_end (last_action_insn);
+ NOTE_EH_HANDLER (note) = call_site;
+ }
+
+@@ -2617,7 +2630,7 @@ convert_to_eh_region_ranges (void)
+
+ if (last_action >= -1 && ! first_no_action_insn)
+ {
+- note = emit_note_after (NOTE_INSN_EH_REGION_END, last_action_insn);
++ note = emit_note_eh_region_end (last_action_insn);
+ NOTE_EH_HANDLER (note) = call_site;
+ }
+
+diff --git a/gcc/jump.c b/gcc/jump.c
+index 9418f65..a5e5f52 100644
+--- a/gcc/jump.c
++++ b/gcc/jump.c
+@@ -121,15 +121,26 @@ rebuild_jump_labels_chain (rtx chain)
+ static unsigned int
+ cleanup_barriers (void)
+ {
+- rtx insn, next, prev;
+- for (insn = get_insns (); insn; insn = next)
++ rtx insn;
++ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ {
+- next = NEXT_INSN (insn);
+ if (BARRIER_P (insn))
+ {
+- prev = prev_nonnote_insn (insn);
++ rtx prev = prev_nonnote_insn (insn);
+ if (!prev)
+ continue;
++
++ if (CALL_P (prev))
++ {
++ /* Make sure we do not split a call and its corresponding
++ CALL_ARG_LOCATION note. */
++ rtx next = NEXT_INSN (prev);
++
++ if (NOTE_P (next)
++ && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
++ prev = next;
++ }
++
+ if (BARRIER_P (prev))
+ delete_insn (insn);
+ else if (prev != PREV_INSN (insn))
+--
+1.7.9.5
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch b/meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch
new file mode 100644
index 0000000000..6d24aa4572
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch
@@ -0,0 +1,59 @@
+From 6eae3e637fcc22d21b51d44d61e3a9cb4825e776 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Thu, 30 Oct 2014 20:37:14 -0700
+Subject: [PATCH]PR rtl-optimization/63348
+
+PR rtl-optimization/63348
+* emit-rtl.c (try_split): Do not emit extra barrier.
+
+Note: this patch is to fix the side effect introduced by r212171 which was reported at:
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63348
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215613 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-status: Backport [https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=215613]
+Signed-off-by: Baoshan Pang <baoshan.pang@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ gcc/emit-rtl.c | 11 -----------
+ 1 files changed, 0 insertions(+), 11 deletions(-)
+
+diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
+index 4736f8d..ae69dbd 100644
+--- a/gcc/emit-rtl.c
++++ b/gcc/emit-rtl.c
+@@ -3422,7 +3422,6 @@ try_split (rtx pat, rtx trial, int last)
+ {
+ rtx before = PREV_INSN (trial);
+ rtx after = NEXT_INSN (trial);
+- int has_barrier = 0;
+ rtx note, seq, tem;
+ int probability;
+ rtx insn_last, insn;
+@@ -3441,14 +3440,6 @@ try_split (rtx pat, rtx trial, int last)
+
+ split_branch_probability = -1;
+
+- /* If we are splitting a JUMP_INSN, it might be followed by a BARRIER.
+- We may need to handle this specially. */
+- if (after && BARRIER_P (after))
+- {
+- has_barrier = 1;
+- after = NEXT_INSN (after);
+- }
+-
+ if (!seq)
+ return trial;
+
+@@ -3594,8 +3585,6 @@ try_split (rtx pat, rtx trial, int last)
+ tem = emit_insn_after_setloc (seq, trial, INSN_LOCATION (trial));
+
+ delete_insn (trial);
+- if (has_barrier)
+- emit_barrier_after (tem);
+
+ /* Recursively call try_split for each new insn created; by the
+ time control returns here that insn will be fully split, so
+--
+1.7.1
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
new file mode 100644
index 0000000000..75a9fdd441
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
@@ -0,0 +1,55 @@
+From 5c0092070253113cf0d9c45eacc884b3ecc34d81 Mon Sep 17 00:00:00 2001
+From: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Sat, 25 Oct 2014 00:23:17 +0000
+Subject: [PATCH] Only allow e500 double in SPE_SIMD_REGNO_P registers.
+
+rs6000_hard_regno_nregs_internal allows SPE vectors in single
+registers satisfying SPE_SIMD_REGNO_P (i.e. register numbers 0 to
+31). However, the corresponding test for e500 double treats all
+registers as being able to store a 64-bit value, rather than just
+those GPRs.
+
+Logically this inconsistency is wrong; in addition, it causes problems
+unwinding from signal handlers. linux-unwind.h uses
+ARG_POINTER_REGNUM as a place to store the return address from a
+signal handler, but this logic in rs6000_hard_regno_nregs_internal
+results in that being considered an 8-byte register, resulting in
+assertion failures.
+(<https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02625.html> first
+needs to be applied for unwinding to work in general on e500.) This
+patch makes rs6000_hard_regno_nregs_internal handle the e500 double
+case consistently with SPE vectors.
+
+Tested with no regressions with cross to powerpc-linux-gnuspe (given
+the aforementioned patch applied). Failures of signal handling
+unwinding tests such as gcc.dg/cleanup-{8,9,10,11}.c are fixed by this
+patch.
+
+ * config/rs6000/rs6000.c (rs6000_hard_regno_nregs_internal): Do
+ not allow e500 double in registers not satisyfing
+ SPE_SIMD_REGNO_P.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216688 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [gcc 5.0]
+
+---
+ gcc/ChangeLog | 6 ++++++
+ gcc/config/rs6000/rs6000.c | 2 +-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+Index: gcc-4.9.2/gcc/config/rs6000/rs6000.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/rs6000/rs6000.c
++++ gcc-4.9.2/gcc/config/rs6000/rs6000.c
+@@ -1703,7 +1703,7 @@ rs6000_hard_regno_nregs_internal (int re
+ SCmode so as to pass the value correctly in a pair of
+ registers. */
+ else if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode != SCmode
+- && !DECIMAL_FLOAT_MODE_P (mode))
++ && !DECIMAL_FLOAT_MODE_P (mode) && SPE_SIMD_REGNO_P (regno))
+ reg_size = UNITS_PER_FP_WORD;
+
+ else
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0061-target-gcc-includedir.patch b/meta/recipes-devtools/gcc/gcc-4.9/0061-target-gcc-includedir.patch
new file mode 100644
index 0000000000..f48c66dcac
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0061-target-gcc-includedir.patch
@@ -0,0 +1,81 @@
+Ensure target gcc headers can be included
+
+There are a few headers installed as part of the OpenEmbedded
+gcc-runtime target (omp.h, ssp/*.h). Being installed from a recipe
+built for the target architecture, these are within the target
+sysroot and not cross/nativesdk; thus they weren't able to be
+found by gcc with the existing search paths. Add support for
+picking up these headers under the sysroot supplied on the gcc
+command line in order to resolve this.
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Upstream-Status: Pending
+
+--- a/gcc/Makefile.in 2014-12-23 11:57:33.327873331 +0000
++++ b/gcc/Makefile.in 2015-01-21 11:32:35.447305394 +0000
+@@ -587,6 +587,7 @@
+
+ # Directory in which the compiler finds libraries etc.
+ libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version)
++libsubdir_target = gcc/$(target_noncanonical)/$(version)
+ # Directory in which the compiler finds executables
+ libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(version)
+ # Directory in which all plugin resources are installed
+@@ -2534,6 +2535,7 @@
+
+ PREPROCESSOR_DEFINES = \
+ -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
++ -DGCC_INCLUDE_SUBDIR_TARGET=\"$(libsubdir_target)/include\" \
+ -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \
+ -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
+ -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \
+--- a/gcc/cppdefault.c 2015-01-13 17:40:26.131012725 +0000
++++ b/gcc/cppdefault.c 2015-01-21 11:30:08.928426492 +0000
+@@ -59,6 +59,10 @@
+ /* This is the dir for gcc's private headers. */
+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
+ #endif
++#ifdef GCC_INCLUDE_SUBDIR_TARGET
++ /* This is the dir for gcc's private headers under the specified sysroot. */
++ { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 },
++#endif
+ #ifdef LOCAL_INCLUDE_DIR
+ /* /usr/local/include comes before the fixincluded header files. */
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
+diff --git a/gcc/defaults.h b/gcc/defaults.h
+index f94ae17..d98b40b 100644
+--- a/gcc/defaults.h
++++ b/gcc/defaults.h
+@@ -1390,4 +1390,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+
+ #endif /* GCC_INSN_FLAGS_H */
+
++/* Default prefixes to attach to command names. */
++
++#ifndef STANDARD_STARTFILE_PREFIX_1
++#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
++#endif
++#ifndef STANDARD_STARTFILE_PREFIX_2
++#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
++#endif
++
+ #endif /* ! GCC_DEFAULTS_H */
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 9f0b781..174fca8 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1189,13 +1189,6 @@ static const char *gcc_libexec_prefix;
+
+ /* Default prefixes to attach to command names. */
+
+-#ifndef STANDARD_STARTFILE_PREFIX_1
+-#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+-#endif
+-#ifndef STANDARD_STARTFILE_PREFIX_2
+-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
+-#endif
+-
+ #ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */
+ #undef MD_EXEC_PREFIX
+ #undef MD_STARTFILE_PREFIX
diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc
index 66a18d9749..04c701a974 100644
--- a/meta/recipes-devtools/gcc/gcc-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-common.inc
@@ -9,7 +9,7 @@ inherit autotools gettext texinfo
BPN = "gcc"
-def get_gcc_fpu_setting(bb, d):
+def get_gcc_float_setting(bb, d):
if d.getVar('ARMPKGSFX_EABI', True) == "hf" and d.getVar('TRANSLATED_TARGET_ARCH', True) == "arm":
return "--with-float=hard"
if d.getVar('TARGET_FPU', True) in [ 'soft' ]:
@@ -18,13 +18,18 @@ def get_gcc_fpu_setting(bb, d):
return "--enable-e500_double"
return ""
-get_gcc_fpu_setting[vardepvalue] = "${@get_gcc_fpu_setting(bb, d)}"
+get_gcc_float_setting[vardepvalue] = "${@get_gcc_float_setting(bb, d)}"
def get_gcc_mips_plt_setting(bb, d):
if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'mips', 'mipsel' ] and bb.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d):
return "--with-mips-plt"
return ""
+def get_long_double_setting(bb, d):
+ if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'powerpc', 'powerpc64' ] and d.getVar('TCLIBC', True) in [ 'uclibc', 'glibc' ]:
+ return "--with-long-double-128"
+ return ""
+
def get_gcc_multiarch_setting(bb, d):
target_arch = d.getVar('TRANSLATED_TARGET_ARCH', True)
multiarch_options = {
@@ -74,7 +79,6 @@ ${GNU_MIRROR}/gcc http://mirrors.rcn.net/pub/sourceware/gcc/releases/ \n \
${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \
${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \
"
-
#
# Set some default values
#
@@ -84,48 +88,12 @@ BINV = "${PV}"
S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
-# SS means Shared Stamps directory
-SS = "${TMPDIR}/stamps/work-shared/gcc-${PV}-${PR}"
-do_fetch[stamp-base] = "${SS}"
-do_unpack[stamp-base] = "${SS}"
-do_patch[stamp-base] = "${SS}"
-do_preconfigure[stamp-base] = "${SS}"
-SSCLEAN = "${TMPDIR}/stamps/work-shared/gcc-[0-9]*-*"
-do_fetch[stamp-base-clean] = "${SSCLEAN}"
-do_unpack[stamp-base-clean] = "${SSCLEAN}"
-do_unpack[umask] = "022"
-do_patch[stamp-base-clean] = "${SSCLEAN}"
-do_preconfigure[stamp-base-clean] = "${SSCLEAN}"
-
-# SW means Shared Work directory
-SW = "${TMPDIR}/work-shared/gcc-${PV}-${PR}"
-SSTATE_SWSPEC = "sstate:gcc::${PV}:${PR}::${SSTATE_VERSION}:"
-WORKDIR_task-unpack = "${SW}"
-WORKDIR_task-patch = "${SW}"
-WORKDIR_task-preconfigure = "${SW}"
-
target_includedir ?= "${includedir}"
target_libdir ?= "${libdir}"
target_base_libdir ?= "${base_libdir}"
target_prefix ?= "${prefix}"
-CLEANFUNCS += "workshared_clean"
-# The do_clean should be exclusive since share ${S}
-do_clean[lockfiles] = "${SW}.clean.lock"
-
-python workshared_clean () {
- """clear the source directory"""
- dir = d.expand("${SW}")
- bb.note("Removing " + dir)
- oe.path.remove(dir)
-
- """clear the the stamps in work-shared"""
- dir = "%s.*" % bb.data.expand(d.getVarFlag('do_fetch', 'stamp-base', True), d)
- bb.note("Removing " + dir)
- oe.path.remove(dir)
-}
-
-# We need to ensure that for the shared work directory, the do_patch singatures match
+# We need to ensure that for the shared work directory, the do_patch signatures match
# The real WORKDIR location isn't a dependency for the shared workdir.
src_patches[vardepsexclude] = "WORKDIR"
should_apply[vardepsexclude] += "PN"
diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc
index 75fb379956..6c60cf97f6 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -1,4 +1,5 @@
require gcc-multilib-config.inc
+require gcc-shared-source.inc
#
# Build the list of lanaguages to build.
#
@@ -29,45 +30,52 @@ EXTRA_OECONF_INTERMEDIATE ?= ""
GCCMULTILIB ?= "--disable-multilib"
GCCTHREADS ?= "posix"
-EXTRA_OECONF = "${@['--enable-clocale=generic', ''][d.getVar('USE_NLS', True) != 'no']} \
- --with-gnu-ld \
- --enable-shared \
- --enable-languages=${LANGUAGES} \
- --enable-threads=${GCCTHREADS} \
- ${GCCMULTILIB} \
- --enable-c99 \
- --enable-long-long \
- --enable-symvers=gnu \
- --enable-libstdcxx-pch \
- --program-prefix=${TARGET_PREFIX} \
- --without-local-prefix \
- ${OPTSPACE} \
- ${EXTRA_OECONF_BASE} \
- ${EXTRA_OECONF_FPU} \
- ${EXTRA_OECONF_PATHS} \
- ${@get_gcc_mips_plt_setting(bb, d)} \
- ${@get_gcc_multiarch_setting(bb, d)}"
-
-export ac_cv_path_SED = 'sed'
+EXTRA_OECONF = "\
+ ${@['--enable-clocale=generic', ''][d.getVar('USE_NLS', True) != 'no']} \
+ --with-gnu-ld \
+ --enable-shared \
+ --enable-languages=${LANGUAGES} \
+ --enable-threads=${GCCTHREADS} \
+ ${GCCMULTILIB} \
+ --enable-c99 \
+ --enable-long-long \
+ --enable-symvers=gnu \
+ --enable-libstdcxx-pch \
+ --program-prefix=${TARGET_PREFIX} \
+ --without-local-prefix \
+ ${OPTSPACE} \
+ ${EXTRA_OECONF_BASE} \
+ ${EXTRA_OECONF_GCC_FLOAT} \
+ ${EXTRA_OECONF_PATHS} \
+ ${@get_gcc_mips_plt_setting(bb, d)} \
+ ${@get_long_double_setting(bb, d)} \
+ ${@get_gcc_multiarch_setting(bb, d)} \
+"
+
export gcc_cv_collect2_libs = 'none required'
# We need to set gcc_cv_collect2_libs else there is cross-compilation badness
# in the config.log files (which might not get generated until do_compile
# hence being missed by the insane do_configure check).
# Build uclibc compilers without cxa_atexit support
-EXTRA_OECONF_append_linux = " --enable-__cxa_atexit"
-EXTRA_OECONF_append_libc-uclibc = " --enable-__cxa_atexit"
-
-EXTRA_OECONF_append_mips64 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
-EXTRA_OECONF_append_mips64el = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
-
-EXTRA_OECONF_FPU ??= ""
+EXTRA_OECONF_append_linux = " --enable-__cxa_atexit"
+EXTRA_OECONF_append_libc-uclibc = " --enable-__cxa_atexit"
+
+EXTRA_OECONF_append_mips64 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+EXTRA_OECONF_append_mips64el = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+EXTRA_OECONF_append_mips64n32 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+EXTRA_OECONF_append_mips64eln32 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+
+# ARMv6+ adds atomic instructions that affect the ABI in libraries built
+# with TUNE_CCARGS in gcc-runtime. Make the compiler default to a
+# compatible architecture. armv6 and armv7a cover the minimum tune
+# features used in OE.
+EXTRA_OECONF_append_armv6 = " --with-arch=armv6"
+EXTRA_OECONF_append_armv7a = " --with-arch=armv7-a"
+
+EXTRA_OECONF_GCC_FLOAT ??= ""
CPPFLAGS = ""
-# powerpc needs this to comply with the ABI
-EXTRA_OECONF_append_powerpc = " --with-long-double-128"
-EXTRA_OECONF_append_powerpc64 = " --with-long-double-128"
-
SYSTEMHEADERS = "${target_includedir}"
SYSTEMLIBS = "${target_base_libdir}/"
SYSTEMLIBS1 = "${target_libdir}/"
@@ -87,16 +95,6 @@ _EOF
mv ${B}/gcc/defaults.h.new ${B}/gcc/defaults.h
}
-python do_preconfigure () {
- import subprocess
- cmd = d.expand('PATH=${PATH} cd ${S} && gnu-configize')
- subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
- # See 0044-gengtypes.patch, we need to regenerate this file
- bb.utils.remove(d.expand("${S}/gcc/gengtype-lex.c"))
-}
-addtask do_preconfigure after do_patch before do_configure
-do_preconfigure[depends] += "gnu-config-native:do_populate_sysroot autoconf-native:do_populate_sysroot"
-
do_configure () {
# Setup these vars for cross building only
# ... because foo_FOR_TARGET apparently gets misinterpreted inside the
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
index 307f73c8ed..0f79533771 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
@@ -9,15 +9,17 @@ GCCMULTILIB = "--enable-multilib"
require gcc-configure-common.inc
-EXTRA_OECONF_PATHS = "--with-gxx-include-dir=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}${target_includedir}/c++ \
- --with-build-time-tools=${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/bin \
- --with-sysroot=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS} \
- --with-build-sysroot=${STAGING_DIR_TARGET}"
+EXTRA_OECONF_PATHS = "\
+ --with-gxx-include-dir=/not/exist${target_includedir}/c++/${BINV} \
+ --with-build-time-tools=${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/bin \
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
# We have to point gcc at a sysroot but we don't need to rebuild if this changes
# e.g. we switch between different machines with different tunes.
EXTRA_OECONF_PATHS[vardepsexclude] = "TUNE_PKGARCH"
TARGET_ARCH[vardepsexclude] = "TUNE_ARCH"
-get_gcc_fpu_setting[vardepvalue] = ""
+get_gcc_float_setting[vardepvalue] = ""
#
# gcc-cross looks and finds these in ${exec_prefix} but we're not so lucky
@@ -53,12 +55,11 @@ do_configure () {
export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}"
export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
- (cd ${S} && gnu-configize) || die "failure running gnu-configize"
oe_runconf
}
do_compile () {
- oe_runmake all-host
+ oe_runmake all-host configure-target-libgcc
}
INHIBIT_PACKAGE_STRIP = "1"
@@ -82,14 +83,14 @@ FILES_${PN} = "\
${prefix}/${TARGET_SYS}/bin/* \
${prefix}/${TARGET_SYS}/lib/* \
${prefix}/${TARGET_SYS}/usr/include/* \
- "
+"
INSANE_SKIP_${PN} += "dev-so"
FILES_${PN}-doc = "\
${infodir} \
${mandir} \
${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
- "
+"
EXEEXT = ""
@@ -97,6 +98,7 @@ EXEEXT = ""
BINRELPATH = "${@os.path.relpath(d.expand("${bindir}"), d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"))}"
do_install () {
+ ( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h )
oe_runmake 'DESTDIR=${D}' install-host
# Cleanup some of the ${libdir}{,exec}/gcc stuff ...
@@ -137,6 +139,11 @@ do_install () {
ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t$suffix $dest$t$suffix
done
+ # libquadmath headers need to be available in the gcc libexec dir
+ install -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+ cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+ cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+
chown -R root:root ${D}
cross_canadian_bindirlinks
@@ -150,10 +157,12 @@ SYSTEMHEADERS = "/usr/include"
SYSTEMLIBS = "${target_base_libdir}/"
SYSTEMLIBS1 = "${target_libdir}/"
-EXTRA_OECONF += "--disable-libunwind-exceptions --disable-libssp \
- --disable-libgomp --disable-libmudflap \
- --with-mpfr=${STAGING_DIR_HOST}${layout_exec_prefix} \
- --with-mpc=${STAGING_DIR_HOST}${layout_exec_prefix}"
+EXTRA_OECONF += "--enable-poison-system-directories"
+
+EXTRA_OECONF += "\
+ --with-mpfr=${STAGING_DIR_HOST}${layout_exec_prefix} \
+ --with-mpc=${STAGING_DIR_HOST}${layout_exec_prefix} \
+"
# gcc 4.7 needs -isystem
export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}"
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial.inc b/meta/recipes-devtools/gcc/gcc-cross-initial.inc
index 5a6da8bbd2..7197447080 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-initial.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-initial.inc
@@ -11,22 +11,24 @@ CROSS_TARGET_SYS_DIR_append = ".${PN}"
# This is intended to be a -very- basic config
# sysroot is needed in case we use libc-initial
-EXTRA_OECONF = "--with-newlib \
- --without-headers \
- --disable-shared \
- --disable-threads \
- --disable-multilib \
- --disable-__cxa_atexit \
- --enable-languages=c \
- ${OPTSPACE} \
- --program-prefix=${TARGET_PREFIX} \
- --with-sysroot=${STAGING_DIR_TARGET} \
- --with-build-sysroot=${GCCCROSS_BUILDSYSROOT} \
- ${EXTRA_OECONF_INITIAL} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--with-ld=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}ld.bfd', '', d)} \
- ${EXTRA_OECONF_FPU}"
+EXTRA_OECONF = "\
+ --with-newlib \
+ --without-headers \
+ --disable-shared \
+ --disable-threads \
+ --disable-multilib \
+ --disable-__cxa_atexit \
+ --enable-languages=c \
+ ${OPTSPACE} \
+ --program-prefix=${TARGET_PREFIX} \
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${GCCCROSS_BUILDSYSROOT} \
+ ${EXTRA_OECONF_INITIAL} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--with-ld=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}ld.bfd', '', d)} \
+ ${EXTRA_OECONF_GCC_FLOAT} \
+"
-EXTRA_OECONF += " --with-native-system-header-dir=${SYSTEMHEADERS} "
+EXTRA_OECONF += "--with-native-system-header-dir=${SYSTEMHEADERS}"
GCCCROSS_BUILDSYSROOT = "${B}/tmpsysroot"
@@ -57,7 +59,9 @@ do_install () {
# found. These need to be relative paths so they work in different locations.
dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
install -d $dest
- for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
+ useld=${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '.bfd', '', d)}
+ ln -sf ${BINRELPATH}/${TARGET_PREFIX}ld${useld} ${dest}ld
+ for t in ar as nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
done
# fixed limits.h infact includes the so called real limits.h
@@ -66,7 +70,7 @@ do_install () {
# includes real limits.h but this real limits.h is not staged yet
# so we overwirte the generated include-fixed/limits.h for gcc-cross-initial
# to get rid references to real limits.h
- cp gcc/include-fixed/limits.h ${D}${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed/limits.h
+ cp gcc/include-fixed/limits.h ${D}${gcclibdir}/${TARGET_SYS}/${BINV}/include/limits.h
# gcc-runtime installs libgcc into a special location in staging since it breaks doing a standalone build
case ${PN} in
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index 0bf29e34d3..97929501e8 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -13,24 +13,25 @@ PN = "gcc-cross-${TARGET_ARCH}"
require gcc-configure-common.inc
-EXTRA_OECONF += " --enable-poison-system-directories"
-EXTRA_OECONF_append_sh4 = " --with-multilib-list= --enable-incomplete-targets "
-
-EXTRA_OECONF += "--disable-libunwind-exceptions \
- --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \
- --with-system-zlib "
-
-EXTRA_OECONF_PATHS = " \
- --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \
- --with-sysroot=${STAGING_DIR_TARGET} \
- --with-build-sysroot=${STAGING_DIR_TARGET}"
+EXTRA_OECONF += "--enable-poison-system-directories"
+EXTRA_OECONF_append_sh4 = " \
+ --with-multilib-list= \
+ --enable-incomplete-targets \
+"
+
+EXTRA_OECONF += "\
+ --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \
+ --with-system-zlib \
+"
+
+EXTRA_OECONF_PATHS = "\
+ --with-gxx-include-dir=/not/exist${target_includedir}/c++/${BINV} \
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
-do_configure_prepend () {
- sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure
-}
-
do_compile () {
export CC="${BUILD_CC}"
export AR_FOR_TARGET="${TARGET_SYS}-ar"
diff --git a/meta/recipes-devtools/gcc/gcc-multilib-config.inc b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
index 81d664a1b3..61340979ba 100644
--- a/meta/recipes-devtools/gcc/gcc-multilib-config.inc
+++ b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
@@ -14,6 +14,8 @@
# gcc/config/mips/linux64.h
# gcc/config/rs6000/linux64.h
+MULTILIB_OPTION_WHITELIST ??= "-m32 -m64 -mx32 -mabi=n32 -mabi=32 -mabi=64"
+
python gcc_multilib_setup() {
import re
import shutil
@@ -88,8 +90,10 @@ python gcc_multilib_setup() {
substs = [
(r'^(#define\s*GLIBC_DYNAMIC_LINKER32\s*)(\S+)(\s*\".*\")$',
r'\1' + wrap_libdir(libdir32) + r'\3'),
- (r'^(#define\s*GLIBC_DYNAMIC_LINKER64\s*)(\S+)(\s*\".*\")$',
+ (r'^(#define\s*GLIBC_DYNAMIC_LINKER64\s*)(\S+)(\s*\"\S+\")$',
r'\1' + wrap_libdir(libdir64) + r'\3'),
+ (r'^(#define\s*GLIBC_DYNAMIC_LINKER64\s*\"\S+\"\s*)(\S+)(\s*\"\S+\"\s*)(\S+)(\s*\".*\")$',
+ r'\1' + wrap_libdir(libdir64) + r'\3' + wrap_libdir(libdir64) + r'\5'),
(r'^(#define\s*GLIBC_DYNAMIC_LINKERX32\s*)(\S+)(\s*\".*\")$',
r'\1' + wrap_libdir(libdirx32) + r'\3'),
(r'^(#define\s*GLIBC_DYNAMIC_LINKERN32\s*)(\S+)(\s*\".*\")$',
@@ -100,7 +104,7 @@ python gcc_multilib_setup() {
r'\1' + wrap_libdir(libdir64) + r'\3'),
(r'^(#define\s*UCLIBC_DYNAMIC_LINKERN32\s*)(\S+)(\s*\".*\")$',
r'\1' + wrap_libdir(libdirn32) + r'\3'),
- (r'^(#define\s*UCLIBC_DYNAMIC_LINKER\s*)(\S+)(\s*\".*\")$',
+ (r'^(#define\s*UCLIBC_DYNAMIC_LINKER\b\s*)(\S+)(\s*\".*\")$',
r'\1' + wrap_libdir(libdir32) + r'\3'),
]
@@ -148,7 +152,7 @@ python gcc_multilib_setup() {
if mlprefix:
mlindex = 0
for ml in multilibs:
- if mlprefix.startswith(ml):
+ if mlprefix == ml + '-':
break
mlindex += 1
@@ -185,30 +189,19 @@ python gcc_multilib_setup() {
bb.error('Unknown libdir (%s) of the tune : %s' % (tune_baselib, tune))
# take out '-' mcpu='s and march='s from parameters
- options.append(re.sub(r'mcpu=[^ ]+ *', '',
- re.sub(r'march=[^ ]+ *', '',
- re.sub(r' +\-+', ' ',
- re.sub(r'^ *\-+', '', tune_parameters['ccargs'])))))
+ opts = []
+ whitelist = (d.getVar("MULTILIB_OPTION_WHITELIST", True) or "").split()
+ for i in tune_parameters['ccargs'].split():
+ if i in whitelist:
+ opts.append(i)
+ options.append(" ".join(opts))
+
if tune_baselib == 'lib':
dirnames.append('32') # /lib => 32bit lib
else:
dirnames.append(tune_baselib.replace('lib', ''))
osdirnames.append('../' + tune_baselib)
- if len(options) > 1:
- for optstr in options:
- optsets.append(optstr.split())
-
- #get common options present in all the tune parameters
- common_opt_set = set.intersection(*map(set, optsets))
-
- #common options will be added at the end of the options string only once
- if (len(common_opt_set) > 0):
- rex = re.compile(''.join(['\\b(', '|'.join(common_opt_set), ')\\W']), re.I)
- options = [rex.sub("", optstr) for optstr in options]
- options = [optstr.strip() for optstr in options]
- options[len(options)-1] = ' '.join((options[len(options)-1], ' '.join(common_opt_set)))
-
write_config(builddir, target_config_files, options, dirnames, osdirnames)
write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32)
}
diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
index 70f9e0eb52..09757e6ccc 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -2,12 +2,12 @@ require gcc-configure-common.inc
CXXFLAGS := "${@oe_filter_out('-fvisibility-inlines-hidden', '${CXXFLAGS}', d)}"
-EXTRA_OECONF_PATHS = " \
- --with-gxx-include-dir=${includedir}/c++/ \
- --with-sysroot=${STAGING_DIR_TARGET} \
- --with-build-sysroot=${STAGING_DIR_TARGET}"
+EXTRA_OECONF_PATHS = "\
+ --with-gxx-include-dir=${includedir}/c++/${BINV} \
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
-EXTRA_OECONF += "--disable-libunwind-exceptions"
EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic"
@@ -53,6 +53,9 @@ do_install () {
if [ -d ${D}${infodir} ]; then
rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
fi
+ if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
+ ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
+ fi
chown -R root:root ${D}
}
@@ -63,111 +66,129 @@ PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
BBCLASSEXTEND = "nativesdk"
PACKAGES = "\
- ${PN}-dbg \
- libstdc++ \
- libstdc++-precompile-dev \
- libstdc++-dev \
- libstdc++-staticdev \
- libg2c \
- libg2c-dev \
- libssp \
- libssp-dev \
- libssp-staticdev \
- libgfortran \
- libgfortran-dev \
- libgfortran-staticdev \
- libmudflap \
- libmudflap-dev \
- libmudflap-staticdev \
- libquadmath \
- libquadmath-dev \
- libquadmath-staticdev \
- libgomp \
- libgomp-dev \
- libgomp-staticdev \
- libatomic \
- libatomic-dev \
- libatomic-staticdev \
+ ${PN}-dbg \
+ libstdc++ \
+ libstdc++-precompile-dev \
+ libstdc++-dev \
+ libstdc++-staticdev \
+ libg2c \
+ libg2c-dev \
+ libssp \
+ libssp-dev \
+ libssp-staticdev \
+ libmudflap \
+ libmudflap-dev \
+ libmudflap-staticdev \
+ libquadmath \
+ libquadmath-dev \
+ libquadmath-staticdev \
+ libgomp \
+ libgomp-dev \
+ libgomp-staticdev \
+ libatomic \
+ libatomic-dev \
+ libatomic-staticdev \
"
+
+# Most libraries are licensed with the exception, but
+# one library is really GPLv3.
+#
+LICENSE_${PN}-dbg = "GPL-3.0-with-GCC-exception & GPLv3"
+LICENSE_libstdc++ = "GPL-3.0-with-GCC-exception"
+LICENSE_libstdc++-precompile-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_libstdc++-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_libstdc++-staticdev = "GPL-3.0-with-GCC-exception"
+LICENSE_libg2c = "GPL-3.0-with-GCC-exception"
+LICENSE_libg2c-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_libssp = "GPL-3.0-with-GCC-exception"
+LICENSE_libssp-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_libssp-staticdev = "GPL-3.0-with-GCC-exception"
+LICENSE_libgfortran = "GPL-3.0-with-GCC-exception"
+LICENSE_libgfortran-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_libgfortran-staticdev = "GPL-3.0-with-GCC-exception"
+LICENSE_libmudflap = "GPL-3.0-with-GCC-exception"
+LICENSE_libmudflap-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_libmudflap-staticdev = "GPL-3.0-with-GCC-exception"
+LICENSE_libquadmath = "GPL-3.0-with-GCC-exception"
+LICENSE_libquadmath-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_libquadmath-staticdev = "GPL-3.0-with-GCC-exception"
+LICENSE_libatomic = "GPL-3.0-with-GCC-exception"
+LICENSE_libatomic-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_libatomic-staticdev = "GPL-3.0-with-GCC-exception"
+
+LICENSE_libgomp = "GPLv3"
+LICENSE_libgomp-dev = "GPLv3"
+LICENSE_libgomp-staticdev = "GPLv3"
+
# The base package doesn't exist, so we clear the recommends.
RRECOMMENDS_${PN}-dbg = ""
# include python debugging scripts
FILES_${PN}-dbg += "\
- ${libdir}/libstdc++.so.*-gdb.py \
- ${datadir}/gcc-${BINV}/python/libstdcxx"
+ ${libdir}/libstdc++.so.*-gdb.py \
+ ${datadir}/gcc-${BINV}/python/libstdcxx \
+"
FILES_libg2c = "${target_libdir}/libg2c.so.*"
FILES_libg2c-dev = "\
- ${libdir}/libg2c.so \
- ${libdir}/libg2c.a \
- ${libdir}/libfrtbegin.a"
+ ${libdir}/libg2c.so \
+ ${libdir}/libg2c.a \
+ ${libdir}/libfrtbegin.a \
+"
FILES_libstdc++ = "${libdir}/libstdc++.so.*"
FILES_libstdc++-dev = "\
- ${includedir}/c++/ \
- ${libdir}/libstdc++.so \
- ${libdir}/libstdc++.la \
- ${libdir}/libsupc++.la"
+ ${includedir}/c++/ \
+ ${libdir}/libstdc++.so \
+ ${libdir}/libstdc++.la \
+ ${libdir}/libsupc++.la \
+"
FILES_libstdc++-staticdev = "\
- ${libdir}/libstdc++.a \
- ${libdir}/libsupc++.a"
+ ${libdir}/libstdc++.a \
+ ${libdir}/libsupc++.a \
+"
FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
FILES_libssp = "${libdir}/libssp.so.*"
-FILES_libssp-dev = " \
- ${libdir}/libssp*.so \
- ${libdir}/libssp*_nonshared.a \
- ${libdir}/libssp*.la \
- ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp"
-FILES_libssp-staticdev = " \
- ${libdir}/libssp*.a"
-
-FILES_libgfortran = "${libdir}/libgfortran.so.*"
-FILES_libgfortran-dev = " \
- ${libdir}/libgfortran*.so \
- ${libdir}/libgfortran.spec \
- ${libdir}/libgfortran.la \
- ${libdir}/gcc/${TARGET_SYS}/${BINV}/libgfortranbegin.* \
- ${libdir}/gcc/${TARGET_SYS}/${BINV}/libcaf_single*"
-FILES_libgfortran-staticdev = " \
- ${libdir}/libgfortran.a"
-
-INSANE_SKIP_${MLPREFIX}libgfortran-dev = "staticdev"
+FILES_libssp-dev = "\
+ ${libdir}/libssp*.so \
+ ${libdir}/libssp*_nonshared.a \
+ ${libdir}/libssp*.la \
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \
+"
+FILES_libssp-staticdev = "${libdir}/libssp*.a"
FILES_libquadmath = "${libdir}/libquadmath*.so.*"
FILES_libquadmath-dev = "\
- ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \
- ${libdir}/libquadmath*.so \
- ${libdir}/libquadmath.la"
-FILES_libquadmath-staticdev = "\
- ${libdir}/libquadmath.a"
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \
+ ${libdir}/libquadmath*.so \
+ ${libdir}/libquadmath.la \
+"
+FILES_libquadmath-staticdev = "${libdir}/libquadmath.a"
FILES_libmudflap = "${libdir}/libmudflap*.so.*"
FILES_libmudflap-dev = "\
- ${libdir}/libmudflap*.so \
- ${libdir}/libmudflap.la"
-FILES_libmudflap-staticdev = "\
- ${libdir}/libmudflap.a"
+ ${libdir}/libmudflap*.so \
+ ${libdir}/libmudflap.la \
+"
+FILES_libmudflap-staticdev = "${libdir}/libmudflap.a"
FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
FILES_libgomp-dev = "\
- ${libdir}/libgomp*${SOLIBSDEV} \
- ${libdir}/libgomp*.la \
- ${libdir}/libgomp.spec \
- ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
- "
-FILES_libgomp-staticdev = "\
- ${libdir}/libgomp*.a \
- "
+ ${libdir}/libgomp*${SOLIBSDEV} \
+ ${libdir}/libgomp*.la \
+ ${libdir}/libgomp.spec \
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
+"
+FILES_libgomp-staticdev = "${libdir}/libgomp*.a"
FILES_libatomic = "${libdir}/libatomic.so.*"
-FILES_libatomic-dev = " \
- ${libdir}/libatomic.so \
- ${libdir}/libatomic.la"
-FILES_libatomic-staticdev = " \
- ${libdir}/libatomic.a"
+FILES_libatomic-dev = "\
+ ${libdir}/libatomic.so \
+ ${libdir}/libatomic.la \
+"
+FILES_libatomic-staticdev = "${libdir}/libatomic.a"
do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers.inc b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
new file mode 100644
index 0000000000..c987ccb589
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
@@ -0,0 +1,119 @@
+require gcc-configure-common.inc
+
+LICENSE = "NCSA | MIT"
+
+LIC_FILES_CHKSUM = "\
+ file://libsanitizer/LICENSE.TXT;md5=0249c37748936faf5b1efd5789587909 \
+"
+
+EXTRA_OECONF_PATHS = "\
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+
+do_configure () {
+ mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ if [ -d ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ]; then
+ hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B}
+ fi
+
+ echo "Configuring libsanitizer"
+ rm -rf ${B}/$target/libsanitizer/
+ mkdir -p ${B}/$target/libsanitizer/
+ # This is kind of gross, but it's an easy way to make configure happy
+ # without hacking it up to use the system stdc++ instead of the one it
+ # expects to be newly built.
+ rm -rf ${B}/$target/libstdc++-v3/
+ mkdir -p ${B}/$target/libstdc++-v3/src/
+ ln -s ${STAGING_LIBDIR}/libstdc++.la ${B}/$target/libstdc++-v3/src/
+ ln -s ${STAGING_LIBDIR}/libstdc++.so ${B}/$target/libstdc++-v3/src/
+ cd ${B}/$target/libsanitizer/
+ chmod a+x ${S}/libsanitizer/configure
+ ${S}/libsanitizer/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+ # Easiest way to stop bad RPATHs getting into the library since we have a
+ # broken libtool here
+ sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libsanitizer/libtool
+}
+
+do_compile () {
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ cd ${B}/$target/libsanitizer/
+ oe_runmake MULTIBUILDTOP=${B}/$target/libsanitizer/
+}
+
+do_install () {
+ target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+ cd ${B}/$target/libsanitizer/
+ oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/libsanitizer/ install
+ if [ -d ${D}${infodir} ]; then
+ rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
+ fi
+ chown -R root:root ${D}
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
+ALLOW_EMPTY_${PN} = "1"
+DEPENDS = "gcc-runtime"
+
+BBCLASSEXTEND = "nativesdk"
+
+PACKAGES = "${PN}"
+PACKAGES += "libasan libubsan liblsan libtsan"
+PACKAGES += "libasan-dev libubsan-dev liblsan-dev libtsan-dev"
+PACKAGES += "libasan-dbg libubsan-dbg liblsan-dbg libtsan-dbg"
+PACKAGES += "libasan-staticdev libubsan-staticdev liblsan-staticdev libtsan-staticdev"
+
+RDEPENDS_libasan += "libstdc++"
+RDEPENDS_libubsan += "libstdc++"
+RDEPENDS_liblsan += "libstdc++"
+RDEPENDS_libtsan += "libstdc++"
+RDEPENDS_libasan-dev += "${PN}"
+RDEPENDS_libubsan-dev += "${PN}"
+RDEPENDS_liblsan-dev += "${PN}"
+RDEPENDS_libtsan-dev += "${PN}"
+RRECOMMENDS_${PN} += "libasan libubsan"
+RRECOMMENDS_${PN}_append_x86-64 = " liblsan libtsan"
+RRECOMMENDS_${PN}_append_x86 = " liblsan"
+
+do_package_write_ipk[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata"
+do_package_write_deb[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata"
+do_package_write_rpm[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata"
+
+# MIPS, aarch64, and SPARC are broken.
+COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm).*-linux'
+
+FILES_libasan += "${libdir}/libasan.so.*"
+FILES_libasan-dbg += "${libdir}/.debug/libasan.so.*"
+FILES_libasan-dev += "\
+ ${libdir}/libasan_preinit.o \
+ ${libdir}/libasan.so \
+ ${libdir}/libasan.la \
+"
+FILES_libasan-staticdev += "${libdir}/libasan.a"
+
+FILES_libubsan += "${libdir}/libubsan.so.*"
+FILES_libubsan-dbg += "${libdir}/.debug/libubsan.so.*"
+FILES_libubsan-dev += "\
+ ${libdir}/libubsan.so \
+ ${libdir}/libubsan.la \
+"
+FILES_libubsan-staticdev += "${libdir}/libubsan.a"
+
+FILES_liblsan += "${libdir}/liblsan.so.*"
+FILES_liblsan-dbg += "${libdir}/.debug/liblsan.so.*"
+FILES_liblsan-dev += "\
+ ${libdir}/liblsan.so \
+ ${libdir}/liblsan.la \
+"
+FILES_liblsan-staticdev += "${libdir}/liblsan.a"
+
+FILES_libtsan += "${libdir}/libtsan.so.*"
+FILES_libtsan-dbg += "${libdir}/.debug/libtsan.so.*"
+FILES_libtsan-dev += "\
+ ${libdir}/libtsan.so \
+ ${libdir}/libtsan.la \
+"
+FILES_libtsan-staticdev += "${libdir}/libtsan.a"
+
+FILES_${PN} = "${libdir}/*.spec ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/sanitizer/*.h"
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers_4.8.bb b/meta/recipes-devtools/gcc/gcc-sanitizers_4.8.bb
new file mode 100644
index 0000000000..601f666023
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-sanitizers_4.8.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-sanitizers.inc
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb b/meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb
new file mode 100644
index 0000000000..601f666023
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-sanitizers.inc
diff --git a/meta/recipes-devtools/gcc/gcc-shared-source.inc b/meta/recipes-devtools/gcc/gcc-shared-source.inc
new file mode 100644
index 0000000000..cb5d9071b6
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-shared-source.inc
@@ -0,0 +1,9 @@
+do_fetch() {
+ :
+}
+do_fetch[noexec] = "1"
+deltask do_unpack
+deltask do_patch
+
+do_configure[depends] += "gcc-source:do_preconfigure"
+do_populate_lic[depends] += "gcc-source:do_unpack"
diff --git a/meta/recipes-devtools/gcc/gcc-source.inc b/meta/recipes-devtools/gcc/gcc-source.inc
new file mode 100644
index 0000000000..10e9285c44
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-source.inc
@@ -0,0 +1,35 @@
+deltask do_configure
+deltask do_compile
+deltask do_package
+deltask do_package_write_rpm
+deltask do_package_write_ipk
+deltask do_package_write_deb
+deltask do_install
+deltask do_populate_sysroot
+deltask do_populate_lic
+deltask do_package_qa
+deltask do_packagedata
+deltask do_rm_work
+
+WORKDIR = "${TMPDIR}/work-shared/gcc-${PV}-${PR}"
+SSTATE_SWSPEC = "sstate:gcc::${PV}:${PR}::${SSTATE_VERSION}:"
+
+STAMP = "${STAMPS_DIR}/work-shared/gcc-${PV}-${PR}"
+STAMPCLEAN = "${STAMPS_DIR}/work-shared/gcc-[0-9]*-*"
+
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS = ""
+PACKAGES = ""
+
+python do_preconfigure () {
+ import subprocess
+ cmd = d.expand('PATH=${PATH} cd ${S} && gnu-configize')
+ subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ # See 0044-gengtypes.patch, we need to regenerate this file
+ bb.utils.remove(d.expand("${S}/gcc/gengtype-lex.c"))
+ cmd = d.expand("sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure")
+ subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+}
+addtask do_preconfigure after do_patch
+do_preconfigure[depends] += "gnu-config-native:do_populate_sysroot autoconf-native:do_populate_sysroot"
+
diff --git a/meta/recipes-devtools/gcc/gcc-source_4.8.bb b/meta/recipes-devtools/gcc/gcc-source_4.8.bb
new file mode 100644
index 0000000000..234b82efc6
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-source_4.8.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require recipes-devtools/gcc/gcc-source.inc
diff --git a/meta/recipes-devtools/gcc/gcc-source_4.9.bb b/meta/recipes-devtools/gcc/gcc-source_4.9.bb
new file mode 100644
index 0000000000..234b82efc6
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-source_4.9.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require recipes-devtools/gcc/gcc-source.inc
diff --git a/meta/recipes-devtools/gcc/gcc-target.inc b/meta/recipes-devtools/gcc/gcc-target.inc
index de906d6241..4c3eea6851 100644
--- a/meta/recipes-devtools/gcc/gcc-target.inc
+++ b/meta/recipes-devtools/gcc/gcc-target.inc
@@ -1,105 +1,107 @@
GCCMULTILIB = "--enable-multilib"
require gcc-configure-common.inc
-EXTRA_OECONF_PATHS = " \
+EXTRA_OECONF_PATHS = "\
--with-sysroot=/ \
--with-build-sysroot=${STAGING_DIR_TARGET} \
--with-native-system-header-dir=${STAGING_DIR_TARGET}${target_includedir} \
- --with-gxx-include-dir=${includedir}/c++/"
+ --with-gxx-include-dir=${includedir}/c++/${BINV} \
+"
+
+EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
-EXTRA_OECONF_FPU = "${@get_gcc_fpu_setting(bb, d)}"
+EXTRA_OECONF_GCC_FLOAT = "${@get_gcc_float_setting(bb, d)}"
PACKAGES = "\
- ${PN} ${PN}-plugins ${PN}-symlinks \
- g++ g++-symlinks \
- cpp cpp-symlinks \
- g77 g77-symlinks \
- gfortran gfortran-symlinks \
- gcov gcov-symlinks \
- ${PN}-plugin-dev \
- ${PN}-doc \
- ${PN}-dev \
- ${PN}-dbg \
+ ${PN} ${PN}-plugins ${PN}-symlinks \
+ g++ g++-symlinks \
+ cpp cpp-symlinks \
+ g77 g77-symlinks \
+ gfortran gfortran-symlinks \
+ gcov gcov-symlinks \
+ ${PN}-plugin-dev \
+ ${PN}-doc \
+ ${PN}-dev \
+ ${PN}-dbg \
"
FILES_${PN} = "\
- ${bindir}/${TARGET_PREFIX}gcc* \
- ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/collect2 \
- ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc* \
- ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lto* \
- ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
- ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/liblto*${SOLIBSDEV} \
- ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \
- ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \
- ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
- ${gcclibdir}/${TARGET_SYS}/${BINV}/include \
- ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \
+ ${bindir}/${TARGET_PREFIX}gcc* \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/collect2 \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc* \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lto* \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/liblto*${SOLIBSDEV} \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/include \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \
"
INSANE_SKIP_${PN} += "dev-so"
FILES_${PN}-dbg += "\
- ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/.debug/ \
- ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/.debug/ \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/.debug/ \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/.debug/ \
"
FILES_${PN}-dev = "\
- ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
- ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
"
FILES_${PN}-plugin-dev = "\
- ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \
- ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/gengtype \
- ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.state \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/gengtype \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.state \
"
FILES_${PN}-symlinks = "\
- ${bindir}/cc \
- ${bindir}/gcc \
- ${bindir}/gccbug \
+ ${bindir}/cc \
+ ${bindir}/gcc \
+ ${bindir}/gccbug \
"
FILES_${PN}-plugins = "\
- ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin \
"
ALLOW_EMPTY_${PN}-plugins = "1"
FILES_g77 = "\
- ${bindir}/${TARGET_PREFIX}g77 \
- ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f771 \
+ ${bindir}/${TARGET_PREFIX}g77 \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f771 \
"
FILES_g77-symlinks = "\
- ${bindir}/g77 \
- ${bindir}/f77 \
+ ${bindir}/g77 \
+ ${bindir}/f77 \
"
FILES_gfortran = "\
- ${bindir}/${TARGET_PREFIX}gfortran \
- ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \
+ ${bindir}/${TARGET_PREFIX}gfortran \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \
"
FILES_gfortran-symlinks = "\
- ${bindir}/gfortran \
- ${bindir}/f95"
+ ${bindir}/gfortran \
+ ${bindir}/f95"
FILES_cpp = "\
- ${bindir}/${TARGET_PREFIX}cpp \
- ${base_libdir}/cpp \
- ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1"
+ ${bindir}/${TARGET_PREFIX}cpp \
+ ${base_libdir}/cpp \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1"
FILES_cpp-symlinks = "${bindir}/cpp"
FILES_gcov = "${bindir}/${TARGET_PREFIX}gcov"
FILES_gcov-symlinks = "${bindir}/gcov"
FILES_g++ = "\
- ${bindir}/${TARGET_PREFIX}g++ \
- ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus \
+ ${bindir}/${TARGET_PREFIX}g++ \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus \
"
FILES_g++-symlinks = "\
- ${bindir}/c++ \
- ${bindir}/g++ \
+ ${bindir}/c++ \
+ ${bindir}/g++ \
"
-
FILES_${PN}-doc = "\
- ${infodir} \
- ${mandir} \
- ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
+ ${infodir} \
+ ${mandir} \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
"
do_compile () {
@@ -164,3 +166,12 @@ do_install () {
chown -R root:root ${D}
}
+
+# Installing /usr/lib/gcc/* means we'd have two copies, one from gcc-cross
+# and one from here. These can confuse gcc cross where includes use #include_next
+# and builds track file dependencies (e.g. perl and its makedepends code).
+# For determinism we don't install this ever and rely on the copy from gcc-cross.
+# [YOCTO #7287]
+sysroot_stage_dirs_append () {
+ rm -rf $to${libdir}/gcc
+}
diff --git a/meta/recipes-devtools/gcc/libgcc-common.inc b/meta/recipes-devtools/gcc/libgcc-common.inc
index c81a80c6de..3101762b02 100644
--- a/meta/recipes-devtools/gcc/libgcc-common.inc
+++ b/meta/recipes-devtools/gcc/libgcc-common.inc
@@ -1,5 +1,7 @@
BPN = "libgcc"
+require gcc-shared-source.inc
+
INHIBIT_DEFAULT_DEPS = "1"
do_configure () {
@@ -52,7 +54,7 @@ addtask multilib_install after do_install before do_package do_populate_sysroot
# by creating this symlink to it
# /usr/lib64/x86_64-poky-linux/4.7/32
-python do_multilib_install() {
+fakeroot python do_multilib_install() {
import re
multilibs = d.getVar('MULTILIB_VARIANTS', True)
@@ -115,7 +117,7 @@ python do_multilib_install() {
}
addtask extra_symlinks after do_multilib_install before do_package do_populate_sysroot
-python do_extra_symlinks() {
+fakeroot python do_extra_symlinks() {
targetsysnoext = d.getVar('TARGET_SYS_NO_EXTENSION', True)
if targetsysnoext != d.getVar('TARGET_SYS', True):
diff --git a/meta/recipes-devtools/gcc/libgcc.inc b/meta/recipes-devtools/gcc/libgcc.inc
index 45dd151e5f..21cb8c1084 100644
--- a/meta/recipes-devtools/gcc/libgcc.inc
+++ b/meta/recipes-devtools/gcc/libgcc.inc
@@ -3,25 +3,33 @@ require libgcc-common.inc
DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
PACKAGES = "\
- ${PN} \
- ${PN}-dev \
- ${PN}-dbg \
- libgcov-dev \
- "
+ ${PN} \
+ ${PN}-dev \
+ ${PN}-dbg \
+ libgcov-dev \
+"
+
+# All libgcc source is marked with the exception.
+#
+LICENSE_${PN} = "GPL-3.0-with-GCC-exception"
+LICENSE_${PN}-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_${PN}-dbg = "GPL-3.0-with-GCC-exception"
+
FILES_${PN} = "${base_libdir}/libgcc*.so.*"
-FILES_${PN}-dev = " \
- ${base_libdir}/libgcc*.so \
- ${libdir}/${TARGET_SYS}/${BINV}/*crt* \
- ${libdir}/${TARGET_SYS}/${BINV}/64 \
- ${libdir}/${TARGET_SYS}/${BINV}/32 \
- ${libdir}/${TARGET_SYS}/${BINV}/x32 \
- ${libdir}/${TARGET_SYS}/${BINV}/n32 \
- ${libdir}/${TARGET_SYS}/${BINV}/libgcc* \
- ${@base_conditional('TARGET_SYS_NO_EXTENSION', '${TARGET_SYS}', '', '${libdir}/${TARGET_SYS_NO_EXTENSION}', d)}"
-FILES_libgcov-dev = " \
- ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a \
- "
+FILES_${PN}-dev = "\
+ ${base_libdir}/libgcc*.so \
+ ${libdir}/${TARGET_SYS}/${BINV}/*crt* \
+ ${libdir}/${TARGET_SYS}/${BINV}/64 \
+ ${libdir}/${TARGET_SYS}/${BINV}/32 \
+ ${libdir}/${TARGET_SYS}/${BINV}/x32 \
+ ${libdir}/${TARGET_SYS}/${BINV}/n32 \
+ ${libdir}/${TARGET_SYS}/${BINV}/libgcc* \
+ ${@base_conditional('TARGET_SYS_NO_EXTENSION', '${TARGET_SYS}', '', '${libdir}/${TARGET_SYS_NO_EXTENSION}', d)} \
+"
+FILES_libgcov-dev = "\
+ ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a \
+"
FILES_${PN}-dbg += "${base_libdir}/.debug/"
LIBGCCBUILDTREENAME = "gcc-build-internal-"
diff --git a/meta/recipes-devtools/gcc/libgfortran.inc b/meta/recipes-devtools/gcc/libgfortran.inc
index 7bf412134b..e42843d2f1 100644
--- a/meta/recipes-devtools/gcc/libgfortran.inc
+++ b/meta/recipes-devtools/gcc/libgfortran.inc
@@ -1,8 +1,9 @@
require gcc-configure-common.inc
-EXTRA_OECONF_PATHS = " \
- --with-sysroot=${STAGING_DIR_TARGET} \
- --with-build-sysroot=${STAGING_DIR_TARGET}"
+EXTRA_OECONF_PATHS = "\
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
do_configure () {
mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
@@ -45,20 +46,20 @@ DEPENDS = "gcc-runtime"
BBCLASSEXTEND = "nativesdk"
PACKAGES = "\
- ${PN}-dbg \
- libgfortran \
- libgfortran-dev \
- libgfortran-staticdev \
+ ${PN}-dbg \
+ libgfortran \
+ libgfortran-dev \
+ libgfortran-staticdev \
"
FILES_${PN} = "${libdir}/libgfortran.so.*"
-FILES_${PN}-dev = " \
- ${libdir}/libgfortran*.so \
- ${libdir}/libgfortran.spec \
- ${libdir}/libgfortran.la \
- ${libdir}/gcc/${TARGET_SYS}/${BINV}/libgfortranbegin.* \
- ${libdir}/gcc/${TARGET_SYS}/${BINV}/libcaf_single*"
-FILES_${PN}-staticdev = " \
- ${libdir}/libgfortran.a"
+FILES_${PN}-dev = "\
+ ${libdir}/libgfortran*.so \
+ ${libdir}/libgfortran.spec \
+ ${libdir}/libgfortran.la \
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/libgfortranbegin.* \
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/libcaf_single* \
+"
+FILES_${PN}-staticdev = "${libdir}/libgfortran.a"
INSANE_SKIP_${MLPREFIX}libgfortran-dev = "staticdev"