diff options
Diffstat (limited to 'meta/recipes-devtools/gcc')
32 files changed, 1072 insertions, 179 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.8.inc b/meta/recipes-devtools/gcc/gcc-4.8.inc index 18a6692687..06e6982d93 100644 --- a/meta/recipes-devtools/gcc/gcc-4.8.inc +++ b/meta/recipes-devtools/gcc/gcc-4.8.inc @@ -73,6 +73,7 @@ SRC_URI = "\ 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" 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/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 25778bd272..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.1" +PV = "4.9.2" # BINV should be incremented to a revision after a minor gcc release -BINV = "4.9.1" +BINV = "4.9.2" FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-4.9:" @@ -67,12 +67,19 @@ SRC_URI = "\ 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-PR-rtl-optimization-61801.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] = "fddf71348546af523353bd43d34919c1" -SRC_URI[sha256sum] = "d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e" +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}" @@ -120,10 +127,8 @@ EXTRA_OECONF_INTERMEDIATE = "\ EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float " -EXTRA_OECONF_PATHS = "\ - --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++/${BINV} \ - --with-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/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch b/meta/recipes-devtools/gcc/gcc-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch index ba0a2278b7..37c46fc2e2 100644 --- a/meta/recipes-devtools/gcc/gcc-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch +++ b/meta/recipes-devtools/gcc/gcc-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch @@ -11,26 +11,34 @@ Upstream-Status: Pending gcc/config/arm/linux-elf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -Index: gcc-4.9-20140316/gcc/config/arm/coff.h +Index: gcc-4.9.2/gcc/config/arm/coff.h =================================================================== ---- gcc-4.9-20140316.orig/gcc/config/arm/coff.h -+++ gcc-4.9-20140316/gcc/config/arm/coff.h -@@ -33,7 +33,7 @@ +--- gcc-4.9.2.orig/gcc/config/arm/coff.h ++++ gcc-4.9.2/gcc/config/arm/coff.h +@@ -32,8 +32,11 @@ + #define TARGET_DEFAULT (MASK_APCS_FRAME) #ifndef MULTILIB_DEFAULTS ++#ifndef TARGET_ENDIAN_OPTION ++#define TARGET_ENDIAN_OPTION "mlittle-endian" ++#endif #define MULTILIB_DEFAULTS \ - { "marm", "mlittle-endian", "mfloat-abi=soft", "mno-thumb-interwork" } + { "marm", TARGET_ENDIAN_OPTION, "mfloat-abi=soft", "mno-thumb-interwork" } #endif /* This is COFF, but prefer stabs. */ -Index: gcc-4.9-20140316/gcc/config/arm/elf.h +Index: gcc-4.9.2/gcc/config/arm/elf.h =================================================================== ---- gcc-4.9-20140316.orig/gcc/config/arm/elf.h -+++ gcc-4.9-20140316/gcc/config/arm/elf.h -@@ -112,7 +112,7 @@ +--- gcc-4.9.2.orig/gcc/config/arm/elf.h ++++ gcc-4.9.2/gcc/config/arm/elf.h +@@ -116,8 +116,11 @@ + #endif #ifndef MULTILIB_DEFAULTS ++#ifndef TARGET_ENDIAN_OPTION ++#define TARGET_ENDIAN_OPTION "mlittle-endian" ++#endif #define MULTILIB_DEFAULTS \ - { "marm", "mlittle-endian", "mfloat-abi=soft", "mno-thumb-interwork", "fno-leading-underscore" } + { "marm", TARGET_ENDIAN_OPTION, "mfloat-abi=soft", "mno-thumb-interwork", "fno-leading-underscore" } 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/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/0055-PR-rtl-optimization-61801.patch b/meta/recipes-devtools/gcc/gcc-4.9/0055-PR-rtl-optimization-61801.patch deleted file mode 100644 index b27abdef38..0000000000 --- a/meta/recipes-devtools/gcc/gcc-4.9/0055-PR-rtl-optimization-61801.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 556537c4ad0df4cbebb74197bb2bdea75cf5dd35 Mon Sep 17 00:00:00 2001 -From: rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> -Date: Thu, 17 Jul 2014 07:48:49 +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_9-branch@212739 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 efc4223..df29bd3 100644 ---- a/gcc/sched-deps.c -+++ b/gcc/sched-deps.c -@@ -2750,7 +2750,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.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 0bf26b5c62..04c701a974 100644 --- a/meta/recipes-devtools/gcc/gcc-common.inc +++ b/meta/recipes-devtools/gcc/gcc-common.inc @@ -79,17 +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 \ " - -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" - # # Set some default values # @@ -99,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 f33678c75a..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. # @@ -51,7 +52,6 @@ EXTRA_OECONF = "\ ${@get_gcc_multiarch_setting(bb, d)} \ " -export ac_cv_path_SED = 'sed' 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 @@ -63,6 +63,8 @@ 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 diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc index 0b1f37b908..750a4f2113 100644 --- a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc +++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc @@ -10,9 +10,9 @@ 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++/${BINV} \ + --with-gxx-include-dir=/not/exist${target_includedir}/c++/${BINV} \ --with-build-time-tools=${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/bin \ - --with-sysroot=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS} \ + --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 @@ -55,7 +55,6 @@ 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 } @@ -63,12 +62,10 @@ do_compile () { oe_runmake all-host configure-target-libgcc } -INHIBIT_PACKAGE_STRIP = "1" - # Having anything auto depending on gcc-cross-sdk is a really bad idea... EXCLUDE_FROM_SHLIBS = "1" -PACKAGES = "${PN} ${PN}-doc" +PACKAGES = "${PN}-dbg ${PN} ${PN}-doc" FILES_${PN} = "\ ${exec_prefix}/bin/* \ @@ -87,6 +84,11 @@ FILES_${PN} = "\ " INSANE_SKIP_${PN} += "dev-so" +FILES_${PN}-dbg += " \ + ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/.debug \ + ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/.debug \ +" + FILES_${PN}-doc = "\ ${infodir} \ ${mandir} \ diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial.inc b/meta/recipes-devtools/gcc/gcc-cross-initial.inc index 6e2f25b562..7197447080 100644 --- a/meta/recipes-devtools/gcc/gcc-cross-initial.inc +++ b/meta/recipes-devtools/gcc/gcc-cross-initial.inc @@ -21,7 +21,7 @@ EXTRA_OECONF = "\ --enable-languages=c \ ${OPTSPACE} \ --program-prefix=${TARGET_PREFIX} \ - --with-sysroot=${STAGING_DIR_TARGET} \ + --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)} \ diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc index 4cdb55f3ee..97929501e8 100644 --- a/meta/recipes-devtools/gcc/gcc-cross.inc +++ b/meta/recipes-devtools/gcc/gcc-cross.inc @@ -25,17 +25,13 @@ EXTRA_OECONF += "\ " EXTRA_OECONF_PATHS = "\ - --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++/${BINV} \ - --with-sysroot=${STAGING_DIR_TARGET} \ + --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-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc index 167869e1f2..09757e6ccc 100644 --- a/meta/recipes-devtools/gcc/gcc-runtime.inc +++ b/meta/recipes-devtools/gcc/gcc-runtime.inc @@ -4,7 +4,7 @@ CXXFLAGS := "${@oe_filter_out('-fvisibility-inlines-hidden', '${CXXFLAGS}', d)}" EXTRA_OECONF_PATHS = "\ --with-gxx-include-dir=${includedir}/c++/${BINV} \ - --with-sysroot=${STAGING_DIR_TARGET} \ + --with-sysroot=/not/exist \ --with-build-sysroot=${STAGING_DIR_TARGET} \ " @@ -76,9 +76,6 @@ PACKAGES = "\ libssp \ libssp-dev \ libssp-staticdev \ - libgfortran \ - libgfortran-dev \ - libgfortran-staticdev \ libmudflap \ libmudflap-dev \ libmudflap-staticdev \ @@ -92,6 +89,37 @@ PACKAGES = "\ 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 = "" @@ -131,18 +159,6 @@ FILES_libssp-dev = "\ " 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_libquadmath = "${libdir}/libquadmath*.so.*" FILES_libquadmath-dev = "\ ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \ 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 a266f16edf..4c3eea6851 100644 --- a/meta/recipes-devtools/gcc/gcc-target.inc +++ b/meta/recipes-devtools/gcc/gcc-target.inc @@ -166,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 22c42d5eca..21cb8c1084 100644 --- a/meta/recipes-devtools/gcc/libgcc.inc +++ b/meta/recipes-devtools/gcc/libgcc.inc @@ -9,6 +9,13 @@ PACKAGES = "\ 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 \ diff --git a/meta/recipes-devtools/gcc/libgfortran.inc b/meta/recipes-devtools/gcc/libgfortran.inc index cf7942f41d..e42843d2f1 100644 --- a/meta/recipes-devtools/gcc/libgfortran.inc +++ b/meta/recipes-devtools/gcc/libgfortran.inc @@ -1,7 +1,7 @@ require gcc-configure-common.inc EXTRA_OECONF_PATHS = "\ - --with-sysroot=${STAGING_DIR_TARGET} \ + --with-sysroot=/not/exist \ --with-build-sysroot=${STAGING_DIR_TARGET} \ " |