summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-15 12:17:53 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-15 17:10:52 +0000
commitfe43e599327f26b399c1883205e988236a5e51bd (patch)
tree43834e845762da0d30abd461af78563572707aa2
parentf7ef271db58f1a40ea61c76a2811162f2d671051 (diff)
downloadpoky-fe43e599327f26b399c1883205e988236a5e51bd.tar.gz
gcc: Drop 7.3 since 8.2 is working fine for us2.7_M1
We've had gcc 8.2 around for long enough that 7.3 can be removed now. (From OE-Core rev: 20aea61385e1a53ac245353899277ba20104ed2f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3.inc136
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0001-Fix-internal-compiler-error-in-testcase.patch212
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0001-Fix-ppc64le-build-Partial-backport-r256656.patch37
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch58
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch272
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch42
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0009-gcc-poison-system-directories.patch192
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0010-gcc-poison-dir-extend.patch39
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0011-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch73
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0012-64-bit-multilib-hack.patch85
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0013-optional-libstdc.patch125
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0014-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch59
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0015-COLLECT_GCC_OPTIONS.patch38
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0016-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch96
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0017-fortran-cross-compile-hack.patch46
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0018-cpp-honor-sysroot.patch54
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0019-MIPS64-Default-to-N64-ABI.patch57
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0020-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch234
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0021-gcc-Fix-argument-list-too-long-error.patch40
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0022-Disable-sdt.patch113
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0023-libtool.patch42
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0024-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch43
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0025-Use-the-multilib-config-files-from-B-instead-of-usin.patch102
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0026-Avoid-using-libdir-from-.la-which-usually-points-to-.patch31
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0027-export-CPP.patch53
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0028-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch56
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0029-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch42
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0030-Ensure-target-gcc-headers-can-be-included.patch62
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0031-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch54
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0032-Don-t-search-host-directory-during-relink-if-inst_pr.patch38
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0033-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch29
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0034-aarch64-Add-support-for-musl-ldso.patch28
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0035-libcc1-fix-libcc1-s-install-path-and-rpath.patch54
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0036-handle-sysroot-support-for-nativesdk-gcc.patch213
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0037-Search-target-sysroot-gcc-version-specific-dirs-with.patch102
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0038-Fix-various-_FOR_BUILD-and-related-variables.patch137
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0039-nios2-Define-MUSL_DYNAMIC_LINKER.patch28
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0040-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch87
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0041-gcc-libcpp-support-ffile-prefix-map-old-new.patch284
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0042-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch43
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch54
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch513
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0045-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch29
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0047-sync-gcc-stddef.h-with-musl.patch91
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0048-gcc-Enable-static-PIE.patch46
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0049-gcc-override-TARGET_LIBC_PROVIDES_SSP.patch204
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0050-powerpc-powerpc64-Add-support-for-musl-ldso.patch31
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch49
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/no-sse-fix-test-case-failures.patch259
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-canadian_7.3.bb5
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-initial_7.3.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross_7.3.bb3
-rw-r--r--meta/recipes-devtools/gcc/gcc-crosssdk-initial_7.3.bb3
-rw-r--r--meta/recipes-devtools/gcc/gcc-crosssdk_7.3.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-runtime_7.3.bb7
-rw-r--r--meta/recipes-devtools/gcc/gcc-sanitizers_7.3.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-source_7.3.bb4
-rw-r--r--meta/recipes-devtools/gcc/gcc_7.3.bb10
-rw-r--r--meta/recipes-devtools/gcc/libgcc-initial_7.3.bb2
-rw-r--r--meta/recipes-devtools/gcc/libgcc_7.3.bb2
-rw-r--r--meta/recipes-devtools/gcc/libgfortran_7.3.bb3
61 files changed, 0 insertions, 4857 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-7.3.inc b/meta/recipes-devtools/gcc/gcc-7.3.inc
deleted file mode 100644
index e16d03f50d..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3.inc
+++ /dev/null
@@ -1,136 +0,0 @@
1require gcc-common.inc
2
3# Third digit in PV should be incremented after a minor release
4
5PV = "7.3.0"
6
7# BINV should be incremented to a revision after a minor gcc release
8
9BINV = "7.3.0"
10
11FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-7.3:${FILE_DIRNAME}/gcc-7.3/backport:"
12
13DEPENDS =+ "mpfr gmp libmpc zlib flex-native"
14NATIVEDEPS = "mpfr-native gmp-native libmpc-native zlib-native flex-native"
15
16LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
17
18LIC_FILES_CHKSUM = "\
19 file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
20 file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
21 file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
22 file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
23 file://COPYING.RUNTIME;md5=fe60d87048567d4fe8c8a0ed2448bcc8 \
24"
25
26#RELEASE = "7-20170504"
27BASEURI ?= "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.xz"
28#SRCREV = "f7cf798b73fd1a07098f9a490deec1e2a36e0bed"
29#BASEURI ?= "git://github.com/gcc-mirror/gcc;branch=gcc-6-branch;protocol=git"
30#BASEURI ?= "http://mirrors.concertpass.com/gcc/snapshots/${RELEASE}/gcc-${RELEASE}.tar.bz2"
31
32SRC_URI = "\
33 ${BASEURI} \
34 file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \
35 file://0009-gcc-poison-system-directories.patch \
36 file://0010-gcc-poison-dir-extend.patch \
37 file://0011-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \
38 file://0012-64-bit-multilib-hack.patch \
39 file://0013-optional-libstdc.patch \
40 file://0014-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch \
41 file://0015-COLLECT_GCC_OPTIONS.patch \
42 file://0016-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \
43 file://0017-fortran-cross-compile-hack.patch \
44 file://0018-cpp-honor-sysroot.patch \
45 file://0019-MIPS64-Default-to-N64-ABI.patch \
46 file://0020-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
47 file://0021-gcc-Fix-argument-list-too-long-error.patch \
48 file://0022-Disable-sdt.patch \
49 file://0023-libtool.patch \
50 file://0024-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
51 file://0025-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
52 file://0026-Avoid-using-libdir-from-.la-which-usually-points-to-.patch \
53 file://0027-export-CPP.patch \
54 file://0028-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \
55 file://0029-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch \
56 file://0030-Ensure-target-gcc-headers-can-be-included.patch \
57 file://0031-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch \
58 file://0032-Don-t-search-host-directory-during-relink-if-inst_pr.patch \
59 file://0033-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch \
60 file://0034-aarch64-Add-support-for-musl-ldso.patch \
61 file://0035-libcc1-fix-libcc1-s-install-path-and-rpath.patch \
62 file://0036-handle-sysroot-support-for-nativesdk-gcc.patch \
63 file://0037-Search-target-sysroot-gcc-version-specific-dirs-with.patch \
64 file://0038-Fix-various-_FOR_BUILD-and-related-variables.patch \
65 file://0039-nios2-Define-MUSL_DYNAMIC_LINKER.patch \
66 file://0040-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch \
67 file://0041-gcc-libcpp-support-ffile-prefix-map-old-new.patch \
68 file://0042-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \
69 file://0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch \
70 file://0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch \
71 file://0045-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch \
72 file://0047-sync-gcc-stddef.h-with-musl.patch \
73 file://0048-gcc-Enable-static-PIE.patch \
74 file://0049-gcc-override-TARGET_LIBC_PROVIDES_SSP.patch \
75 file://0050-powerpc-powerpc64-Add-support-for-musl-ldso.patch \
76 file://fix-segmentation-fault-precompiled-hdr.patch \
77 file://no-sse-fix-test-case-failures.patch \
78 ${BACKPORTS} \
79"
80BACKPORTS = "\
81 file://0001-Fix-internal-compiler-error-in-testcase.patch \
82 file://0001-PR-rtl-optimization-83030.patch \
83 file://0001-Fix-ppc64le-build-Partial-backport-r256656.patch \
84 file://0001-PR-c-80290-memory-hog-with-std-pair.patch \
85"
86
87SRC_URI[md5sum] = "be2da21680f27624f3a87055c4ba5af2"
88SRC_URI[sha256sum] = "832ca6ae04636adbb430e865a1451adf6979ab44ca1c8374f61fba65645ce15c"
89
90S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
91#S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/git"
92B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
93
94# Language Overrides
95FORTRAN = ""
96JAVA = ""
97
98LTO = "--enable-lto"
99SSP ?= "--disable-libssp"
100SSP_mingw32 = "--enable-libssp"
101
102EXTRA_OECONF_BASE = "\
103 ${LTO} \
104 ${SSP} \
105 --enable-libitm \
106 --disable-bootstrap \
107 --disable-libmudflap \
108 --with-system-zlib \
109 ${@'--with-linker-hash-style=${LINKER_HASH_STYLE}' if '${LINKER_HASH_STYLE}' else ''} \
110 --enable-linker-build-id \
111 --with-ppl=no \
112 --with-cloog=no \
113 --enable-checking=release \
114 --enable-cheaders=c_global \
115 --without-isl \
116"
117
118EXTRA_OECONF_INITIAL = "\
119 --disable-libmudflap \
120 --disable-libgomp \
121 --disable-libitm \
122 --disable-libquadmath \
123 --with-system-zlib \
124 --disable-lto \
125 --disable-plugin \
126 --enable-linker-build-id \
127 --enable-decimal-float=no \
128 --without-isl \
129 --disable-libssp \
130"
131
132EXTRA_OECONF_PATHS = "\
133 --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
134 --with-sysroot=/not/exist \
135 --with-build-sysroot=${STAGING_DIR_TARGET} \
136"
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0001-Fix-internal-compiler-error-in-testcase.patch b/meta/recipes-devtools/gcc/gcc-7.3/0001-Fix-internal-compiler-error-in-testcase.patch
deleted file mode 100644
index 45cc0eeecd..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0001-Fix-internal-compiler-error-in-testcase.patch
+++ /dev/null
@@ -1,212 +0,0 @@
1From d3cdd96a300f9003a1cc242541605169aacdc811 Mon Sep 17 00:00:00 2001
2From: willschm <willschm@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Mon, 25 Sep 2017 14:35:02 +0000
4Subject: [PATCH] [gcc]
5
62017-09-25 Will Schmidt <will_schmidt@vnet.ibm.com>
7
8 * config/rs6000/rs6000.c (rs6000_gimple_fold_builtin): Add handling
9 for early folding of vector stores (ALTIVEC_BUILTIN_ST_*).
10 (rs6000_builtin_valid_without_lhs): New helper function.
11 * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
12 Remove obsoleted code for handling ALTIVEC_BUILTIN_VEC_ST.
13
14git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253152 138bc75d-0d04-0410-961f-82ee72b054a4
15
16Fix internal compiler error for testcase gcc.dg/vmx/7d-02.c
17
18Upstream commit: d3cdd96a300f9003a1cc242541605169aacdc811
19
20Backport by Kaushik Phatak <Kaushik.Phatak@kpit.com>
21
22This patch removes changes to Changelog from the original upstream patch.
23This will help us avoid conflicts.
24
25Upstream-Status: Backport
26
27Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
28---
29 gcc/ChangeLog | 8 +++++
30 gcc/config/rs6000/rs6000-c.c | 72 -------------------------------------------
31 gcc/config/rs6000/rs6000.c | 73 ++++++++++++++++++++++++++++++++++++++++++--
32 3 files changed, 78 insertions(+), 75 deletions(-)
33
34diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
35index a49db97..4a363a1 100644
36--- a/gcc/config/rs6000/rs6000-c.c
37+++ b/gcc/config/rs6000/rs6000-c.c
38@@ -6279,70 +6279,6 @@ altivec_resolve_overloaded_builtin (loca
39 }
40 }
41
42- /* Similarly for stvx. */
43- if (fcode == ALTIVEC_BUILTIN_VEC_ST
44- && (BYTES_BIG_ENDIAN || !VECTOR_ELT_ORDER_BIG)
45- && nargs == 3)
46- {
47- tree arg0 = (*arglist)[0];
48- tree arg1 = (*arglist)[1];
49- tree arg2 = (*arglist)[2];
50-
51- /* Construct the masked address. Let existing error handling take
52- over if we don't have a constant offset. */
53- arg1 = fold (arg1);
54-
55- if (TREE_CODE (arg1) == INTEGER_CST)
56- {
57- if (!ptrofftype_p (TREE_TYPE (arg1)))
58- arg1 = build1 (NOP_EXPR, sizetype, arg1);
59-
60- tree arg2_type = TREE_TYPE (arg2);
61- if (TREE_CODE (arg2_type) == ARRAY_TYPE && c_dialect_cxx ())
62- {
63- /* Force array-to-pointer decay for C++. */
64- arg2 = default_conversion (arg2);
65- arg2_type = TREE_TYPE (arg2);
66- }
67-
68- /* Find the built-in to make sure a compatible one exists; if not
69- we fall back to default handling to get the error message. */
70- for (desc = altivec_overloaded_builtins;
71- desc->code && desc->code != fcode; desc++)
72- continue;
73-
74- for (; desc->code == fcode; desc++)
75- if (rs6000_builtin_type_compatible (TREE_TYPE (arg0), desc->op1)
76- && rs6000_builtin_type_compatible (TREE_TYPE (arg1), desc->op2)
77- && rs6000_builtin_type_compatible (TREE_TYPE (arg2),
78- desc->op3))
79- {
80- tree addr = fold_build2_loc (loc, POINTER_PLUS_EXPR, arg2_type,
81- arg2, arg1);
82- tree aligned
83- = fold_build2_loc (loc, BIT_AND_EXPR, arg2_type,
84- addr, build_int_cst (arg2_type, -16));
85-
86- tree arg0_type = TREE_TYPE (arg0);
87- if (TYPE_MODE (arg0_type) == V2DImode)
88- /* Type-based aliasing analysis thinks vector long
89- and vector long long are different and will put them
90- in distinct alias classes. Force our address type
91- to be a may-alias type to avoid this. */
92- arg0_type
93- = build_pointer_type_for_mode (arg0_type, Pmode,
94- true/*can_alias_all*/);
95- else
96- arg0_type = build_pointer_type (arg0_type);
97- aligned = build1 (NOP_EXPR, arg0_type, aligned);
98- tree stg = build_indirect_ref (loc, aligned, RO_NULL);
99- tree retval = build2 (MODIFY_EXPR, TREE_TYPE (stg), stg,
100- convert (TREE_TYPE (stg), arg0));
101- return retval;
102- }
103- }
104- }
105-
106 for (n = 0;
107 !VOID_TYPE_P (TREE_VALUE (fnargs)) && n < nargs;
108 fnargs = TREE_CHAIN (fnargs), n++)
109diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
110index a49db97..4a363a1 100644
111--- a/gcc/config/rs6000/rs6000.c
112+++ b/gcc/config/rs6000/rs6000.c
113@@ -55,6 +55,7 @@
114 #include "reload.h"
115 #include "sched-int.h"
116 #include "gimplify.h"
117+#include "gimple-fold.h"
118 #include "gimple-iterator.h"
119 #include "gimple-ssa.h"
120 #include "gimple-walk.h"
121@@ -17089,6 +17090,25 @@ rs6000_fold_builtin (tree fndecl, int n_
122 #endif
123 }
124
125+/* Helper function to sort out which built-ins may be valid without having
126+ a LHS. */
127+bool
128+rs6000_builtin_valid_without_lhs (enum rs6000_builtins fn_code)
129+{
130+ switch (fn_code)
131+ {
132+ case ALTIVEC_BUILTIN_STVX_V16QI:
133+ case ALTIVEC_BUILTIN_STVX_V8HI:
134+ case ALTIVEC_BUILTIN_STVX_V4SI:
135+ case ALTIVEC_BUILTIN_STVX_V4SF:
136+ case ALTIVEC_BUILTIN_STVX_V2DI:
137+ case ALTIVEC_BUILTIN_STVX_V2DF:
138+ return true;
139+ default:
140+ return false;
141+ }
142+}
143+
144 /* Fold a machine-dependent built-in in GIMPLE. (For folding into
145 a constant, use rs6000_fold_builtin.) */
146
147@@ -17102,6 +17122,10 @@ rs6000_gimple_fold_builtin (gimple_stmt_
148 = (enum rs6000_builtins) DECL_FUNCTION_CODE (fndecl);
149 tree arg0, arg1, lhs;
150
151+ /* Prevent gimple folding for code that does not have a LHS, unless it is
152+ allowed per the rs6000_builtin_valid_without_lhs helper function. */
153+ if (!gimple_call_lhs (stmt) && !rs6000_builtin_valid_without_lhs (fn_code))
154+ return false;
155 switch (fn_code)
156 {
157 /* Flavors of vec_add. We deliberately don't expand
158@@ -17169,6 +17193,54 @@ rs6000_gimple_fold_builtin (gimple_stmt_
159 gsi_replace (gsi, g, true);
160 return true;
161 }
162+ /* Vector stores. */
163+ case ALTIVEC_BUILTIN_STVX_V16QI:
164+ case ALTIVEC_BUILTIN_STVX_V8HI:
165+ case ALTIVEC_BUILTIN_STVX_V4SI:
166+ case ALTIVEC_BUILTIN_STVX_V4SF:
167+ case ALTIVEC_BUILTIN_STVX_V2DI:
168+ case ALTIVEC_BUILTIN_STVX_V2DF:
169+ {
170+ /* Do not fold for -maltivec=be on LE targets. */
171+ if (VECTOR_ELT_ORDER_BIG && !BYTES_BIG_ENDIAN)
172+ return false;
173+ arg0 = gimple_call_arg (stmt, 0); /* Value to be stored. */
174+ arg1 = gimple_call_arg (stmt, 1); /* Offset. */
175+ tree arg2 = gimple_call_arg (stmt, 2); /* Store-to address. */
176+ location_t loc = gimple_location (stmt);
177+ tree arg0_type = TREE_TYPE (arg0);
178+ /* Use ptr_type_node (no TBAA) for the arg2_type.
179+ FIXME: (Richard) "A proper fix would be to transition this type as
180+ seen from the frontend to GIMPLE, for example in a similar way we
181+ do for MEM_REFs by piggy-backing that on an extra argument, a
182+ constant zero pointer of the alias pointer type to use (which would
183+ also serve as a type indicator of the store itself). I'd use a
184+ target specific internal function for this (not sure if we can have
185+ those target specific, but I guess if it's folded away then that's
186+ fine) and get away with the overload set."
187+ */
188+ tree arg2_type = ptr_type_node;
189+ /* POINTER_PLUS_EXPR wants the offset to be of type 'sizetype'. Create
190+ the tree using the value from arg0. The resulting type will match
191+ the type of arg2. */
192+ gimple_seq stmts = NULL;
193+ tree temp_offset = gimple_convert (&stmts, loc, sizetype, arg1);
194+ tree temp_addr = gimple_build (&stmts, loc, POINTER_PLUS_EXPR,
195+ arg2_type, arg2, temp_offset);
196+ /* Mask off any lower bits from the address. */
197+ tree aligned_addr = gimple_build (&stmts, loc, BIT_AND_EXPR,
198+ arg2_type, temp_addr,
199+ build_int_cst (arg2_type, -16));
200+ gsi_insert_seq_before (gsi, stmts, GSI_SAME_STMT);
201+ /* The desired gimple result should be similar to:
202+ MEM[(__vector floatD.1407 *)_1] = vf1D.2697; */
203+ gimple *g;
204+ g = gimple_build_assign (build2 (MEM_REF, arg0_type, aligned_addr,
205+ build_int_cst (arg2_type, 0)), arg0);
206+ gimple_set_location (g, loc);
207+ gsi_replace (gsi, g, true);
208+ return true;
209+ }
210
211 default:
212 break;
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0001-Fix-ppc64le-build-Partial-backport-r256656.patch b/meta/recipes-devtools/gcc/gcc-7.3/0001-Fix-ppc64le-build-Partial-backport-r256656.patch
deleted file mode 100644
index cfb70e1ecd..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0001-Fix-ppc64le-build-Partial-backport-r256656.patch
+++ /dev/null
@@ -1,37 +0,0 @@
1From aa65a43516da1d48011ef621ed5988289711d99b Mon Sep 17 00:00:00 2001
2From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Fri, 29 Jun 2018 09:31:30 +0000
4Subject: [PATCH] Partial backport r256656
5
62018-06-29 Martin Liska <mliska@suse.cz>
7
8 Backport from mainline
9 2018-01-10 Kelvin Nilsen <kelvin@gcc.gnu.org>
10
11 * lex.c (search_line_fast): Remove illegal coercion of an
12 unaligned pointer value to vector pointer type and replace with
13 use of __builtin_vec_vsx_ld () built-in function, which operates
14 on unaligned pointer values.
15
16Upstream-Status: Backport
17Signed-off-by: Joel Stanley <joel@jms.id.au>
18---
19 libcpp/lex.c | 2 +-
20 1 files changed, 1 insertions(+), 1 deletion(-)
21
22diff --git a/libcpp/lex.c b/libcpp/lex.c
23index 097c78002cbb..e0fb9e822c44 100644
24--- a/libcpp/lex.c
25+++ b/libcpp/lex.c
26@@ -568,7 +568,7 @@ search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED)
27 {
28 vc m_nl, m_cr, m_bs, m_qm;
29
30- data = *((const vc *)s);
31+ data = __builtin_vec_vsx_ld (0, s);
32 s += 16;
33
34 m_nl = (vc) __builtin_vec_cmpeq(data, repl_nl);
35--
362.17.1
37
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch b/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch
deleted file mode 100644
index 603a29afec..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From 8c014bceeca6a558519e86b16a8142accc41e94f Mon Sep 17 00:00:00 2001
2From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Thu, 28 Jun 2018 00:25:21 +0000
4Subject: [PATCH] PR c++/80290 - memory-hog with std::pair.
5
6 * pt.c (type_unification_real): Skip non-dependent conversion
7 check for a nested list argument.
8 (braced_init_depth): New.
9
10Upstream-Status: Backport
11Signed-off-by: Joel Stanley <joel@jms.id.au>
12---
13 gcc/cp/pt.c | 22 ++++++++++++++++++++++
14 1 file changed, 22 insertions(+)
15
16diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
17index 79cfd0129226..71077a3b0498 100644
18--- a/gcc/cp/pt.c
19+++ b/gcc/cp/pt.c
20@@ -19242,6 +19242,24 @@ try_array_deduction (tree tparms, tree targs, tree parm)
21 /*nondeduced*/false, array_deduction_r);
22 }
23
24+/* Returns how many levels of { } INIT contains. */
25+
26+static int
27+braced_init_depth (tree init)
28+{
29+ if (!init || !BRACE_ENCLOSED_INITIALIZER_P (init))
30+ return 0;
31+ unsigned i; tree val;
32+ unsigned max = 0;
33+ FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (init), i, val)
34+ {
35+ unsigned elt_d = braced_init_depth (val);
36+ if (elt_d > max)
37+ max = elt_d;
38+ }
39+ return max + 1;
40+}
41+
42 /* Most parms like fn_type_unification.
43
44 If SUBR is 1, we're being called recursively (to unify the
45@@ -19478,6 +19496,10 @@ type_unification_real (tree tparms,
46
47 if (uses_template_parms (parm))
48 continue;
49+ /* Workaround for c++/80290: avoid combinatorial explosion on
50+ deeply nested braced init-lists. */
51+ if (braced_init_depth (arg) > 2)
52+ continue;
53 if (check_non_deducible_conversion (parm, arg, strict, flags,
54 explain_p))
55 return 1;
56--
572.17.1
58
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch b/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch
deleted file mode 100644
index 71f7988eaa..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch
+++ /dev/null
@@ -1,272 +0,0 @@
1From f5c4a9440f15ccf6775659910a2014a5494ee86e Mon Sep 17 00:00:00 2001
2From: ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Wed, 22 Nov 2017 21:43:22 +0000
4Subject: [PATCH] PR rtl-optimization/83030 * doc/rtl.texi (Flags
5 in an RTL Expression): Alphabetize, add entry for CROSSING_JUMP_P and
6 mention usage of 'jump' for JUMP_INSNs. (Insns): Delete entry for
7 REG_CROSSING_JUMP in register notes. * bb-reorder.c
8 (update_crossing_jump_flags): Do not test whether the CROSSING_JUMP_P flag
9 is already set before setting it. * cfgrtl.c (fixup_partition_crossing):
10 Likewise. * reorg.c (relax_delay_slots): Do not consider a
11 CROSSING_JUMP_P insn as useless.
12
13git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255083 138bc75d-0d04-0410-961f-82ee72b054a4
14
15Upstream-Status: Backport
16
17This patch removes changes to Changelog from the original upstream patch.
18This will help us avoid conflicts.
19
20Original backport to GCC 7.x by Amruta Pawar <Amruta.Pawar@kpit.com>
21
22Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
23
24---
25 gcc/bb-reorder.c | 5 +--
26 gcc/cfgrtl.c | 3 +-
27 gcc/doc/rtl.texi | 129 ++++++++++++++++++++++++++++---------------------------
28 gcc/reorg.c | 7 +--
29 5 files changed, 84 insertions(+), 72 deletions(-)
30
31diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
32index 55e6dc6..794283c 100644
33--- a/gcc/bb-reorder.c
34+++ b/gcc/bb-reorder.c
35@@ -2236,10 +2236,7 @@ update_crossing_jump_flags (void)
36 FOR_EACH_EDGE (e, ei, bb->succs)
37 if (e->flags & EDGE_CROSSING)
38 {
39- if (JUMP_P (BB_END (bb))
40- /* Some flags were added during fix_up_fall_thru_edges, via
41- force_nonfallthru_and_redirect. */
42- && !CROSSING_JUMP_P (BB_END (bb)))
43+ if (JUMP_P (BB_END (bb)))
44 CROSSING_JUMP_P (BB_END (bb)) = 1;
45 break;
46 }
47diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
48index d6e5ac0..a2ad075 100644
49--- a/gcc/cfgrtl.c
50+++ b/gcc/cfgrtl.c
51@@ -1334,8 +1334,7 @@ fixup_partition_crossing (edge e)
52 if (BB_PARTITION (e->src) != BB_PARTITION (e->dest))
53 {
54 e->flags |= EDGE_CROSSING;
55- if (JUMP_P (BB_END (e->src))
56- && !CROSSING_JUMP_P (BB_END (e->src)))
57+ if (JUMP_P (BB_END (e->src)))
58 CROSSING_JUMP_P (BB_END (e->src)) = 1;
59 }
60 else if (BB_PARTITION (e->src) == BB_PARTITION (e->dest))
61diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
62index 21524f5..a58eedc 100644
63--- a/gcc/doc/rtl.texi
64+++ b/gcc/doc/rtl.texi
65@@ -565,6 +565,16 @@ that are used in certain types of expression. Most often they
66 are accessed with the following macros, which expand into lvalues.
67
68 @table @code
69+@findex CROSSING_JUMP_P
70+@cindex @code{jump_insn} and @samp{/j}
71+@item CROSSING_JUMP_P (@var{x})
72+Nonzero in a @code{jump_insn} if it crosses between hot and cold sections,
73+which could potentially be very far apart in the executable. The presence
74+of this flag indicates to other optimizations that this branching instruction
75+should not be ``collapsed'' into a simpler branching construct. It is used
76+when the optimization to partition basic blocks into hot and cold sections
77+is turned on.
78+
79 @findex CONSTANT_POOL_ADDRESS_P
80 @cindex @code{symbol_ref} and @samp{/u}
81 @cindex @code{unchanging}, in @code{symbol_ref}
82@@ -577,37 +587,6 @@ In either case GCC assumes these addresses can be addressed directly,
83 perhaps with the help of base registers.
84 Stored in the @code{unchanging} field and printed as @samp{/u}.
85
86-@findex RTL_CONST_CALL_P
87-@cindex @code{call_insn} and @samp{/u}
88-@cindex @code{unchanging}, in @code{call_insn}
89-@item RTL_CONST_CALL_P (@var{x})
90-In a @code{call_insn} indicates that the insn represents a call to a
91-const function. Stored in the @code{unchanging} field and printed as
92-@samp{/u}.
93-
94-@findex RTL_PURE_CALL_P
95-@cindex @code{call_insn} and @samp{/i}
96-@cindex @code{return_val}, in @code{call_insn}
97-@item RTL_PURE_CALL_P (@var{x})
98-In a @code{call_insn} indicates that the insn represents a call to a
99-pure function. Stored in the @code{return_val} field and printed as
100-@samp{/i}.
101-
102-@findex RTL_CONST_OR_PURE_CALL_P
103-@cindex @code{call_insn} and @samp{/u} or @samp{/i}
104-@item RTL_CONST_OR_PURE_CALL_P (@var{x})
105-In a @code{call_insn}, true if @code{RTL_CONST_CALL_P} or
106-@code{RTL_PURE_CALL_P} is true.
107-
108-@findex RTL_LOOPING_CONST_OR_PURE_CALL_P
109-@cindex @code{call_insn} and @samp{/c}
110-@cindex @code{call}, in @code{call_insn}
111-@item RTL_LOOPING_CONST_OR_PURE_CALL_P (@var{x})
112-In a @code{call_insn} indicates that the insn represents a possibly
113-infinite looping call to a const or pure function. Stored in the
114-@code{call} field and printed as @samp{/c}. Only true if one of
115-@code{RTL_CONST_CALL_P} or @code{RTL_PURE_CALL_P} is true.
116-
117 @findex INSN_ANNULLED_BRANCH_P
118 @cindex @code{jump_insn} and @samp{/u}
119 @cindex @code{call_insn} and @samp{/u}
120@@ -702,6 +681,29 @@ Stored in the @code{call} field and printed as @samp{/c}.
121 Nonzero in a @code{mem} if the memory reference holds a pointer.
122 Stored in the @code{frame_related} field and printed as @samp{/f}.
123
124+@findex MEM_READONLY_P
125+@cindex @code{mem} and @samp{/u}
126+@cindex @code{unchanging}, in @code{mem}
127+@item MEM_READONLY_P (@var{x})
128+Nonzero in a @code{mem}, if the memory is statically allocated and read-only.
129+
130+Read-only in this context means never modified during the lifetime of the
131+program, not necessarily in ROM or in write-disabled pages. A common
132+example of the later is a shared library's global offset table. This
133+table is initialized by the runtime loader, so the memory is technically
134+writable, but after control is transferred from the runtime loader to the
135+application, this memory will never be subsequently modified.
136+
137+Stored in the @code{unchanging} field and printed as @samp{/u}.
138+
139+@findex PREFETCH_SCHEDULE_BARRIER_P
140+@cindex @code{prefetch} and @samp{/v}
141+@cindex @code{volatile}, in @code{prefetch}
142+@item PREFETCH_SCHEDULE_BARRIER_P (@var{x})
143+In a @code{prefetch}, indicates that the prefetch is a scheduling barrier.
144+No other INSNs will be moved over it.
145+Stored in the @code{volatil} field and printed as @samp{/v}.
146+
147 @findex REG_FUNCTION_VALUE_P
148 @cindex @code{reg} and @samp{/i}
149 @cindex @code{return_val}, in @code{reg}
150@@ -731,6 +733,37 @@ The same hard register may be used also for collecting the values of
151 functions called by this one, but @code{REG_FUNCTION_VALUE_P} is zero
152 in this kind of use.
153
154+@findex RTL_CONST_CALL_P
155+@cindex @code{call_insn} and @samp{/u}
156+@cindex @code{unchanging}, in @code{call_insn}
157+@item RTL_CONST_CALL_P (@var{x})
158+In a @code{call_insn} indicates that the insn represents a call to a
159+const function. Stored in the @code{unchanging} field and printed as
160+@samp{/u}.
161+
162+@findex RTL_PURE_CALL_P
163+@cindex @code{call_insn} and @samp{/i}
164+@cindex @code{return_val}, in @code{call_insn}
165+@item RTL_PURE_CALL_P (@var{x})
166+In a @code{call_insn} indicates that the insn represents a call to a
167+pure function. Stored in the @code{return_val} field and printed as
168+@samp{/i}.
169+
170+@findex RTL_CONST_OR_PURE_CALL_P
171+@cindex @code{call_insn} and @samp{/u} or @samp{/i}
172+@item RTL_CONST_OR_PURE_CALL_P (@var{x})
173+In a @code{call_insn}, true if @code{RTL_CONST_CALL_P} or
174+@code{RTL_PURE_CALL_P} is true.
175+
176+@findex RTL_LOOPING_CONST_OR_PURE_CALL_P
177+@cindex @code{call_insn} and @samp{/c}
178+@cindex @code{call}, in @code{call_insn}
179+@item RTL_LOOPING_CONST_OR_PURE_CALL_P (@var{x})
180+In a @code{call_insn} indicates that the insn represents a possibly
181+infinite looping call to a const or pure function. Stored in the
182+@code{call} field and printed as @samp{/c}. Only true if one of
183+@code{RTL_CONST_CALL_P} or @code{RTL_PURE_CALL_P} is true.
184+
185 @findex RTX_FRAME_RELATED_P
186 @cindex @code{insn} and @samp{/f}
187 @cindex @code{call_insn} and @samp{/f}
188@@ -765,21 +798,6 @@ computation performed by this instruction, i.e., one that
189 This flag is required for exception handling support on targets with RTL
190 prologues.
191
192-@findex MEM_READONLY_P
193-@cindex @code{mem} and @samp{/u}
194-@cindex @code{unchanging}, in @code{mem}
195-@item MEM_READONLY_P (@var{x})
196-Nonzero in a @code{mem}, if the memory is statically allocated and read-only.
197-
198-Read-only in this context means never modified during the lifetime of the
199-program, not necessarily in ROM or in write-disabled pages. A common
200-example of the later is a shared library's global offset table. This
201-table is initialized by the runtime loader, so the memory is technically
202-writable, but after control is transferred from the runtime loader to the
203-application, this memory will never be subsequently modified.
204-
205-Stored in the @code{unchanging} field and printed as @samp{/u}.
206-
207 @findex SCHED_GROUP_P
208 @cindex @code{insn} and @samp{/s}
209 @cindex @code{call_insn} and @samp{/s}
210@@ -879,14 +897,6 @@ Stored in the @code{volatil} field and printed as @samp{/v}.
211 Most uses of @code{SYMBOL_REF_FLAG} are historic and may be subsumed
212 by @code{SYMBOL_REF_FLAGS}. Certainly use of @code{SYMBOL_REF_FLAGS}
213 is mandatory if the target requires more than one bit of storage.
214-
215-@findex PREFETCH_SCHEDULE_BARRIER_P
216-@cindex @code{prefetch} and @samp{/v}
217-@cindex @code{volatile}, in @code{prefetch}
218-@item PREFETCH_SCHEDULE_BARRIER_P (@var{x})
219-In a @code{prefetch}, indicates that the prefetch is a scheduling barrier.
220-No other INSNs will be moved over it.
221-Stored in the @code{volatil} field and printed as @samp{/v}.
222 @end table
223
224 These are the fields to which the above macros refer:
225@@ -974,6 +985,8 @@ In a @code{set}, 1 means it is for a return.
226
227 In a @code{call_insn}, 1 means it is a sibling call.
228
229+In a @code{jump_insn}, 1 means it is a crossing jump.
230+
231 In an RTL dump, this flag is represented as @samp{/j}.
232
233 @findex unchanging
234@@ -3887,16 +3900,6 @@ multiple targets; the last label in the insn (in the highest numbered
235 insn-field) goes into the @code{JUMP_LABEL} field and does not have a
236 @code{REG_LABEL_TARGET} note. @xref{Insns, JUMP_LABEL}.
237
238-@findex REG_CROSSING_JUMP
239-@item REG_CROSSING_JUMP
240-This insn is a branching instruction (either an unconditional jump or
241-an indirect jump) which crosses between hot and cold sections, which
242-could potentially be very far apart in the executable. The presence
243-of this note indicates to other optimizations that this branching
244-instruction should not be ``collapsed'' into a simpler branching
245-construct. It is used when the optimization to partition basic blocks
246-into hot and cold sections is turned on.
247-
248 @findex REG_SETJMP
249 @item REG_SETJMP
250 Appears attached to each @code{CALL_INSN} to @code{setjmp} or a
251diff --git a/gcc/reorg.c b/gcc/reorg.c
252index 5914af6..77f3fe7 100644
253--- a/gcc/reorg.c
254+++ b/gcc/reorg.c
255@@ -3360,10 +3360,11 @@ relax_delay_slots (rtx_insn *first)
256 }
257
258 /* See if we have a simple (conditional) jump that is useless. */
259- if (! INSN_ANNULLED_BRANCH_P (delay_jump_insn)
260- && ! condjump_in_parallel_p (delay_jump_insn)
261+ if (!CROSSING_JUMP_P (delay_jump_insn)
262+ && !INSN_ANNULLED_BRANCH_P (delay_jump_insn)
263+ && !condjump_in_parallel_p (delay_jump_insn)
264 && prev_active_insn (as_a<rtx_insn *> (target_label)) == insn
265- && ! BARRIER_P (prev_nonnote_insn (as_a<rtx_insn *> (target_label)))
266+ && !BARRIER_P (prev_nonnote_insn (as_a<rtx_insn *> (target_label)))
267 /* If the last insn in the delay slot sets CC0 for some insn,
268 various code assumes that it is in a delay slot. We could
269 put it back where it belonged and delete the register notes,
270--
2711.8.5.6
272
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc-7.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
deleted file mode 100644
index 1af1c74e61..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
+++ /dev/null
@@ -1,42 +0,0 @@
1From 2fcf1e23ef4b2a5c93526f12212aa892595261f6 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 08:37:11 +0400
4Subject: [PATCH 01/47] gcc-4.3.1: ARCH_FLAGS_FOR_TARGET
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7
8Upstream-Status: Inappropriate [embedded specific]
9---
10 configure | 2 +-
11 configure.ac | 2 +-
12 2 files changed, 2 insertions(+), 2 deletions(-)
13
14diff --git a/configure b/configure
15index 32a38633ad8..b4760952085 100755
16--- a/configure
17+++ b/configure
18@@ -7472,7 +7472,7 @@ fi
19 # for target_alias and gcc doesn't manage it consistently.
20 target_configargs="--cache-file=./config.cache ${target_configargs}"
21
22-FLAGS_FOR_TARGET=
23+FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
24 case " $target_configdirs " in
25 *" newlib "*)
26 case " $target_configargs " in
27diff --git a/configure.ac b/configure.ac
28index 12377499295..176ebb921ed 100644
29--- a/configure.ac
30+++ b/configure.ac
31@@ -3065,7 +3065,7 @@ fi
32 # for target_alias and gcc doesn't manage it consistently.
33 target_configargs="--cache-file=./config.cache ${target_configargs}"
34
35-FLAGS_FOR_TARGET=
36+FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
37 case " $target_configdirs " in
38 *" newlib "*)
39 case " $target_configargs " in
40--
412.12.2
42
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0009-gcc-poison-system-directories.patch b/meta/recipes-devtools/gcc/gcc-7.3/0009-gcc-poison-system-directories.patch
deleted file mode 100644
index fe13ed6e2d..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0009-gcc-poison-system-directories.patch
+++ /dev/null
@@ -1,192 +0,0 @@
1From 4791a0a0f4595d0a18974f4e85a759a0789943db Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 08:59:00 +0400
4Subject: [PATCH 09/47] gcc: poison-system-directories
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7
8Upstream-Status: Inappropriate [distribution: codesourcery]
9---
10 gcc/common.opt | 4 ++++
11 gcc/config.in | 6 ++++++
12 gcc/configure | 16 ++++++++++++++++
13 gcc/configure.ac | 10 ++++++++++
14 gcc/doc/invoke.texi | 9 +++++++++
15 gcc/gcc.c | 2 ++
16 gcc/incpath.c | 19 +++++++++++++++++++
17 7 files changed, 66 insertions(+)
18
19diff --git a/gcc/common.opt b/gcc/common.opt
20index a5c3aeaa336..f02fe66367e 100644
21--- a/gcc/common.opt
22+++ b/gcc/common.opt
23@@ -662,6 +662,10 @@ Wreturn-local-addr
24 Common Var(warn_return_local_addr) Init(1) Warning
25 Warn about returning a pointer/reference to a local or temporary variable.
26
27+Wpoison-system-directories
28+Common Var(flag_poison_system_directories) Init(1) Warning
29+Warn for -I and -L options using system directories if cross compiling
30+
31 Wshadow
32 Common Var(warn_shadow) Warning
33 Warn when one variable shadows another. Same as -Wshadow=global.
34diff --git a/gcc/config.in b/gcc/config.in
35index bf2aa7b2e7d..b1203987e15 100644
36--- a/gcc/config.in
37+++ b/gcc/config.in
38@@ -194,6 +194,12 @@
39 #endif
40
41
42+/* Define to warn for use of native system header directories */
43+#ifndef USED_FOR_TARGET
44+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
45+#endif
46+
47+
48 /* Define if you want all operations on RTL (the basic data structure of the
49 optimizer and back end) to be checked for dynamic type safety at runtime.
50 This is quite expensive. */
51diff --git a/gcc/configure b/gcc/configure
52index c823ffe6290..4898f04fa6b 100755
53--- a/gcc/configure
54+++ b/gcc/configure
55@@ -949,6 +949,7 @@ with_system_zlib
56 enable_maintainer_mode
57 enable_link_mutex
58 enable_version_specific_runtime_libs
59+enable_poison_system_directories
60 enable_plugin
61 enable_host_shared
62 enable_libquadmath_support
63@@ -1691,6 +1692,8 @@ Optional Features:
64 --enable-version-specific-runtime-libs
65 specify that runtime libraries should be installed
66 in a compiler-specific directory
67+ --enable-poison-system-directories
68+ warn for use of native system header directories
69 --enable-plugin enable plugin support
70 --enable-host-shared build host code as shared libraries
71 --disable-libquadmath-support
72@@ -29347,6 +29350,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
73 fi
74
75
76+# Check whether --enable-poison-system-directories was given.
77+if test "${enable_poison_system_directories+set}" = set; then :
78+ enableval=$enable_poison_system_directories;
79+else
80+ enable_poison_system_directories=no
81+fi
82+
83+if test "x${enable_poison_system_directories}" = "xyes"; then
84+
85+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
86+
87+fi
88+
89 # Substitute configuration variables
90
91
92diff --git a/gcc/configure.ac b/gcc/configure.ac
93index acfe9797389..9dc1dc7fc96 100644
94--- a/gcc/configure.ac
95+++ b/gcc/configure.ac
96@@ -6101,6 +6101,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
97 [specify that runtime libraries should be
98 installed in a compiler-specific directory])])
99
100+AC_ARG_ENABLE([poison-system-directories],
101+ AS_HELP_STRING([--enable-poison-system-directories],
102+ [warn for use of native system header directories]),,
103+ [enable_poison_system_directories=no])
104+if test "x${enable_poison_system_directories}" = "xyes"; then
105+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
106+ [1],
107+ [Define to warn for use of native system header directories])
108+fi
109+
110 # Substitute configuration variables
111 AC_SUBST(subdirs)
112 AC_SUBST(srcdir)
113diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
114index 68a558e9992..060cd7169c6 100644
115--- a/gcc/doc/invoke.texi
116+++ b/gcc/doc/invoke.texi
117@@ -298,6 +298,7 @@ Objective-C and Objective-C++ Dialects}.
118 -Wpacked -Wpacked-bitfield-compat -Wpadded @gol
119 -Wparentheses -Wno-pedantic-ms-format @gol
120 -Wplacement-new -Wplacement-new=@var{n} @gol
121+-Wno-poison-system-directories @gol
122 -Wpointer-arith -Wpointer-compare -Wno-pointer-to-int-cast @gol
123 -Wno-pragmas -Wredundant-decls -Wrestrict -Wno-return-local-addr @gol
124 -Wreturn-type -Wsequence-point -Wshadow -Wno-shadow-ivar @gol
125@@ -5395,6 +5396,14 @@ made up of data only and thus requires no special treatment. But, for
126 most targets, it is made up of code and thus requires the stack to be
127 made executable in order for the program to work properly.
128
129+@item -Wno-poison-system-directories
130+@opindex Wno-poison-system-directories
131+Do not warn for @option{-I} or @option{-L} options using system
132+directories such as @file{/usr/include} when cross compiling. This
133+option is intended for use in chroot environments when such
134+directories contain the correct headers and libraries for the target
135+system rather than the host.
136+
137 @item -Wfloat-equal
138 @opindex Wfloat-equal
139 @opindex Wno-float-equal
140diff --git a/gcc/gcc.c b/gcc/gcc.c
141index c48178f..f63d53d 100644
142--- a/gcc/gcc.c
143+++ b/gcc/gcc.c
144@@ -1029,6 +1029,8 @@ proper position among the other output files. */
145 "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
146 "%X %{o*} %{e*} %{N} %{n} %{r}\
147 %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} \
148+ %{Wno-poison-system-directories:--no-poison-system-directories} \
149+ %{Werror=poison-system-directories:--error-poison-system-directories} \
150 %{static|no-pie:} %{L*} %(mfwrap) %(link_libgcc) " \
151 VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o " CHKP_SPEC " \
152 %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
153diff --git a/gcc/incpath.c b/gcc/incpath.c
154index 98fe5ec9ab3..f90e74dbd73 100644
155--- a/gcc/incpath.c
156+++ b/gcc/incpath.c
157@@ -26,6 +26,7 @@
158 #include "intl.h"
159 #include "incpath.h"
160 #include "cppdefault.h"
161+#include "diagnostic-core.h"
162
163 /* Microsoft Windows does not natively support inodes.
164 VMS has non-numeric inodes. */
165@@ -382,6 +383,24 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
166 }
167 fprintf (stderr, _("End of search list.\n"));
168 }
169+
170+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
171+ if (flag_poison_system_directories)
172+ {
173+ struct cpp_dir *p;
174+
175+ for (p = heads[QUOTE]; p; p = p->next)
176+ {
177+ if ((!strncmp (p->name, "/usr/include", 12))
178+ || (!strncmp (p->name, "/usr/local/include", 18))
179+ || (!strncmp (p->name, "/usr/X11R6/include", 18)))
180+ warning (OPT_Wpoison_system_directories,
181+ "include location \"%s\" is unsafe for "
182+ "cross-compilation",
183+ p->name);
184+ }
185+ }
186+#endif
187 }
188
189 /* Use given -I paths for #include "..." but not #include <...>, and
190--
1912.12.2
192
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0010-gcc-poison-dir-extend.patch b/meta/recipes-devtools/gcc/gcc-7.3/0010-gcc-poison-dir-extend.patch
deleted file mode 100644
index 4e06aa2f6a..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0010-gcc-poison-dir-extend.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1From e74ef84ad609b3b6a5c37d207ffc3c6e70d1f025 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:00:34 +0400
4Subject: [PATCH 10/47] gcc-poison-dir-extend
5
6Add /sw/include and /opt/include based on the original
7zecke-no-host-includes.patch patch. The original patch checked for
8/usr/include, /sw/include and /opt/include and then triggered a failure and
9aborted.
10
11Instead, we add the two missing items to the current scan. If the user
12wants this to be a failure, they can add "-Werror=poison-system-directories".
13
14Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16
17Upstream-Status: Pending
18---
19 gcc/incpath.c | 4 +++-
20 1 file changed, 3 insertions(+), 1 deletion(-)
21
22diff --git a/gcc/incpath.c b/gcc/incpath.c
23index f90e74dbd73..c583ee5061d 100644
24--- a/gcc/incpath.c
25+++ b/gcc/incpath.c
26@@ -393,7 +393,9 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
27 {
28 if ((!strncmp (p->name, "/usr/include", 12))
29 || (!strncmp (p->name, "/usr/local/include", 18))
30- || (!strncmp (p->name, "/usr/X11R6/include", 18)))
31+ || (!strncmp (p->name, "/usr/X11R6/include", 18))
32+ || (!strncmp (p->name, "/sw/include", 11))
33+ || (!strncmp (p->name, "/opt/include", 12)))
34 warning (OPT_Wpoison_system_directories,
35 "include location \"%s\" is unsafe for "
36 "cross-compilation",
37--
382.12.2
39
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0011-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc-7.3/0011-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
deleted file mode 100644
index b39ff1ec22..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0011-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
+++ /dev/null
@@ -1,73 +0,0 @@
1From a41d3a53a4e313c20802330d6b5c75358a4ed882 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:08:31 +0400
4Subject: [PATCH 11/47] gcc-4.3.3: SYSROOT_CFLAGS_FOR_TARGET
5
6Before committing, I noticed that PR/32161 was marked as a dup of PR/32009, but my previous patch did not fix it.
7
8This alternative patch is better because it lets you just use CFLAGS_FOR_TARGET to set the compilation flags for libgcc. Since bootstrapped target libraries are never compiled with the native compiler, it makes little sense to use different flags for stage1 and later stages. And it also makes little sense to use a different variable than CFLAGS_FOR_TARGET.
9
10Other changes I had to do include:
11
12- moving the creation of default CFLAGS_FOR_TARGET from Makefile.am to configure.ac, because otherwise the BOOT_CFLAGS are substituted into CFLAGS_FOR_TARGET (which is "-O2 -g $(CFLAGS)") via $(CFLAGS). It is also cleaner this way though.
13
14- passing the right CFLAGS to configure scripts as exported environment variables
15
16I also stopped passing LIBCFLAGS to configure scripts since they are unused in the whole src tree. And I updated the documentation as H-P reminded me to do.
17
18Bootstrapped/regtested i686-pc-linux-gnu, will commit to 4.4 shortly. Ok for 4.3?
19
20Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
21Signed-off-by: Khem Raj <raj.khem@gmail.com>
22
23Upstream-Status: Pending
24---
25 configure | 32 ++++++++++++++++++++++++++++++++
26 1 file changed, 32 insertions(+)
27
28diff --git a/configure b/configure
29index b4760952085..72a8ba94c4e 100755
30--- a/configure
31+++ b/configure
32@@ -6736,6 +6736,38 @@ fi
33
34
35
36+# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS
37+# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS
38+# might also be empty (or "-g", if a non-GCC C++ compiler is in the path).
39+# We want to ensure that TARGET libraries (which we know are built with
40+# gcc) are built with "-O2 -g", so include those options when setting
41+# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
42+if test "x$CFLAGS_FOR_TARGET" = x; then
43+ CFLAGS_FOR_TARGET=$CFLAGS
44+ case " $CFLAGS " in
45+ *" -O2 "*) ;;
46+ *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;;
47+ esac
48+ case " $CFLAGS " in
49+ *" -g "* | *" -g3 "*) ;;
50+ *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;;
51+ esac
52+fi
53+
54+
55+if test "x$CXXFLAGS_FOR_TARGET" = x; then
56+ CXXFLAGS_FOR_TARGET=$CXXFLAGS
57+ case " $CXXFLAGS " in
58+ *" -O2 "*) ;;
59+ *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;;
60+ esac
61+ case " $CXXFLAGS " in
62+ *" -g "* | *" -g3 "*) ;;
63+ *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;;
64+ esac
65+fi
66+
67+
68 # Handle --with-headers=XXX. If the value is not "yes", the contents of
69 # the named directory are copied to $(tooldir)/sys-include.
70 if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
71--
722.12.2
73
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0012-64-bit-multilib-hack.patch b/meta/recipes-devtools/gcc/gcc-7.3/0012-64-bit-multilib-hack.patch
deleted file mode 100644
index f3b39120b7..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0012-64-bit-multilib-hack.patch
+++ /dev/null
@@ -1,85 +0,0 @@
1From 3af9fbbd14e83242ac2acb54bbb4bb726845fd34 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:10:06 +0400
4Subject: [PATCH 12/47] 64-bit multilib hack.
5
6GCC has internal multilib handling code but it assumes a very specific rigid directory
7layout. The build system implementation of multilib layout is very generic and allows
8complete customisation of the library directories.
9
10This patch is a partial solution to allow any custom directories to be passed into gcc
11and handled correctly. It forces gcc to use the base_libdir (which is the current
12directory, "."). We need to do this for each multilib that is configured as we don't
13know which compiler options may be being passed into the compiler. Since we have a compiler
14per mulitlib at this point that isn't an issue.
15
16The one problem is the target compiler is only going to work for the default multlilib at
17this point. Ideally we'd figure out which multilibs were being enabled with which paths
18and be able to patch these entries with a complete set of correct paths but this we
19don't have such code at this point. This is something the target gcc recipe should do
20and override these platform defaults in its build config.
21
22RP 15/8/11
23
24Signed-off-by: Khem Raj <raj.khem@gmail.com>
25Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com>
26
27Upstream-Status: Pending
28---
29 gcc/config/i386/t-linux64 | 6 ++----
30 gcc/config/mips/t-linux64 | 10 +++-------
31 gcc/config/rs6000/t-linux64 | 5 ++---
32 3 files changed, 7 insertions(+), 14 deletions(-)
33
34diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
35index e422c442dae..cc885e24457 100644
36--- a/gcc/config/i386/t-linux64
37+++ b/gcc/config/i386/t-linux64
38@@ -32,7 +32,5 @@
39 #
40 comma=,
41 MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
42-MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
43-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
44-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
45-MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
46+MULTILIB_DIRNAMES = . .
47+MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
48diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64
49index 100f9da5e14..601cdf08d05 100644
50--- a/gcc/config/mips/t-linux64
51+++ b/gcc/config/mips/t-linux64
52@@ -17,10 +17,6 @@
53 # <http://www.gnu.org/licenses/>.
54
55 MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
56-MULTILIB_DIRNAMES = n32 32 64
57-MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
58-MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
59-MULTILIB_OSDIRNAMES = \
60- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
61- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
62- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
63+MULTILIB_DIRNAMES = . . .
64+MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
65+
66diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
67index 2830ed0d861..d057facd2fd 100644
68--- a/gcc/config/rs6000/t-linux64
69+++ b/gcc/config/rs6000/t-linux64
70@@ -26,10 +26,9 @@
71 # MULTILIB_OSDIRNAMES according to what is found on the target.
72
73 MULTILIB_OPTIONS := m64/m32
74-MULTILIB_DIRNAMES := 64 32
75+MULTILIB_DIRNAMES := . .
76 MULTILIB_EXTRA_OPTS :=
77-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
78-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
79+MULTILIB_OSDIRNAMES := ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
80
81 rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c
82 $(COMPILE) $<
83--
842.12.2
85
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0013-optional-libstdc.patch b/meta/recipes-devtools/gcc/gcc-7.3/0013-optional-libstdc.patch
deleted file mode 100644
index 3439bf67d0..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0013-optional-libstdc.patch
+++ /dev/null
@@ -1,125 +0,0 @@
1From 26a58d05844274915d011edbf9330c6151687b22 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:12:56 +0400
4Subject: [PATCH 13/47] optional libstdc
5
6gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++
7will not run correctly since by default the linker will try to link against libstdc++
8which shouldn't exist yet. We need an option to disable -lstdc++
9option whilst leaving -lc, -lgcc and other automatic library dependencies added by gcc
10driver. This patch adds such an option which only disables the -lstdc++.
11
12A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to
13do this officially, the likely answer is don't build libstdc++ separately.
14
15RP 29/6/10
16
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18
19Upstream-Status: Inappropriate [embedded specific]
20---
21 gcc/c-family/c.opt | 4 ++++
22 gcc/cp/g++spec.c | 1 +
23 gcc/doc/invoke.texi | 32 +++++++++++++++++++++++++++++++-
24 gcc/gcc.c | 1 +
25 4 files changed, 37 insertions(+), 1 deletion(-)
26
27diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
28index 9ad2f6e1fcc..c4ef7796282 100644
29--- a/gcc/c-family/c.opt
30+++ b/gcc/c-family/c.opt
31@@ -1848,6 +1848,10 @@ nostdinc++
32 C++ ObjC++
33 Do not search standard system include directories for C++.
34
35+nostdlib++
36+Driver
37+Do not link standard C++ runtime library
38+
39 o
40 C ObjC C++ ObjC++ Joined Separate
41 ; Documented in common.opt
42diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c
43index ffcc87c79c9..28d8a9cf530 100644
44--- a/gcc/cp/g++spec.c
45+++ b/gcc/cp/g++spec.c
46@@ -137,6 +137,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
47 switch (decoded_options[i].opt_index)
48 {
49 case OPT_nostdlib:
50+ case OPT_nostdlib__:
51 case OPT_nodefaultlibs:
52 library = -1;
53 break;
54diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
55index 060cd7169c6..8e2adc25644 100644
56--- a/gcc/doc/invoke.texi
57+++ b/gcc/doc/invoke.texi
58@@ -211,6 +211,9 @@ in the following sections.
59 -fno-weak -nostdinc++ @gol
60 -fvisibility-inlines-hidden @gol
61 -fvisibility-ms-compat @gol
62+-fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
63+-fvtv-counts -fvtv-debug @gol
64+-nostdlib++ @gol
65 -fext-numeric-literals @gol
66 -Wabi=@var{n} -Wabi-tag -Wconversion-null -Wctor-dtor-privacy @gol
67 -Wdelete-non-virtual-dtor -Wliteral-suffix -Wmultiple-inheritance @gol
68@@ -496,7 +499,7 @@ Objective-C and Objective-C++ Dialects}.
69 -s -static -static-libgcc -static-libstdc++ @gol
70 -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
71 -static-libmpx -static-libmpxwrappers @gol
72--shared -shared-libgcc -symbolic @gol
73+-shared -shared-libgcc -symbolic -nostdlib++ @gol
74 -T @var{script} -Wl,@var{option} -Xlinker @var{option} @gol
75 -u @var{symbol} -z @var{keyword}}
76
77@@ -11606,6 +11609,33 @@ library subroutines.
78 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
79 GNU Compiler Collection (GCC) Internals}.)
80
81+@item -nostdlib++
82+@opindex nostdlib++
83+Do not use the standard system C++ runtime libraries when linking.
84+Only the libraries you specify will be passed to the linker.
85+
86+@cindex @option{-lgcc}, use with @option{-nostdlib}
87+@cindex @option{-nostdlib} and unresolved references
88+@cindex unresolved references and @option{-nostdlib}
89+@cindex @option{-lgcc}, use with @option{-nodefaultlibs}
90+@cindex @option{-nodefaultlibs} and unresolved references
91+@cindex unresolved references and @option{-nodefaultlibs}
92+One of the standard libraries bypassed by @option{-nostdlib} and
93+@option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
94+which GCC uses to overcome shortcomings of particular machines, or special
95+needs for some languages.
96+(@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
97+Collection (GCC) Internals},
98+for more discussion of @file{libgcc.a}.)
99+In most cases, you need @file{libgcc.a} even when you want to avoid
100+other standard libraries. In other words, when you specify @option{-nostdlib}
101+or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
102+This ensures that you have no unresolved references to internal GCC
103+library subroutines.
104+(An example of such an internal subroutine is @code{__main}, used to ensure C++
105+constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
106+GNU Compiler Collection (GCC) Internals}.)
107+
108 @item -pie
109 @opindex pie
110 Produce a position independent executable on targets that support it.
111diff --git a/gcc/gcc.c b/gcc/gcc.c
112index 6315aa0dd16..a5fafbe5107 100644
113--- a/gcc/gcc.c
114+++ b/gcc/gcc.c
115@@ -1046,6 +1046,7 @@ proper position among the other output files. */
116 %(mflib) " STACK_SPLIT_SPEC "\
117 %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \
118 %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
119+ %{!nostdlib++:}\
120 %{!nostdlib:%{!nostartfiles:%E}} %{T*} \n%(post_link) }}}}}}"
121 #endif
122
123--
1242.12.2
125
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0014-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch b/meta/recipes-devtools/gcc/gcc-7.3/0014-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
deleted file mode 100644
index f92b5fbaaf..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0014-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
+++ /dev/null
@@ -1,59 +0,0 @@
1From 716de5db6859fd1ea21078c94a41fac7a885b7e9 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:14:20 +0400
4Subject: [PATCH 14/47] gcc: disable MASK_RELAX_PIC_CALLS bit
5
6The new feature added after 4.3.3
7"http://www.pubbs.net/200909/gcc/94048-patch-add-support-for-rmipsjalr.html"
8will cause cc1plus eat up all the system memory when build webkit-gtk.
9The function mips_get_pic_call_symbol keeps on recursively calling itself.
10Disable this feature to walk aside the bug.
11
12Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14
15Upstream-Status: Inappropriate [configuration]
16---
17 gcc/configure | 7 -------
18 gcc/configure.ac | 7 -------
19 2 files changed, 14 deletions(-)
20
21diff --git a/gcc/configure b/gcc/configure
22index 4898f04fa6b..640e4643805 100755
23--- a/gcc/configure
24+++ b/gcc/configure
25@@ -27303,13 +27303,6 @@ $as_echo_n "checking assembler and linker for explicit JALR relocation... " >&6;
26 rm -f conftest.*
27 fi
28 fi
29- if test $gcc_cv_as_ld_jalr_reloc = yes; then
30- if test x$target_cpu_default = x; then
31- target_cpu_default=MASK_RELAX_PIC_CALLS
32- else
33- target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS"
34- fi
35- fi
36 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ld_jalr_reloc" >&5
37 $as_echo "$gcc_cv_as_ld_jalr_reloc" >&6; }
38
39diff --git a/gcc/configure.ac b/gcc/configure.ac
40index 9dc1dc7fc96..9a2dae55ba2 100644
41--- a/gcc/configure.ac
42+++ b/gcc/configure.ac
43@@ -4641,13 +4641,6 @@ x:
44 rm -f conftest.*
45 fi
46 fi
47- if test $gcc_cv_as_ld_jalr_reloc = yes; then
48- if test x$target_cpu_default = x; then
49- target_cpu_default=MASK_RELAX_PIC_CALLS
50- else
51- target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS"
52- fi
53- fi
54 AC_MSG_RESULT($gcc_cv_as_ld_jalr_reloc)
55
56 AC_CACHE_CHECK([linker for .eh_frame personality relaxation],
57--
582.12.2
59
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0015-COLLECT_GCC_OPTIONS.patch b/meta/recipes-devtools/gcc/gcc-7.3/0015-COLLECT_GCC_OPTIONS.patch
deleted file mode 100644
index 6e62945e55..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0015-COLLECT_GCC_OPTIONS.patch
+++ /dev/null
@@ -1,38 +0,0 @@
1From 04a7a672301bb07caea6a7cad8378f63f1fe3200 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:16:28 +0400
4Subject: [PATCH 15/47] COLLECT_GCC_OPTIONS
5
6This patch adds --sysroot into COLLECT_GCC_OPTIONS which is used to
7invoke collect2.
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11Upstream-Status: Pending
12---
13 gcc/gcc.c | 9 +++++++++
14 1 file changed, 9 insertions(+)
15
16diff --git a/gcc/gcc.c b/gcc/gcc.c
17index a5fafbe5107..05896e19926 100644
18--- a/gcc/gcc.c
19+++ b/gcc/gcc.c
20@@ -4654,6 +4654,15 @@ set_collect_gcc_options (void)
21 sizeof ("COLLECT_GCC_OPTIONS=") - 1);
22
23 first_time = TRUE;
24+#ifdef HAVE_LD_SYSROOT
25+ if (target_system_root_changed && target_system_root)
26+ {
27+ obstack_grow (&collect_obstack, "'--sysroot=", sizeof("'--sysroot=")-1);
28+ obstack_grow (&collect_obstack, target_system_root,strlen(target_system_root));
29+ obstack_grow (&collect_obstack, "'", 1);
30+ first_time = FALSE;
31+ }
32+#endif
33 for (i = 0; (int) i < n_switches; i++)
34 {
35 const char *const *args;
36--
372.12.2
38
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0016-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch b/meta/recipes-devtools/gcc/gcc-7.3/0016-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
deleted file mode 100644
index 1991251c27..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0016-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
+++ /dev/null
@@ -1,96 +0,0 @@
1From 47071cbd4f13ff5a4974f71f359a04afcfb125da Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:17:25 +0400
4Subject: [PATCH 16/47] Use the defaults.h in ${B} instead of ${S}, and t-oe in
5 ${B}
6
7Use the defaults.h in ${B} instead of ${S}, and t-oe in ${B}, so that
8the source can be shared between gcc-cross-initial,
9gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build.
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12
13Upstream-Status: Pending
14
15While compiling gcc-crosssdk-initial-x86_64 on some host, there is
16occasionally failure that test the existance of default.h doesn't
17work, the reason is tm_include_list='** defaults.h' rather than
18tm_include_list='** ./defaults.h'
19
20So we add the test condition for this situation.
21Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
22---
23 gcc/Makefile.in | 2 +-
24 gcc/configure | 4 ++--
25 gcc/configure.ac | 4 ++--
26 gcc/mkconfig.sh | 4 ++--
27 4 files changed, 7 insertions(+), 7 deletions(-)
28
29diff --git a/gcc/Makefile.in b/gcc/Makefile.in
30index 2411671cea3..7b590c9bbd3 100644
31--- a/gcc/Makefile.in
32+++ b/gcc/Makefile.in
33@@ -532,7 +532,7 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
34 TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
35
36 xmake_file=@xmake_file@
37-tmake_file=@tmake_file@
38+tmake_file=@tmake_file@ ./t-oe
39 TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@
40 TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@
41 TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@
42diff --git a/gcc/configure b/gcc/configure
43index 640e4643805..b5ac1552541 100755
44--- a/gcc/configure
45+++ b/gcc/configure
46@@ -12150,8 +12150,8 @@ for f in $tm_file; do
47 tm_include_list="${tm_include_list} $f"
48 ;;
49 defaults.h )
50- tm_file_list="${tm_file_list} \$(srcdir)/$f"
51- tm_include_list="${tm_include_list} $f"
52+ tm_file_list="${tm_file_list} ./$f"
53+ tm_include_list="${tm_include_list} ./$f"
54 ;;
55 * )
56 tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
57diff --git a/gcc/configure.ac b/gcc/configure.ac
58index 9a2dae55ba2..cb1479d1ef4 100644
59--- a/gcc/configure.ac
60+++ b/gcc/configure.ac
61@@ -1922,8 +1922,8 @@ for f in $tm_file; do
62 tm_include_list="${tm_include_list} $f"
63 ;;
64 defaults.h )
65- tm_file_list="${tm_file_list} \$(srcdir)/$f"
66- tm_include_list="${tm_include_list} $f"
67+ tm_file_list="${tm_file_list} ./$f"
68+ tm_include_list="${tm_include_list} ./$f"
69 ;;
70 * )
71 tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
72diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
73index 9fc7b5ca734..04abecfe648 100644
74--- a/gcc/mkconfig.sh
75+++ b/gcc/mkconfig.sh
76@@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then
77 if [ $# -ge 1 ]; then
78 echo '#ifdef IN_GCC' >> ${output}T
79 for file in "$@"; do
80- if test x"$file" = x"defaults.h"; then
81+ if test x"$file" = x"./defaults.h" -o x"$file" = x"defaults.h"; then
82 postpone_defaults_h="yes"
83 else
84 echo "# include \"$file\"" >> ${output}T
85@@ -109,7 +109,7 @@ esac
86
87 # If we postponed including defaults.h, add the #include now.
88 if test x"$postpone_defaults_h" = x"yes"; then
89- echo "# include \"defaults.h\"" >> ${output}T
90+ echo "# include \"./defaults.h\"" >> ${output}T
91 fi
92
93 # Add multiple inclusion protection guard, part two.
94--
952.12.2
96
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0017-fortran-cross-compile-hack.patch b/meta/recipes-devtools/gcc/gcc-7.3/0017-fortran-cross-compile-hack.patch
deleted file mode 100644
index e2830c59d0..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0017-fortran-cross-compile-hack.patch
+++ /dev/null
@@ -1,46 +0,0 @@
1From 4fc35a2bb7666a7de35568eb5d47f0ce6acebe62 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:20:01 +0400
4Subject: [PATCH 17/47] fortran cross-compile hack.
5
6* Fortran would have searched for arm-angstrom-gnueabi-gfortran but would have used
7used gfortan. For gcc_4.2.2.bb we want to use the gfortran compiler from our cross
8directory.
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11
12Upstream-Status: Inappropriate [embedded specific]
13---
14 libgfortran/configure | 2 +-
15 libgfortran/configure.ac | 2 +-
16 2 files changed, 2 insertions(+), 2 deletions(-)
17
18diff --git a/libgfortran/configure b/libgfortran/configure
19index 81238fcb79c..7ded7abd456 100755
20--- a/libgfortran/configure
21+++ b/libgfortran/configure
22@@ -12792,7 +12792,7 @@ esac
23
24 # We need gfortran to compile parts of the library
25 #AC_PROG_FC(gfortran)
26-FC="$GFORTRAN"
27+#FC="$GFORTRAN"
28 ac_ext=${ac_fc_srcext-f}
29 ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
30 ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
31diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
32index 37b12d2998f..63a4166ef62 100644
33--- a/libgfortran/configure.ac
34+++ b/libgfortran/configure.ac
35@@ -243,7 +243,7 @@ AC_SUBST(enable_static)
36
37 # We need gfortran to compile parts of the library
38 #AC_PROG_FC(gfortran)
39-FC="$GFORTRAN"
40+#FC="$GFORTRAN"
41 AC_PROG_FC(gfortran)
42
43 # extra LD Flags which are required for targets
44--
452.12.2
46
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0018-cpp-honor-sysroot.patch b/meta/recipes-devtools/gcc/gcc-7.3/0018-cpp-honor-sysroot.patch
deleted file mode 100644
index 555907417a..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0018-cpp-honor-sysroot.patch
+++ /dev/null
@@ -1,54 +0,0 @@
1From 1c8a332469ca4bfefb10df70720e0dc83ff9a756 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:22:00 +0400
4Subject: [PATCH 18/47] cpp: honor sysroot.
5
6Currently, if the gcc toolchain is relocated and installed from sstate, then you try and compile
7preprocessed source (.i or .ii files), the compiler will try and access the builtin sysroot location
8rather than the --sysroot option specified on the commandline. If access to that directory is
9permission denied (unreadable), gcc will error.
10
11This happens when ccache is in use due to the fact it uses preprocessed source files.
12
13The fix below adds %I to the cpp-output spec macro so the default substitutions for -iprefix,
14-isystem, -isysroot happen and the correct sysroot is used.
15
16[YOCTO #2074]
17
18RP 2012/04/13
19
20Signed-off-by: Khem Raj <raj.khem@gmail.com>
21
22Upstream-Status: Pending
23---
24 gcc/cp/lang-specs.h | 2 +-
25 gcc/gcc.c | 2 +-
26 2 files changed, 2 insertions(+), 2 deletions(-)
27
28diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h
29index 6b383e1d86d..c7c7d6a56ec 100644
30--- a/gcc/cp/lang-specs.h
31+++ b/gcc/cp/lang-specs.h
32@@ -64,5 +64,5 @@ along with GCC; see the file COPYING3. If not see
33 {".ii", "@c++-cpp-output", 0, 0, 0},
34 {"@c++-cpp-output",
35 "%{!M:%{!MM:%{!E:\
36- cc1plus -fpreprocessed %i %(cc1_options) %2\
37+ cc1plus -fpreprocessed %i %I %(cc1_options) %2\
38 %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
39diff --git a/gcc/gcc.c b/gcc/gcc.c
40index 05896e19926..c73d4023987 100644
41--- a/gcc/gcc.c
42+++ b/gcc/gcc.c
43@@ -1351,7 +1351,7 @@ static const struct compiler default_compilers[] =
44 %W{o*:--output-pch=%*}}%V}}}}}}}", 0, 0, 0},
45 {".i", "@cpp-output", 0, 0, 0},
46 {"@cpp-output",
47- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
48+ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
49 {".s", "@assembler", 0, 0, 0},
50 {"@assembler",
51 "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0},
52--
532.12.2
54
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0019-MIPS64-Default-to-N64-ABI.patch b/meta/recipes-devtools/gcc/gcc-7.3/0019-MIPS64-Default-to-N64-ABI.patch
deleted file mode 100644
index 742a4012a5..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0019-MIPS64-Default-to-N64-ABI.patch
+++ /dev/null
@@ -1,57 +0,0 @@
1From 0a3b3cc45ea7ba83b46df7464b41c377e3966d88 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:23:08 +0400
4Subject: [PATCH 19/47] MIPS64: Default to N64 ABI
5
6MIPS64 defaults to n32 ABI, this patch makes it
7so that it defaults to N64 ABI
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11Upstream-Status: Inappropriate [OE config specific]
12---
13 gcc/config.gcc | 10 +++++-----
14 1 file changed, 5 insertions(+), 5 deletions(-)
15
16diff --git a/gcc/config.gcc b/gcc/config.gcc
17index b8bb4d65825..5e45f4b5199 100644
18--- a/gcc/config.gcc
19+++ b/gcc/config.gcc
20@@ -2084,29 +2084,29 @@ mips*-*-linux*) # Linux MIPS, either endian.
21 default_mips_arch=mips32
22 ;;
23 mips64el-st-linux-gnu)
24- default_mips_abi=n32
25+ default_mips_abi=64
26 tm_file="${tm_file} mips/st.h"
27 tmake_file="${tmake_file} mips/t-st"
28 enable_mips_multilibs="yes"
29 ;;
30 mips64octeon*-*-linux*)
31- default_mips_abi=n32
32+ default_mips_abi=64
33 tm_defines="${tm_defines} MIPS_CPU_STRING_DEFAULT=\\\"octeon\\\""
34 target_cpu_default=MASK_SOFT_FLOAT_ABI
35 enable_mips_multilibs="yes"
36 ;;
37 mipsisa64r6*-*-linux*)
38- default_mips_abi=n32
39+ default_mips_abi=64
40 default_mips_arch=mips64r6
41 enable_mips_multilibs="yes"
42 ;;
43 mipsisa64r2*-*-linux*)
44- default_mips_abi=n32
45+ default_mips_abi=64
46 default_mips_arch=mips64r2
47 enable_mips_multilibs="yes"
48 ;;
49 mips64*-*-linux* | mipsisa64*-*-linux*)
50- default_mips_abi=n32
51+ default_mips_abi=64
52 enable_mips_multilibs="yes"
53 ;;
54 esac
55--
562.12.2
57
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0020-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch b/meta/recipes-devtools/gcc/gcc-7.3/0020-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
deleted file mode 100644
index de7b4df572..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0020-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
+++ /dev/null
@@ -1,234 +0,0 @@
1From d6c983b685ee03e9cf21189108d31ed9f760ff3f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:24:50 +0400
4Subject: [PATCH 20/47] Define GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER
5 relative to SYSTEMLIBS_DIR
6
7This patch defines GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER
8relative to SYSTEMLIBS_DIR which can be set in generated headers
9This breaks the assumption of hardcoded multilib in gcc
10Change is only for the supported architectures in OE including
11SH, sparc, alpha for possible future support (if any)
12
13Removes the do_headerfix task in metadata
14
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16
17Upstream-Status: Inappropriate [OE configuration]
18---
19 gcc/config/alpha/linux-elf.h | 4 ++--
20 gcc/config/arm/linux-eabi.h | 4 ++--
21 gcc/config/arm/linux-elf.h | 2 +-
22 gcc/config/i386/linux.h | 2 +-
23 gcc/config/i386/linux64.h | 6 +++---
24 gcc/config/linux.h | 8 ++++----
25 gcc/config/mips/linux.h | 12 ++++++------
26 gcc/config/rs6000/linux64.h | 16 ++++++----------
27 gcc/config/sh/linux.h | 2 +-
28 gcc/config/sparc/linux.h | 2 +-
29 gcc/config/sparc/linux64.h | 4 ++--
30 11 files changed, 29 insertions(+), 33 deletions(-)
31
32diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
33index 2c39fbe601c..6d88e21abe2 100644
34--- a/gcc/config/alpha/linux-elf.h
35+++ b/gcc/config/alpha/linux-elf.h
36@@ -23,8 +23,8 @@ along with GCC; see the file COPYING3. If not see
37 #define EXTRA_SPECS \
38 { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
39
40-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
41-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
42+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
43+#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0"
44 #if DEFAULT_LIBC == LIBC_UCLIBC
45 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
46 #elif DEFAULT_LIBC == LIBC_GLIBC
47diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
48index a08cfb34377..fbac9a9d994 100644
49--- a/gcc/config/arm/linux-eabi.h
50+++ b/gcc/config/arm/linux-eabi.h
51@@ -62,8 +62,8 @@
52 GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */
53
54 #undef GLIBC_DYNAMIC_LINKER
55-#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3"
56-#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3"
57+#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT SYSTEMLIBS_DIR "ld-linux.so.3"
58+#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT SYSTEMLIBS_DIR "ld-linux-armhf.so.3"
59 #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
60
61 #define GLIBC_DYNAMIC_LINKER \
62diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
63index 3d62367ae68..e8a16191849 100644
64--- a/gcc/config/arm/linux-elf.h
65+++ b/gcc/config/arm/linux-elf.h
66@@ -60,7 +60,7 @@
67
68 #define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
69
70-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
71+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
72
73 #define LINUX_TARGET_LINK_SPEC "%{h*} \
74 %{static:-Bstatic} \
75diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
76index 59132124d6b..336d158629c 100644
77--- a/gcc/config/i386/linux.h
78+++ b/gcc/config/i386/linux.h
79@@ -20,7 +20,7 @@ along with GCC; see the file COPYING3. If not see
80 <http://www.gnu.org/licenses/>. */
81
82 #define GNU_USER_LINK_EMULATION "elf_i386"
83-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
84+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
85
86 #undef MUSL_DYNAMIC_LINKER
87 #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
88diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
89index e65c404ff91..c34ded98481 100644
90--- a/gcc/config/i386/linux64.h
91+++ b/gcc/config/i386/linux64.h
92@@ -27,9 +27,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
93 #define GNU_USER_LINK_EMULATION64 "elf_x86_64"
94 #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
95
96-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
97-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
98-#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
99+#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
100+#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux-x86-64.so.2"
101+#define GLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-linux-x32.so.2"
102
103 #undef MUSL_DYNAMIC_LINKER32
104 #define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
105diff --git a/gcc/config/linux.h b/gcc/config/linux.h
106index b3a9e85e77f..2e683d0c430 100644
107--- a/gcc/config/linux.h
108+++ b/gcc/config/linux.h
109@@ -81,10 +81,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
110 GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
111 GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets
112 supporting both 32-bit and 64-bit compilation. */
113-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
114-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
115-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
116-#define UCLIBC_DYNAMIC_LINKERX32 "/lib/ldx32-uClibc.so.0"
117+#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0"
118+#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
119+#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
120+#define UCLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ldx32-uClibc.so.0"
121 #define BIONIC_DYNAMIC_LINKER "/system/bin/linker"
122 #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
123 #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
124diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
125index 44132b8e44d..80505ad9f48 100644
126--- a/gcc/config/mips/linux.h
127+++ b/gcc/config/mips/linux.h
128@@ -22,20 +22,20 @@ along with GCC; see the file COPYING3. If not see
129 #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32"
130
131 #define GLIBC_DYNAMIC_LINKER32 \
132- "%{mnan=2008:/lib/ld-linux-mipsn8.so.1;:/lib/ld.so.1}"
133+ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
134 #define GLIBC_DYNAMIC_LINKER64 \
135- "%{mnan=2008:/lib64/ld-linux-mipsn8.so.1;:/lib64/ld.so.1}"
136+ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
137 #define GLIBC_DYNAMIC_LINKERN32 \
138- "%{mnan=2008:/lib32/ld-linux-mipsn8.so.1;:/lib32/ld.so.1}"
139+ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
140
141 #undef UCLIBC_DYNAMIC_LINKER32
142 #define UCLIBC_DYNAMIC_LINKER32 \
143- "%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}"
144+ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
145 #undef UCLIBC_DYNAMIC_LINKER64
146 #define UCLIBC_DYNAMIC_LINKER64 \
147- "%{mnan=2008:/lib/ld64-uClibc-mipsn8.so.0;:/lib/ld64-uClibc.so.0}"
148+ "%{mnan=2008:" SYSTEMLIBS_DIR "ld64-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld64-uClibc.so.0}"
149 #define UCLIBC_DYNAMIC_LINKERN32 \
150- "%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}"
151+ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
152
153 #undef MUSL_DYNAMIC_LINKER32
154 #define MUSL_DYNAMIC_LINKER32 \
155diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
156index 71e35b709ad..3b00ec0fcf0 100644
157--- a/gcc/config/rs6000/linux64.h
158+++ b/gcc/config/rs6000/linux64.h
159@@ -412,16 +412,11 @@ extern int dot_symbols;
160 #undef LINK_OS_DEFAULT_SPEC
161 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
162
163-#define GLIBC_DYNAMIC_LINKER32 "%(dynamic_linker_prefix)/lib/ld.so.1"
164-
165+#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld.so.1"
166 #ifdef LINUX64_DEFAULT_ABI_ELFv2
167-#define GLIBC_DYNAMIC_LINKER64 \
168-"%{mabi=elfv1:%(dynamic_linker_prefix)/lib64/ld64.so.1;" \
169-":%(dynamic_linker_prefix)/lib64/ld64.so.2}"
170+#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:" SYSTEMLIBS_DIR "ld64.so.1;:" SYSTEMLIBS_DIR "ld64.so.2}"
171 #else
172-#define GLIBC_DYNAMIC_LINKER64 \
173-"%{mabi=elfv2:%(dynamic_linker_prefix)/lib64/ld64.so.2;" \
174-":%(dynamic_linker_prefix)/lib64/ld64.so.1}"
175+#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:" SYSTEMLIBS_DIR "ld64.so.2;:" SYSTEMLIBS_DIR "ld64.so.1}"
176 #endif
177
178 #define MUSL_DYNAMIC_LINKER32 \
179@@ -429,8 +424,9 @@ extern int dot_symbols;
180 #define MUSL_DYNAMIC_LINKER64 \
181 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
182
183-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
184-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
185+#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
186+#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
187+
188 #if DEFAULT_LIBC == LIBC_UCLIBC
189 #define CHOOSE_DYNAMIC_LINKER(G, U, M) \
190 "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
191diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h
192index c30083423f2..196b82725f8 100644
193--- a/gcc/config/sh/linux.h
194+++ b/gcc/config/sh/linux.h
195@@ -64,7 +64,7 @@ along with GCC; see the file COPYING3. If not see
196 "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E MUSL_DYNAMIC_LINKER_FP \
197 "%{mfdpic:-fdpic}.so.1"
198
199-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
200+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
201
202 #undef SUBTARGET_LINK_EMUL_SUFFIX
203 #define SUBTARGET_LINK_EMUL_SUFFIX "%{mfdpic:_fd;:_linux}"
204diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
205index ce084656fca..bed6300cb2a 100644
206--- a/gcc/config/sparc/linux.h
207+++ b/gcc/config/sparc/linux.h
208@@ -83,7 +83,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
209 When the -shared link option is used a final link is not being
210 done. */
211
212-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
213+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
214
215 #undef LINK_SPEC
216 #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
217diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
218index 573ce8a9a4c..6749f6b5d9c 100644
219--- a/gcc/config/sparc/linux64.h
220+++ b/gcc/config/sparc/linux64.h
221@@ -84,8 +84,8 @@ along with GCC; see the file COPYING3. If not see
222 When the -shared link option is used a final link is not being
223 done. */
224
225-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
226-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
227+#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
228+#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux.so.2"
229
230 #ifdef SPARC_BI_ARCH
231
232--
2332.12.2
234
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0021-gcc-Fix-argument-list-too-long-error.patch b/meta/recipes-devtools/gcc/gcc-7.3/0021-gcc-Fix-argument-list-too-long-error.patch
deleted file mode 100644
index 4e562144e3..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0021-gcc-Fix-argument-list-too-long-error.patch
+++ /dev/null
@@ -1,40 +0,0 @@
1From 80c24247fed52c1269791088090bc0fa85280983 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:26:37 +0400
4Subject: [PATCH 21/47] gcc: Fix argument list too long error.
5
6There would be an "Argument list too long" error when the
7build directory is longer than 200, this is caused by:
8
9headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`
10
11The PLUGIN_HEADERS is too long before sort, so the "echo" can't handle
12it, use the $(sort list) of GNU make which can handle the too long list
13would fix the problem, the header would be short enough after sorted.
14The "tr ' ' '\012'" was used for translating the space to "\n", the
15$(sort list) doesn't need this.
16
17Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19
20Upstream-Status: Pending
21---
22 gcc/Makefile.in | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
25diff --git a/gcc/Makefile.in b/gcc/Makefile.in
26index 7b590c9bbd3..23cca7f0d5a 100644
27--- a/gcc/Makefile.in
28+++ b/gcc/Makefile.in
29@@ -3459,7 +3459,7 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
30 # We keep the directory structure for files in config or c-family and .def
31 # files. All other files are flattened to a single directory.
32 $(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
33- headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
34+ headers="$(sort $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def))"; \
35 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
36 for file in $$headers; do \
37 if [ -f $$file ] ; then \
38--
392.12.2
40
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0022-Disable-sdt.patch b/meta/recipes-devtools/gcc/gcc-7.3/0022-Disable-sdt.patch
deleted file mode 100644
index 871f195c94..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0022-Disable-sdt.patch
+++ /dev/null
@@ -1,113 +0,0 @@
1From 3021fec485f44478a3d5fffb4adac13d831fcdc1 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:28:10 +0400
4Subject: [PATCH 22/47] Disable sdt.
5
6We don't list dtrace in DEPENDS so we shouldn't be depending on this header.
7It may or may not exist from preivous builds though. To be determinstic, disable
8sdt.h usage always. This avoids build failures if the header is removed after configure
9but before libgcc is compiled for example.
10
11RP 2012/8/7
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14
15Disable sdt for libstdc++-v3.
16
17Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
18
19Upstream-Status: Inappropriate [hack]
20---
21 gcc/configure | 12 ++++++------
22 gcc/configure.ac | 18 +++++++++---------
23 libstdc++-v3/configure | 6 +++---
24 libstdc++-v3/configure.ac | 2 +-
25 4 files changed, 19 insertions(+), 19 deletions(-)
26
27diff --git a/gcc/configure b/gcc/configure
28index b5ac1552541..08b2f63c7fa 100755
29--- a/gcc/configure
30+++ b/gcc/configure
31@@ -28967,12 +28967,12 @@ fi
32 { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
33 $as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
34 have_sys_sdt_h=no
35-if test -f $target_header_dir/sys/sdt.h; then
36- have_sys_sdt_h=yes
37-
38-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
39-
40-fi
41+#if test -f $target_header_dir/sys/sdt.h; then
42+# have_sys_sdt_h=yes
43+#
44+#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
45+#
46+#fi
47 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
48 $as_echo "$have_sys_sdt_h" >&6; }
49
50diff --git a/gcc/configure.ac b/gcc/configure.ac
51index cb1479d1ef4..0581fe963dc 100644
52--- a/gcc/configure.ac
53+++ b/gcc/configure.ac
54@@ -5754,15 +5754,15 @@ fi
55 AC_SUBST([enable_default_ssp])
56
57 # Test for <sys/sdt.h> on the target.
58-GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
59-AC_MSG_CHECKING(sys/sdt.h in the target C library)
60-have_sys_sdt_h=no
61-if test -f $target_header_dir/sys/sdt.h; then
62- have_sys_sdt_h=yes
63- AC_DEFINE(HAVE_SYS_SDT_H, 1,
64- [Define if your target C library provides sys/sdt.h])
65-fi
66-AC_MSG_RESULT($have_sys_sdt_h)
67+#GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
68+#AC_MSG_CHECKING(sys/sdt.h in the target C library)
69+#have_sys_sdt_h=no
70+#if test -f $target_header_dir/sys/sdt.h; then
71+# have_sys_sdt_h=yes
72+# AC_DEFINE(HAVE_SYS_SDT_H, 1,
73+# [Define if your target C library provides sys/sdt.h])
74+#fi
75+#AC_MSG_RESULT($have_sys_sdt_h)
76
77 # Check if TFmode long double should be used by default or not.
78 # Some glibc targets used DFmode long double, but with glibc 2.4
79diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
80index fb7e126c0b0..a18057feb88 100755
81--- a/libstdc++-v3/configure
82+++ b/libstdc++-v3/configure
83@@ -21856,11 +21856,11 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
84 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
85 ac_compiler_gnu=$ac_cv_c_compiler_gnu
86
87- if test $glibcxx_cv_sys_sdt_h = yes; then
88+# if test $glibcxx_cv_sys_sdt_h = yes; then
89
90-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
91+#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
92
93- fi
94+# fi
95 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_sys_sdt_h" >&5
96 $as_echo "$glibcxx_cv_sys_sdt_h" >&6; }
97
98diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
99index 8e973503be0..a46d25e740d 100644
100--- a/libstdc++-v3/configure.ac
101+++ b/libstdc++-v3/configure.ac
102@@ -230,7 +230,7 @@ GLIBCXX_CHECK_SC_NPROCESSORS_ONLN
103 GLIBCXX_CHECK_SC_NPROC_ONLN
104 GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP
105 GLIBCXX_CHECK_SYSCTL_HW_NCPU
106-GLIBCXX_CHECK_SDT_H
107+#GLIBCXX_CHECK_SDT_H
108
109 # Check for available headers.
110 AC_CHECK_HEADERS([endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \
111--
1122.12.2
113
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0023-libtool.patch b/meta/recipes-devtools/gcc/gcc-7.3/0023-libtool.patch
deleted file mode 100644
index 27dfb1fdd1..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0023-libtool.patch
+++ /dev/null
@@ -1,42 +0,0 @@
1From e79a4f8169e836c8deabca5a45884cfe11d07847 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:29:11 +0400
4Subject: [PATCH 23/47] libtool
5
6libstdc++ from gcc-runtime gets created with -rpath=/usr/lib/../lib for qemux86-64
7when running on am x86_64 build host.
8
9This patch stops this speading to libdir in the libstdc++.la file within libtool.
10Arguably, it shouldn't be passing this into libtool in the first place but
11for now this resolves the nastiest problems this causes.
12
13func_normal_abspath would resolve an empty path to `pwd` so we need
14to filter the zero case.
15
16RP 2012/8/24
17
18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19
20Upstream-Status: Pending
21---
22 ltmain.sh | 4 ++++
23 1 file changed, 4 insertions(+)
24
25diff --git a/ltmain.sh b/ltmain.sh
26index 9503ec85d70..0121fba707f 100644
27--- a/ltmain.sh
28+++ b/ltmain.sh
29@@ -6359,6 +6359,10 @@ func_mode_link ()
30 func_warning "ignoring multiple \`-rpath's for a libtool library"
31
32 install_libdir="$1"
33+ if test -n "$install_libdir"; then
34+ func_normal_abspath "$install_libdir"
35+ install_libdir=$func_normal_abspath_result
36+ fi
37
38 oldlibs=
39 if test -z "$rpath"; then
40--
412.12.2
42
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0024-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch b/meta/recipes-devtools/gcc/gcc-7.3/0024-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
deleted file mode 100644
index aa1e1bb8b1..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0024-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From 74d8dc48cb185e304c60067b4d8b50447ec328ec Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:30:32 +0400
4Subject: [PATCH 24/47] gcc: armv4: pass fix-v4bx to linker to support EABI.
5
6The LINK_SPEC for linux gets overwritten by linux-eabi.h which
7means the value of TARGET_FIX_V4BX_SPEC gets lost and as a result
8the option is not passed to linker when chosing march=armv4
9This patch redefines this in linux-eabi.h and reinserts it
10for eabi defaulting toolchains.
11
12We might want to send it upstream.
13
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15
16Upstream-Status: Pending
17---
18 gcc/config/arm/linux-eabi.h | 6 +++++-
19 1 file changed, 5 insertions(+), 1 deletion(-)
20
21diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
22index fbac9a9d994..5a51a8a7095 100644
23--- a/gcc/config/arm/linux-eabi.h
24+++ b/gcc/config/arm/linux-eabi.h
25@@ -88,10 +88,14 @@
26 #define MUSL_DYNAMIC_LINKER \
27 "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
28
29+/* For armv4 we pass --fix-v4bx to linker to support EABI */
30+#undef TARGET_FIX_V4BX_SPEC
31+#define TARGET_FIX_V4BX_SPEC "%{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4: --fix-v4bx}"
32+
33 /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
34 use the GNU/Linux version, not the generic BPABI version. */
35 #undef LINK_SPEC
36-#define LINK_SPEC EABI_LINK_SPEC \
37+#define LINK_SPEC TARGET_FIX_V4BX_SPEC EABI_LINK_SPEC \
38 LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \
39 LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
40
41--
422.12.2
43
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0025-Use-the-multilib-config-files-from-B-instead-of-usin.patch b/meta/recipes-devtools/gcc/gcc-7.3/0025-Use-the-multilib-config-files-from-B-instead-of-usin.patch
deleted file mode 100644
index b234132317..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0025-Use-the-multilib-config-files-from-B-instead-of-usin.patch
+++ /dev/null
@@ -1,102 +0,0 @@
1From ac50dc3010a66220ad483c09efe270bb3f4c9424 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:33:04 +0400
4Subject: [PATCH 25/47] Use the multilib config files from ${B} instead of
5 using the ones from ${S}
6
7Use the multilib config files from ${B} instead of using the ones from ${S}
8so that the source can be shared between gcc-cross-initial,
9gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build.
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
13
14Upstream-Status: Inappropriate [configuration]
15---
16 gcc/configure | 22 ++++++++++++++++++----
17 gcc/configure.ac | 22 ++++++++++++++++++----
18 2 files changed, 36 insertions(+), 8 deletions(-)
19
20diff --git a/gcc/configure b/gcc/configure
21index 08b2f63c7fa..6ba391ed068 100755
22--- a/gcc/configure
23+++ b/gcc/configure
24@@ -12130,10 +12130,20 @@ done
25 tmake_file_=
26 for f in ${tmake_file}
27 do
28- if test -f ${srcdir}/config/$f
29- then
30- tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
31- fi
32+ case $f in
33+ */t-linux64 )
34+ if test -f ./config/$f
35+ then
36+ tmake_file_="${tmake_file_} ./config/$f"
37+ fi
38+ ;;
39+ * )
40+ if test -f ${srcdir}/config/$f
41+ then
42+ tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
43+ fi
44+ ;;
45+ esac
46 done
47 tmake_file="${tmake_file_}"
48
49@@ -12144,6 +12154,10 @@ tm_file_list="options.h"
50 tm_include_list="options.h insn-constants.h"
51 for f in $tm_file; do
52 case $f in
53+ */linux64.h )
54+ tm_file_list="${tm_file_list} ./config/$f"
55+ tm_include_list="${tm_include_list} ./config/$f"
56+ ;;
57 ./* )
58 f=`echo $f | sed 's/^..//'`
59 tm_file_list="${tm_file_list} $f"
60diff --git a/gcc/configure.ac b/gcc/configure.ac
61index 0581fe963dc..8551a412df3 100644
62--- a/gcc/configure.ac
63+++ b/gcc/configure.ac
64@@ -1902,10 +1902,20 @@ done
65 tmake_file_=
66 for f in ${tmake_file}
67 do
68- if test -f ${srcdir}/config/$f
69- then
70- tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
71- fi
72+ case $f in
73+ */t-linux64 )
74+ if test -f ./config/$f
75+ then
76+ tmake_file_="${tmake_file_} ./config/$f"
77+ fi
78+ ;;
79+ * )
80+ if test -f ${srcdir}/config/$f
81+ then
82+ tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
83+ fi
84+ ;;
85+ esac
86 done
87 tmake_file="${tmake_file_}"
88
89@@ -1916,6 +1926,10 @@ tm_file_list="options.h"
90 tm_include_list="options.h insn-constants.h"
91 for f in $tm_file; do
92 case $f in
93+ */linux64.h )
94+ tm_file_list="${tm_file_list} ./config/$f"
95+ tm_include_list="${tm_include_list} ./config/$f"
96+ ;;
97 ./* )
98 f=`echo $f | sed 's/^..//'`
99 tm_file_list="${tm_file_list} $f"
100--
1012.12.2
102
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0026-Avoid-using-libdir-from-.la-which-usually-points-to-.patch b/meta/recipes-devtools/gcc/gcc-7.3/0026-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
deleted file mode 100644
index fe24713474..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0026-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1From 9fab47d8662986ad887d9eddc39fcbe25e576383 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 20 Feb 2015 09:39:38 +0000
4Subject: [PATCH 26/47] Avoid using libdir from .la which usually points to a
5 host path
6
7Upstream-Status: Inappropriate [embedded specific]
8
9Signed-off-by: Jonathan Liu <net147@gmail.com>
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 ltmain.sh | 3 +++
13 1 file changed, 3 insertions(+)
14
15diff --git a/ltmain.sh b/ltmain.sh
16index 0121fba707f..52bdbdb5f9c 100644
17--- a/ltmain.sh
18+++ b/ltmain.sh
19@@ -5628,6 +5628,9 @@ func_mode_link ()
20 absdir="$abs_ladir"
21 libdir="$abs_ladir"
22 else
23+ # Instead of using libdir from .la which usually points to a host path,
24+ # use the path the .la is contained in.
25+ libdir="$abs_ladir"
26 dir="$libdir"
27 absdir="$libdir"
28 fi
29--
302.12.2
31
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0027-export-CPP.patch b/meta/recipes-devtools/gcc/gcc-7.3/0027-export-CPP.patch
deleted file mode 100644
index 4f9e1f0b2e..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0027-export-CPP.patch
+++ /dev/null
@@ -1,53 +0,0 @@
1From fa6a46fdf73de7eacd289c084bbde6643b23f73b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 20 Feb 2015 09:40:59 +0000
4Subject: [PATCH 27/47] export CPP
5
6The OE environment sets and exports CPP as being the target gcc. When
7building gcc-cross-canadian for a mingw targetted sdk, the following can be found
8in build.x86_64-pokysdk-mingw32.i586-poky-linux/build-x86_64-linux/libiberty/config.log:
9
10configure:3641: checking for _FILE_OFFSET_BITS value needed for large files
11configure:3666: gcc -c -isystem/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe conftest.c >&5
12configure:3666: $? = 0
13configure:3698: result: no
14configure:3786: checking how to run the C preprocessor
15configure:3856: result: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32
16configure:3876: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32 conftest.c
17configure:3876: $? = 0
18
19Note this is a *build* target (in build-x86_64-linux) so it should be
20using the host "gcc", not x86_64-pokysdk-mingw32-gcc. Since the mingw32
21headers are very different, using the wrong cpp is a real problem. It is leaking
22into configure through the CPP variable. Ultimately this leads to build
23failures related to not being able to include a process.h file for pem-unix.c.
24
25The fix is to ensure we export a sane CPP value into the build
26environment when using build targets. We could define a CPP_FOR_BUILD value which may be
27the version which needs to be upstreamed but for now, this fix is good enough to
28avoid the problem.
29
30RP 22/08/2013
31
32Upstream-Status: Pending
33
34Signed-off-by: Khem Raj <raj.khem@gmail.com>
35---
36 Makefile.in | 1 +
37 1 file changed, 1 insertion(+)
38
39diff --git a/Makefile.in b/Makefile.in
40index b824e0a0ca1..e34e9555388 100644
41--- a/Makefile.in
42+++ b/Makefile.in
43@@ -149,6 +149,7 @@ BUILD_EXPORTS = \
44 AR="$(AR_FOR_BUILD)"; export AR; \
45 AS="$(AS_FOR_BUILD)"; export AS; \
46 CC="$(CC_FOR_BUILD)"; export CC; \
47+ CPP="$(CC_FOR_BUILD) -E"; export CPP; \
48 CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
49 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
50 CXX="$(CXX_FOR_BUILD)"; export CXX; \
51--
522.12.2
53
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0028-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch b/meta/recipes-devtools/gcc/gcc-7.3/0028-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
deleted file mode 100644
index b903349d5d..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0028-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
+++ /dev/null
@@ -1,56 +0,0 @@
1From 2c05b4072f982df8002d61327837e18a724e934f Mon Sep 17 00:00:00 2001
2From: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
3Date: Wed, 5 Feb 2014 16:52:31 +0200
4Subject: [PATCH 28/47] Enable SPE & AltiVec generation on powepc*linux target
5
6When is configured with --target=powerpc-linux, the resulting GCC will
7not be able to generate code for SPE targets (e500v1/v2).
8GCC configured with --target=powerpc-linuxspe will not be able to
9generate AltiVec instructions (for e6500).
10This patch modifies the configured file such that SPE or AltiVec code
11can be generated when gcc is configured with --target=powerpc-linux.
12The ABI and speciffic instructions can be selected through the
13"-mabi=spe or -mabi=altivec" and the "-mspe or -maltivec" parameters.
14
15Upstream-Status: Inappropriate [configuration]
16
17Signed-off-by: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
18---
19 gcc/config.gcc | 9 ++++++++-
20 gcc/config/rs6000/linuxspe.h | 3 ---
21 2 files changed, 8 insertions(+), 4 deletions(-)
22
23diff --git a/gcc/config.gcc b/gcc/config.gcc
24index 5e45f4b5199..9b381dfd9af 100644
25--- a/gcc/config.gcc
26+++ b/gcc/config.gcc
27@@ -2415,7 +2415,14 @@ powerpc-*-rtems*)
28 tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
29 ;;
30 powerpc*-*-linux*)
31- tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
32+ case ${target} in
33+ powerpc*-*-linux*spe* | powerpc*-*-linux*altivec*)
34+ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
35+ ;;
36+ *)
37+ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h rs6000/linuxaltivec.h rs6000/linuxspe.h rs6000/e500.h"
38+ ;;
39+ esac
40 extra_options="${extra_options} rs6000/sysv4.opt"
41 tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm"
42 extra_objs="$extra_objs rs6000-linux.o"
43diff --git a/gcc/config/rs6000/linuxspe.h b/gcc/config/rs6000/linuxspe.h
44index 92efabfe664..6d486451a7e 100644
45--- a/gcc/config/rs6000/linuxspe.h
46+++ b/gcc/config/rs6000/linuxspe.h
47@@ -27,6 +27,3 @@
48 #undef TARGET_DEFAULT
49 #define TARGET_DEFAULT MASK_STRICT_ALIGN
50 #endif
51-
52-#undef ASM_DEFAULT_SPEC
53-#define ASM_DEFAULT_SPEC "-mppc -mspe -me500"
54--
552.12.2
56
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0029-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch b/meta/recipes-devtools/gcc/gcc-7.3/0029-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch
deleted file mode 100644
index 7306a282b5..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0029-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch
+++ /dev/null
@@ -1,42 +0,0 @@
1From ec0f843b86c0f76bc5ebb20fafbc4aae1be4db61 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 20 Feb 2015 10:21:55 +0000
4Subject: [PATCH 29/47] Disable the MULTILIB_OSDIRNAMES and other multilib
5 options.
6
7Hard coding the MULTILIB_OSDIRNAMES with ../lib64 is causing problems on
8systems where the libdir is NOT set to /lib64. This is allowed by the
9ABI, as
10long as the dynamic loader is present in /lib.
11
12We simply want to use the default rules in gcc to find and configure the
13normal libdir.
14
15Upstream-Status: Inappropriate[OE-Specific]
16
17Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19---
20 gcc/config/aarch64/t-aarch64-linux | 8 ++++----
21 1 file changed, 4 insertions(+), 4 deletions(-)
22
23diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux
24index ab064ab6f22..f4b1f98b216 100644
25--- a/gcc/config/aarch64/t-aarch64-linux
26+++ b/gcc/config/aarch64/t-aarch64-linux
27@@ -21,8 +21,8 @@
28 LIB1ASMSRC = aarch64/lib1funcs.asm
29 LIB1ASMFUNCS = _aarch64_sync_cache_range
30
31-AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
32-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
33-MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
34+#AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
35+#MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
36+#MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
37
38-MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32
39+#MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32
40--
412.12.2
42
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0030-Ensure-target-gcc-headers-can-be-included.patch b/meta/recipes-devtools/gcc/gcc-7.3/0030-Ensure-target-gcc-headers-can-be-included.patch
deleted file mode 100644
index c6ecce9736..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0030-Ensure-target-gcc-headers-can-be-included.patch
+++ /dev/null
@@ -1,62 +0,0 @@
1From bf5836989e0ffc1c1df1369df06877e96c08df41 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 20 Feb 2015 10:25:11 +0000
4Subject: [PATCH 30/47] Ensure target gcc headers can be included
5
6There are a few headers installed as part of the OpenEmbedded
7gcc-runtime target (omp.h, ssp/*.h). Being installed from a recipe
8built for the target architecture, these are within the target
9sysroot and not cross/nativesdk; thus they weren't able to be
10found by gcc with the existing search paths. Add support for
11picking up these headers under the sysroot supplied on the gcc
12command line in order to resolve this.
13
14Upstream-Status: Pending
15
16Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18---
19 gcc/Makefile.in | 2 ++
20 gcc/cppdefault.c | 4 ++++
21 gcc/defaults.h | 9 +++++++++
22 gcc/gcc.c | 7 -------
23 4 files changed, 15 insertions(+), 7 deletions(-)
24
25diff --git a/gcc/Makefile.in b/gcc/Makefile.in
26index 23cca7f0d5a..95d21effad3 100644
27--- a/gcc/Makefile.in
28+++ b/gcc/Makefile.in
29@@ -608,6 +608,7 @@ libexecdir = @libexecdir@
30
31 # Directory in which the compiler finds libraries etc.
32 libsubdir = $(libdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
33+libsubdir_target = gcc/$(target_noncanonical)/$(version)
34 # Directory in which the compiler finds executables
35 libexecsubdir = $(libexecdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
36 # Directory in which all plugin resources are installed
37@@ -2791,6 +2792,7 @@ CFLAGS-intl.o += -DLOCALEDIR=\"$(localedir)\"
38
39 PREPROCESSOR_DEFINES = \
40 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
41+ -DGCC_INCLUDE_SUBDIR_TARGET=\"$(libsubdir_target)/include\" \
42 -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \
43 -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
44 -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \
45diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
46index 10b96eca0a7..c8da0884872 100644
47--- a/gcc/cppdefault.c
48+++ b/gcc/cppdefault.c
49@@ -59,6 +59,10 @@ const struct default_include cpp_include_defaults[]
50 /* This is the dir for gcc's private headers. */
51 { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
52 #endif
53+#ifdef GCC_INCLUDE_SUBDIR_TARGET
54+ /* This is the dir for gcc's private headers under the specified sysroot. */
55+ { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 },
56+#endif
57 #ifdef LOCAL_INCLUDE_DIR
58 /* /usr/local/include comes before the fixincluded header files. */
59 { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
60--
612.12.2
62
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0031-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch b/meta/recipes-devtools/gcc/gcc-7.3/0031-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch
deleted file mode 100644
index 0184010f04..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0031-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch
+++ /dev/null
@@ -1,54 +0,0 @@
1From c7b4d957edda955fbe405fd5295846614529f517 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 20 Feb 2015 11:17:19 +0000
4Subject: [PATCH 31/47] gcc 4.8+ won't build with --disable-dependency-tracking
5
6since the *.Ppo files don't get created unless --enable-dependency-tracking is true.
7
8This patch ensures we only use those compiler options when its enabled.
9
10Upstream-Status: Submitted
11
12(Problem was already reported upstream, attached this patch there
13http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55930)
14
15RP
162012/09/22
17
18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19---
20 libatomic/Makefile.am | 3 ++-
21 libatomic/Makefile.in | 3 ++-
22 2 files changed, 4 insertions(+), 2 deletions(-)
23
24diff --git a/libatomic/Makefile.am b/libatomic/Makefile.am
25index d731406fdbd..2fafc72d2e7 100644
26--- a/libatomic/Makefile.am
27+++ b/libatomic/Makefile.am
28@@ -101,7 +101,8 @@ PAT_S = $(word 3,$(PAT_SPLIT))
29 IFUNC_DEF = -DIFUNC_ALT=$(PAT_S)
30 IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS))
31
32-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
33+@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
34+@AMDEP_FALSE@M_DEPS =
35 M_SIZE = -DN=$(PAT_N)
36 M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
37 M_FILE = $(PAT_BASE)_n.c
38diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in
39index f6eeab312ea..3f06a894058 100644
40--- a/libatomic/Makefile.in
41+++ b/libatomic/Makefile.in
42@@ -331,7 +331,8 @@ PAT_N = $(word 2,$(PAT_SPLIT))
43 PAT_S = $(word 3,$(PAT_SPLIT))
44 IFUNC_DEF = -DIFUNC_ALT=$(PAT_S)
45 IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS))
46-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
47+@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
48+@AMDEP_FALSE@M_DEPS =
49 M_SIZE = -DN=$(PAT_N)
50 M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
51 M_FILE = $(PAT_BASE)_n.c
52--
532.12.2
54
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0032-Don-t-search-host-directory-during-relink-if-inst_pr.patch b/meta/recipes-devtools/gcc/gcc-7.3/0032-Don-t-search-host-directory-during-relink-if-inst_pr.patch
deleted file mode 100644
index e8905f5255..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0032-Don-t-search-host-directory-during-relink-if-inst_pr.patch
+++ /dev/null
@@ -1,38 +0,0 @@
1From 3be6b766a5881b0b187c3c3c68250a9e4f7c0fa3 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 3 Mar 2015 08:21:19 +0000
4Subject: [PATCH 32/47] Don't search host directory during "relink" if
5 $inst_prefix is provided
6
7http://lists.gnu.org/archive/html/libtool-patches/2011-01/msg00026.html
8
9Upstream-Status: Submitted
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 ltmain.sh | 5 +++--
14 1 file changed, 3 insertions(+), 2 deletions(-)
15
16diff --git a/ltmain.sh b/ltmain.sh
17index 52bdbdb5f9c..82bcec39f05 100644
18--- a/ltmain.sh
19+++ b/ltmain.sh
20@@ -6004,12 +6004,13 @@ func_mode_link ()
21 fi
22 else
23 # We cannot seem to hardcode it, guess we'll fake it.
24+ # Default if $libdir is not relative to the prefix:
25 add_dir="-L$libdir"
26- # Try looking first in the location we're being installed to.
27+
28 if test -n "$inst_prefix_dir"; then
29 case $libdir in
30 [\\/]*)
31- add_dir="$add_dir -L$inst_prefix_dir$libdir"
32+ add_dir="-L$inst_prefix_dir$libdir"
33 ;;
34 esac
35 fi
36--
372.12.2
38
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0033-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch b/meta/recipes-devtools/gcc/gcc-7.3/0033-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
deleted file mode 100644
index c0b8df3e71..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0033-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From 6edcab9046b862cbb9b46892fc390ce69976539c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 28 Apr 2015 23:15:27 -0700
4Subject: [PATCH 33/47] Use SYSTEMLIBS_DIR replacement instead of hardcoding
5 base_libdir
6
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8---
9Upstream-Status: Inappropriate [OE-Specific]
10
11 gcc/config/aarch64/aarch64-linux.h | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
15index c45fc1d35d1..a7afe197266 100644
16--- a/gcc/config/aarch64/aarch64-linux.h
17+++ b/gcc/config/aarch64/aarch64-linux.h
18@@ -21,7 +21,7 @@
19 #ifndef GCC_AARCH64_LINUX_H
20 #define GCC_AARCH64_LINUX_H
21
22-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
23+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
24
25 #undef MUSL_DYNAMIC_LINKER
26 #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
27--
282.12.2
29
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0034-aarch64-Add-support-for-musl-ldso.patch b/meta/recipes-devtools/gcc/gcc-7.3/0034-aarch64-Add-support-for-musl-ldso.patch
deleted file mode 100644
index 7d866d9064..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0034-aarch64-Add-support-for-musl-ldso.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From b140d6839cfba9cac892bc736d984540552d6a56 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 28 Apr 2015 23:18:39 -0700
4Subject: [PATCH 34/47] aarch64: Add support for musl ldso
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8Upstream-Status: Inappropriate [OE-Specific]
9
10 gcc/config/aarch64/aarch64-linux.h | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
14index a7afe197266..580c2c7ea15 100644
15--- a/gcc/config/aarch64/aarch64-linux.h
16+++ b/gcc/config/aarch64/aarch64-linux.h
17@@ -24,7 +24,7 @@
18 #define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
19
20 #undef MUSL_DYNAMIC_LINKER
21-#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
22+#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
23
24 #undef ASAN_CC1_SPEC
25 #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
26--
272.12.2
28
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0035-libcc1-fix-libcc1-s-install-path-and-rpath.patch b/meta/recipes-devtools/gcc/gcc-7.3/0035-libcc1-fix-libcc1-s-install-path-and-rpath.patch
deleted file mode 100644
index e2c1956d1d..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0035-libcc1-fix-libcc1-s-install-path-and-rpath.patch
+++ /dev/null
@@ -1,54 +0,0 @@
1From 63617f2da153db10fa2fe938cce31bee01d47fe8 Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Sun, 5 Jul 2015 20:25:18 -0700
4Subject: [PATCH 35/47] libcc1: fix libcc1's install path and rpath
5
6* Install libcc1.so and libcc1plugin.so into
7 $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version), as what we
8 had done to lto-plugin.
9* Fix bad RPATH iussue:
10 gcc-5.2.0: package gcc-plugins contains bad RPATH /patht/to/tmp/sysroots/qemux86-64/usr/lib64/../lib64 in file
11 /path/to/gcc/5.2.0-r0/packages-split/gcc-plugins/usr/lib64/gcc/x86_64-poky-linux/5.2.0/plugin/libcc1plugin.so.0.0.0
12 [rpaths]
13
14Upstream-Status: Inappropriate [OE configuration]
15
16Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
17---
18 libcc1/Makefile.am | 4 ++--
19 libcc1/Makefile.in | 4 ++--
20 2 files changed, 4 insertions(+), 4 deletions(-)
21
22diff --git a/libcc1/Makefile.am b/libcc1/Makefile.am
23index 5e61a92a26b..e8b627f9cec 100644
24--- a/libcc1/Makefile.am
25+++ b/libcc1/Makefile.am
26@@ -37,8 +37,8 @@ libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
27 $(Wc)$(libiberty_normal)))
28 libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty))
29
30-plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
31-cc1libdir = $(libdir)/$(libsuffix)
32+cc1libdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
33+plugindir = $(cc1libdir)
34
35 if ENABLE_PLUGIN
36 plugin_LTLIBRARIES = libcc1plugin.la libcp1plugin.la
37diff --git a/libcc1/Makefile.in b/libcc1/Makefile.in
38index 54babb02a49..e51d87ffdce 100644
39--- a/libcc1/Makefile.in
40+++ b/libcc1/Makefile.in
41@@ -303,8 +303,8 @@ libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
42 $(Wc)$(libiberty_normal)))
43
44 libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty))
45-plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
46-cc1libdir = $(libdir)/$(libsuffix)
47+cc1libdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
48+plugindir = $(cc1libdir)
49 @ENABLE_PLUGIN_TRUE@plugin_LTLIBRARIES = libcc1plugin.la libcp1plugin.la
50 @ENABLE_PLUGIN_TRUE@cc1lib_LTLIBRARIES = libcc1.la
51 BUILT_SOURCES = c-compiler-name.h cp-compiler-name.h
52--
532.12.2
54
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0036-handle-sysroot-support-for-nativesdk-gcc.patch b/meta/recipes-devtools/gcc/gcc-7.3/0036-handle-sysroot-support-for-nativesdk-gcc.patch
deleted file mode 100644
index aa0b108275..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0036-handle-sysroot-support-for-nativesdk-gcc.patch
+++ /dev/null
@@ -1,213 +0,0 @@
1From ca14820ae834a62ef2b80b283e8f900714636272 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 7 Dec 2015 23:39:54 +0000
4Subject: [PATCH 36/47] handle sysroot support for nativesdk-gcc
5
6Being able to build a nativesdk gcc is useful, particularly in cases
7where the host compiler may be of an incompatible version (or a 32
8bit compiler is needed).
9
10Sadly, building nativesdk-gcc is not straight forward. We install
11nativesdk-gcc into a relocatable location and this means that its
12library locations can change. "Normal" sysroot support doesn't help
13in this case since the values of paths like "libdir" change, not just
14base root directory of the system.
15
16In order to handle this we do two things:
17
18a) Add %r into spec file markup which can be used for injected paths
19 such as SYSTEMLIBS_DIR (see gcc_multilib_setup()).
20b) Add other paths which need relocation into a .gccrelocprefix section
21 which the relocation code will notice and adjust automatically.
22
23Upstream-Status: Inappropriate
24RP 2015/7/28
25
26Signed-off-by: Khem Raj <raj.khem@gmail.com>
27---
28 gcc/cppdefault.c | 50 +++++++++++++++++++++++++++++++++++++-------------
29 gcc/cppdefault.h | 3 ++-
30 gcc/gcc.c | 20 ++++++++++++++------
31 3 files changed, 53 insertions(+), 20 deletions(-)
32
33diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
34index c8da0884872..43dc597a0c3 100644
35--- a/gcc/cppdefault.c
36+++ b/gcc/cppdefault.c
37@@ -35,6 +35,30 @@
38 # undef CROSS_INCLUDE_DIR
39 #endif
40
41+static char GPLUSPLUS_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_INCLUDE_DIR;
42+static char GCC_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GCC_INCLUDE_DIR;
43+static char GPLUSPLUS_TOOL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_TOOL_INCLUDE_DIR;
44+static char GPLUSPLUS_BACKWARD_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_BACKWARD_INCLUDE_DIR;
45+static char STANDARD_STARTFILE_PREFIX_2VAR[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET;
46+#ifdef LOCAL_INCLUDE_DIR
47+static char LOCAL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = LOCAL_INCLUDE_DIR;
48+#endif
49+#ifdef PREFIX_INCLUDE_DIR
50+static char PREFIX_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = PREFIX_INCLUDE_DIR;
51+#endif
52+#ifdef FIXED_INCLUDE_DIR
53+static char FIXED_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = FIXED_INCLUDE_DIR;
54+#endif
55+#ifdef CROSS_INCLUDE_DIR
56+static char CROSS_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = CROSS_INCLUDE_DIR;
57+#endif
58+#ifdef TOOL_INCLUDE_DIR
59+static char TOOL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = TOOL_INCLUDE_DIR;
60+#endif
61+#ifdef NATIVE_SYSTEM_HEADER_DIR
62+static char NATIVE_SYSTEM_HEADER_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = NATIVE_SYSTEM_HEADER_DIR;
63+#endif
64+
65 const struct default_include cpp_include_defaults[]
66 #ifdef INCLUDE_DEFAULTS
67 = INCLUDE_DEFAULTS;
68@@ -42,38 +66,38 @@ const struct default_include cpp_include_defaults[]
69 = {
70 #ifdef GPLUSPLUS_INCLUDE_DIR
71 /* Pick up GNU C++ generic include files. */
72- { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1,
73+ { GPLUSPLUS_INCLUDE_DIRVAR, "G++", 1, 1,
74 GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
75 #endif
76 #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR
77 /* Pick up GNU C++ target-dependent include files. */
78- { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1,
79+ { GPLUSPLUS_TOOL_INCLUDE_DIRVAR, "G++", 1, 1,
80 GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 },
81 #endif
82 #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
83 /* Pick up GNU C++ backward and deprecated include files. */
84- { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1,
85+ { GPLUSPLUS_BACKWARD_INCLUDE_DIRVAR, "G++", 1, 1,
86 GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
87 #endif
88 #ifdef GCC_INCLUDE_DIR
89 /* This is the dir for gcc's private headers. */
90- { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
91+ { GCC_INCLUDE_DIRVAR, "GCC", 0, 0, 0, 0 },
92 #endif
93 #ifdef GCC_INCLUDE_SUBDIR_TARGET
94 /* This is the dir for gcc's private headers under the specified sysroot. */
95- { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 },
96+ { STANDARD_STARTFILE_PREFIX_2VAR, "GCC", 0, 0, 1, 0 },
97 #endif
98 #ifdef LOCAL_INCLUDE_DIR
99 /* /usr/local/include comes before the fixincluded header files. */
100- { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
101- { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
102+ { LOCAL_INCLUDE_DIRVAR, 0, 0, 1, 1, 2 },
103+ { LOCAL_INCLUDE_DIRVAR, 0, 0, 1, 1, 0 },
104 #endif
105 #ifdef PREFIX_INCLUDE_DIR
106- { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0 },
107+ { PREFIX_INCLUDE_DIRVAR, 0, 0, 1, 0, 0 },
108 #endif
109 #ifdef FIXED_INCLUDE_DIR
110 /* This is the dir for fixincludes. */
111- { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0,
112+ { FIXED_INCLUDE_DIRVAR, "GCC", 0, 0, 0,
113 /* A multilib suffix needs adding if different multilibs use
114 different headers. */
115 #ifdef SYSROOT_HEADERS_SUFFIX_SPEC
116@@ -85,16 +109,16 @@ const struct default_include cpp_include_defaults[]
117 #endif
118 #ifdef CROSS_INCLUDE_DIR
119 /* One place the target system's headers might be. */
120- { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
121+ { CROSS_INCLUDE_DIRVAR, "GCC", 0, 0, 0, 0 },
122 #endif
123 #ifdef TOOL_INCLUDE_DIR
124 /* Another place the target system's headers might be. */
125- { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 },
126+ { TOOL_INCLUDE_DIRVAR, "BINUTILS", 0, 1, 0, 0 },
127 #endif
128 #ifdef NATIVE_SYSTEM_HEADER_DIR
129 /* /usr/include comes dead last. */
130- { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 },
131- { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 },
132+ { NATIVE_SYSTEM_HEADER_DIRVAR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 },
133+ { NATIVE_SYSTEM_HEADER_DIRVAR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 },
134 #endif
135 { 0, 0, 0, 0, 0, 0 }
136 };
137diff --git a/gcc/cppdefault.h b/gcc/cppdefault.h
138index 17bbb0eaef7..a937ec1d187 100644
139--- a/gcc/cppdefault.h
140+++ b/gcc/cppdefault.h
141@@ -33,7 +33,8 @@
142
143 struct default_include
144 {
145- const char *const fname; /* The name of the directory. */
146+ const char *fname; /* The name of the directory. */
147+
148 const char *const component; /* The component containing the directory
149 (see update_path in prefix.c) */
150 const char cplusplus; /* Only look here if we're compiling C++. */
151diff --git a/gcc/gcc.c b/gcc/gcc.c
152index b27245dbf77..e015c77f15f 100644
153--- a/gcc/gcc.c
154+++ b/gcc/gcc.c
155@@ -247,6 +247,8 @@ FILE *report_times_to_file = NULL;
156 #endif
157 static const char *target_system_root = DEFAULT_TARGET_SYSTEM_ROOT;
158
159+static char target_relocatable_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = SYSTEMLIBS_DIR;
160+
161 /* Nonzero means pass the updated target_system_root to the compiler. */
162
163 static int target_system_root_changed;
164@@ -518,6 +520,7 @@ or with constant text in a single argument.
165 %G process LIBGCC_SPEC as a spec.
166 %R Output the concatenation of target_system_root and
167 target_sysroot_suffix.
168+ %r Output the base path target_relocatable_prefix
169 %S process STARTFILE_SPEC as a spec. A capital S is actually used here.
170 %E process ENDFILE_SPEC as a spec. A capital E is actually used here.
171 %C process CPP_SPEC as a spec.
172@@ -1495,10 +1498,10 @@ static const char *gcc_libexec_prefix;
173 gcc_exec_prefix is set because, in that case, we know where the
174 compiler has been installed, and use paths relative to that
175 location instead. */
176-static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
177-static const char *const standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX;
178-static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX;
179-static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
180+static char standard_exec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_EXEC_PREFIX;
181+static char standard_libexec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_LIBEXEC_PREFIX;
182+static char standard_bindir_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_BINDIR_PREFIX;
183+static char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
184
185 /* For native compilers, these are well-known paths containing
186 components that may be provided by the system. For cross
187@@ -1506,9 +1509,9 @@ static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
188 static const char *md_exec_prefix = MD_EXEC_PREFIX;
189 static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
190 static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
191-static const char *const standard_startfile_prefix_1
192+static char standard_startfile_prefix_1[4096] __attribute__ ((section (".gccrelocprefix")))
193 = STANDARD_STARTFILE_PREFIX_1;
194-static const char *const standard_startfile_prefix_2
195+static char standard_startfile_prefix_2[4096] __attribute__ ((section (".gccrelocprefix")))
196 = STANDARD_STARTFILE_PREFIX_2;
197
198 /* A relative path to be used in finding the location of tools
199@@ -5826,6 +5829,11 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
200 }
201 break;
202
203+ case 'r':
204+ obstack_grow (&obstack, target_relocatable_prefix,
205+ strlen (target_relocatable_prefix));
206+ break;
207+
208 case 'S':
209 value = do_spec_1 (startfile_spec, 0, NULL);
210 if (value != 0)
211--
2122.12.2
213
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0037-Search-target-sysroot-gcc-version-specific-dirs-with.patch b/meta/recipes-devtools/gcc/gcc-7.3/0037-Search-target-sysroot-gcc-version-specific-dirs-with.patch
deleted file mode 100644
index 6c85a03f44..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0037-Search-target-sysroot-gcc-version-specific-dirs-with.patch
+++ /dev/null
@@ -1,102 +0,0 @@
1From 16a326bcd126b395b29019072905bae7a5d47500 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 7 Dec 2015 23:41:45 +0000
4Subject: [PATCH 37/47] Search target sysroot gcc version specific dirs with
5 multilib.
6
7We install the gcc libraries (such as crtbegin.p) into
8<sysroot><libdir>/<target-sys>/5.2.0/
9which is a default search path for GCC (aka multi_suffix in the
10code below). <target-sys> is 'machine' in gcc's terminology. We use
11these directories so that multiple gcc versions could in theory
12co-exist on target.
13
14We only want to build one gcc-cross-canadian per arch and have this work
15for all multilibs. <target-sys> can be handled by mapping the multilib
16<target-sys> to the one used by gcc-cross-canadian, e.g.
17mips64-polkmllib32-linux
18is symlinked to by mips64-poky-linux.
19
20The default gcc search path in the target sysroot for a "lib64" mutlilib
21is:
22
23<sysroot>/lib32/mips64-poky-linux/5.2.0/
24<sysroot>/lib32/../lib64/
25<sysroot>/usr/lib32/mips64-poky-linux/5.2.0/
26<sysroot>/usr/lib32/../lib64/
27<sysroot>/lib32/
28<sysroot>/usr/lib32/
29
30which means that the lib32 crtbegin.o will be found and the lib64 ones
31will not which leads to compiler failures.
32
33This patch injects a multilib version of that path first so the lib64
34binaries can be found first. With this change the search path becomes:
35
36<sysroot>/lib32/../lib64/mips64-poky-linux/5.2.0/
37<sysroot>/lib32/mips64-poky-linux/5.2.0/
38<sysroot>/lib32/../lib64/
39<sysroot>/usr/lib32/../lib64/mips64-poky-linux/5.2.0/
40<sysroot>/usr/lib32/mips64-poky-linux/5.2.0/
41<sysroot>/usr/lib32/../lib64/
42<sysroot>/lib32/
43<sysroot>/usr/lib32/
44
45Upstream-Status: Pending
46RP 2015/7/31
47
48Signed-off-by: Khem Raj <raj.khem@gmail.com>
49---
50 gcc/gcc.c | 29 ++++++++++++++++++++++++++++-
51 1 file changed, 28 insertions(+), 1 deletion(-)
52
53diff --git a/gcc/gcc.c b/gcc/gcc.c
54index e015c77f15f..84af5d5a2e1 100644
55--- a/gcc/gcc.c
56+++ b/gcc/gcc.c
57@@ -2533,7 +2533,7 @@ for_each_path (const struct path_prefix *paths,
58 if (path == NULL)
59 {
60 len = paths->max_len + extra_space + 1;
61- len += MAX (MAX (suffix_len, multi_os_dir_len), multiarch_len);
62+ len += MAX ((suffix_len + multi_os_dir_len), multiarch_len);
63 path = XNEWVEC (char, len);
64 }
65
66@@ -2545,6 +2545,33 @@ for_each_path (const struct path_prefix *paths,
67 /* Look first in MACHINE/VERSION subdirectory. */
68 if (!skip_multi_dir)
69 {
70+ if (!(pl->os_multilib ? skip_multi_os_dir : skip_multi_dir))
71+ {
72+ const char *this_multi;
73+ size_t this_multi_len;
74+
75+ if (pl->os_multilib)
76+ {
77+ this_multi = multi_os_dir;
78+ this_multi_len = multi_os_dir_len;
79+ }
80+ else
81+ {
82+ this_multi = multi_dir;
83+ this_multi_len = multi_dir_len;
84+ }
85+
86+ /* Look in multilib MACHINE/VERSION subdirectory first */
87+ if (this_multi_len)
88+ {
89+ memcpy (path + len, this_multi, this_multi_len + 1);
90+ memcpy (path + len + this_multi_len, multi_suffix, suffix_len + 1);
91+ ret = callback (path, callback_info);
92+ if (ret)
93+ break;
94+ }
95+ }
96+
97 memcpy (path + len, multi_suffix, suffix_len + 1);
98 ret = callback (path, callback_info);
99 if (ret)
100--
1012.12.2
102
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0038-Fix-various-_FOR_BUILD-and-related-variables.patch b/meta/recipes-devtools/gcc/gcc-7.3/0038-Fix-various-_FOR_BUILD-and-related-variables.patch
deleted file mode 100644
index a226d10d06..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0038-Fix-various-_FOR_BUILD-and-related-variables.patch
+++ /dev/null
@@ -1,137 +0,0 @@
1From 6e7f526e71a76aac3d49ba8f1742fe1b359c1060 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 7 Dec 2015 23:42:45 +0000
4Subject: [PATCH 38/47] Fix various _FOR_BUILD and related variables
5
6When doing a FOR_BUILD thing, you have to override CFLAGS with
7CFLAGS_FOR_BUILD. And if you use C++, you also have to override
8CXXFLAGS with CXXFLAGS_FOR_BUILD.
9Without this, when building for mingw, you end up trying to use
10the mingw headers for a host build.
11
12The same goes for other variables as well, such as CPPFLAGS,
13CPP, and GMPINC.
14
15Upstream-Status: Pending
16
17Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
18Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
19Signed-off-by: Khem Raj <raj.khem@gmail.com>
20---
21 Makefile.in | 6 ++++++
22 Makefile.tpl | 5 +++++
23 gcc/Makefile.in | 2 +-
24 gcc/configure | 2 +-
25 gcc/configure.ac | 2 +-
26 5 files changed, 14 insertions(+), 3 deletions(-)
27
28diff --git a/Makefile.in b/Makefile.in
29index e34e9555388..a03740f3f9d 100644
30--- a/Makefile.in
31+++ b/Makefile.in
32@@ -152,6 +152,7 @@ BUILD_EXPORTS = \
33 CPP="$(CC_FOR_BUILD) -E"; export CPP; \
34 CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
35 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
36+ CPPFLAGS="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS; \
37 CXX="$(CXX_FOR_BUILD)"; export CXX; \
38 CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
39 GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
40@@ -169,6 +170,9 @@ BUILD_EXPORTS = \
41 # built for the build system to override those in BASE_FLAGS_TO_PASS.
42 EXTRA_BUILD_FLAGS = \
43 CFLAGS="$(CFLAGS_FOR_BUILD)" \
44+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
45+ CPP="$(CC_FOR_BUILD) -E" \
46+ CPPFLAGS="$(CPPFLAGS_FOR_BUILD)" \
47 LDFLAGS="$(LDFLAGS_FOR_BUILD)"
48
49 # This is the list of directories to built for the host system.
50@@ -186,6 +190,7 @@ HOST_SUBDIR = @host_subdir@
51 HOST_EXPORTS = \
52 $(BASE_EXPORTS) \
53 CC="$(CC)"; export CC; \
54+ CPP="$(CC) -E"; export CPP; \
55 ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
56 CFLAGS="$(CFLAGS)"; export CFLAGS; \
57 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
58@@ -734,6 +739,7 @@ BASE_FLAGS_TO_PASS = \
59 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
60 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
61 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
62+ "CXXFLAGS_FOR_BUILD=$(CXXFLAGS_FOR_BUILD)" \
63 "EXPECT=$(EXPECT)" \
64 "FLEX=$(FLEX)" \
65 "INSTALL=$(INSTALL)" \
66diff --git a/Makefile.tpl b/Makefile.tpl
67index d0fa07005be..953376c658d 100644
68--- a/Makefile.tpl
69+++ b/Makefile.tpl
70@@ -154,6 +154,7 @@ BUILD_EXPORTS = \
71 CC="$(CC_FOR_BUILD)"; export CC; \
72 CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
73 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
74+ CPPFLAGS="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS; \
75 CXX="$(CXX_FOR_BUILD)"; export CXX; \
76 CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
77 GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
78@@ -171,6 +172,9 @@ BUILD_EXPORTS = \
79 # built for the build system to override those in BASE_FLAGS_TO_PASS.
80 EXTRA_BUILD_FLAGS = \
81 CFLAGS="$(CFLAGS_FOR_BUILD)" \
82+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
83+ CPP="$(CC_FOR_BUILD) -E" \
84+ CPPFLAGS="$(CPPFLAGS_FOR_BUILD)" \
85 LDFLAGS="$(LDFLAGS_FOR_BUILD)"
86
87 # This is the list of directories to built for the host system.
88@@ -188,6 +192,7 @@ HOST_SUBDIR = @host_subdir@
89 HOST_EXPORTS = \
90 $(BASE_EXPORTS) \
91 CC="$(CC)"; export CC; \
92+ CPP="$(CC) -E"; export CPP; \
93 ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
94 CFLAGS="$(CFLAGS)"; export CFLAGS; \
95 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
96diff --git a/gcc/Makefile.in b/gcc/Makefile.in
97index 95d21effad3..dbe2bacde50 100644
98--- a/gcc/Makefile.in
99+++ b/gcc/Makefile.in
100@@ -795,7 +795,7 @@ BUILD_LDFLAGS=@BUILD_LDFLAGS@
101 BUILD_NO_PIE_FLAG = @BUILD_NO_PIE_FLAG@
102 BUILD_LDFLAGS += $(BUILD_NO_PIE_FLAG)
103 BUILD_CPPFLAGS= -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
104- -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS)
105+ -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS_FOR_BUILD)
106
107 # Actual name to use when installing a native compiler.
108 GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
109diff --git a/gcc/configure b/gcc/configure
110index 6ba391ed068..72ca6e5c535 100755
111--- a/gcc/configure
112+++ b/gcc/configure
113@@ -11789,7 +11789,7 @@ else
114 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
115 CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \
116 LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \
117- GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \
118+ GMPINC="" CPPFLAGS="${CPPFLAGS_FOR_BUILD} -DGENERATOR_FILE" \
119 ${realsrcdir}/configure \
120 --enable-languages=${enable_languages-all} \
121 --target=$target_alias --host=$build_alias --build=$build_alias
122diff --git a/gcc/configure.ac b/gcc/configure.ac
123index 8551a412df3..6eefb61dc2b 100644
124--- a/gcc/configure.ac
125+++ b/gcc/configure.ac
126@@ -1708,7 +1708,7 @@ else
127 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
128 CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \
129 LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \
130- GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \
131+ GMPINC="" CPPFLAGS="${CPPFLAGS_FOR_BUILD} -DGENERATOR_FILE" \
132 ${realsrcdir}/configure \
133 --enable-languages=${enable_languages-all} \
134 --target=$target_alias --host=$build_alias --build=$build_alias
135--
1362.12.2
137
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0039-nios2-Define-MUSL_DYNAMIC_LINKER.patch b/meta/recipes-devtools/gcc/gcc-7.3/0039-nios2-Define-MUSL_DYNAMIC_LINKER.patch
deleted file mode 100644
index a7aeccdf03..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0039-nios2-Define-MUSL_DYNAMIC_LINKER.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From 6d03ddfb7a092942be6b58b1830f6986d012d5e3 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 2 Feb 2016 10:26:10 -0800
4Subject: [PATCH 39/47] nios2: Define MUSL_DYNAMIC_LINKER
5
6Signed-off-by: Marek Vasut <marex@denx.de>
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8---
9Upstream-Status: Inappropriate [OE-Specific]
10
11 gcc/config/nios2/linux.h | 1 +
12 1 file changed, 1 insertion(+)
13
14diff --git a/gcc/config/nios2/linux.h b/gcc/config/nios2/linux.h
15index 5177fa641a4..1b8accda6ee 100644
16--- a/gcc/config/nios2/linux.h
17+++ b/gcc/config/nios2/linux.h
18@@ -30,6 +30,7 @@
19 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
20
21 #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-nios2.so.1"
22+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-nios2.so.1"
23
24 #undef LINK_SPEC
25 #define LINK_SPEC LINK_SPEC_ENDIAN \
26--
272.12.2
28
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0040-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch b/meta/recipes-devtools/gcc/gcc-7.3/0040-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch
deleted file mode 100644
index 29b7ce72d2..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0040-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch
+++ /dev/null
@@ -1,87 +0,0 @@
1From 210f6b3b82084cc756e02b8bc12f909a43b14ee8 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 27 Jun 2017 18:10:54 -0700
4Subject: [PATCH 40/49] Add ssp_nonshared to link commandline for musl targets
5
6when -fstack-protector options are enabled we need to
7link with ssp_shared on musl since it does not provide
8the __stack_chk_fail_local() so essentially it provides
9libssp but not libssp_nonshared something like
10TARGET_LIBC_PROVIDES_SSP_BUT_NOT_SSP_NONSHARED
11 where-as for glibc the needed symbols
12are already present in libc_nonshared library therefore
13we do not need any library helper on glibc based systems
14but musl needs the libssp_noshared from gcc
15
16Upstream-Status: Pending
17
18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19---
20 gcc/config/linux.h | 7 +++++++
21 gcc/config/rs6000/linux.h | 10 ++++++++++
22 gcc/config/rs6000/linux64.h | 10 ++++++++++
23 3 files changed, 27 insertions(+)
24
25diff --git a/gcc/config/linux.h b/gcc/config/linux.h
26index 2e683d0c430..1b4df798671 100644
27--- a/gcc/config/linux.h
28+++ b/gcc/config/linux.h
29@@ -182,6 +182,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
30 { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
31 { 0, 0, 0, 0, 0, 0 } \
32 }
33+#ifdef TARGET_LIBC_PROVIDES_SSP
34+#undef LINK_SSP_SPEC
35+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
36+ "|fstack-protector-strong|fstack-protector-explicit" \
37+ ":-lssp_nonshared}"
38+#endif
39+
40 #endif
41
42 #if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */
43diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
44index 684afd6c190..22cfa391b89 100644
45--- a/gcc/config/rs6000/linux.h
46+++ b/gcc/config/rs6000/linux.h
47@@ -91,6 +91,16 @@
48 " -m elf32ppclinux")
49 #endif
50
51+/* link libssp_nonshared.a with musl */
52+#if DEFAULT_LIBC == LIBC_MUSL
53+#ifdef TARGET_LIBC_PROVIDES_SSP
54+#undef LINK_SSP_SPEC
55+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
56+ "|fstack-protector-strong|fstack-protector-explicit" \
57+ ":-lssp_nonshared}"
58+#endif
59+#endif
60+
61 #undef LINK_OS_LINUX_SPEC
62 #define LINK_OS_LINUX_SPEC LINK_OS_LINUX_EMUL " %{!shared: %{!static: \
63 %{rdynamic:-export-dynamic} \
64diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
65index 3b00ec0fcf0..8371f8d7b6b 100644
66--- a/gcc/config/rs6000/linux64.h
67+++ b/gcc/config/rs6000/linux64.h
68@@ -465,6 +465,16 @@ extern int dot_symbols;
69 " -m elf64ppc")
70 #endif
71
72+/* link libssp_nonshared.a with musl */
73+#if DEFAULT_LIBC == LIBC_MUSL
74+#ifdef TARGET_LIBC_PROVIDES_SSP
75+#undef LINK_SSP_SPEC
76+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
77+ "|fstack-protector-strong|fstack-protector-explicit" \
78+ ":-lssp_nonshared}"
79+#endif
80+#endif
81+
82 #define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \
83 %{rdynamic:-export-dynamic} \
84 -dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}} \
85--
862.13.2
87
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0041-gcc-libcpp-support-ffile-prefix-map-old-new.patch b/meta/recipes-devtools/gcc/gcc-7.3/0041-gcc-libcpp-support-ffile-prefix-map-old-new.patch
deleted file mode 100644
index 5260e363d2..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0041-gcc-libcpp-support-ffile-prefix-map-old-new.patch
+++ /dev/null
@@ -1,284 +0,0 @@
1From 4eadc99bdd0974761bf48f0fd32994dd9a3ffcfe Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Wed, 16 Mar 2016 02:27:43 -0400
4Subject: [PATCH 41/47] gcc/libcpp: support -ffile-prefix-map=<old>=<new>
5
6Similar -fdebug-prefix-map, add option -ffile-prefix-map to map one
7directory name (old) to another (new) in __FILE__, __BASE_FILE__ and
8__builtin_FILE ().
9
10https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
11
12Upstream-Status: Submitted [gcc-patches@gcc.gnu.org]
13Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
14---
15 gcc/c-family/c-opts.c | 13 +++++++
16 gcc/c-family/c.opt | 4 +++
17 gcc/dwarf2out.c | 1 +
18 gcc/gimplify.c | 2 ++
19 libcpp/Makefile.in | 10 +++---
20 libcpp/file-map.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++
21 libcpp/include/file-map.h | 30 ++++++++++++++++
22 libcpp/macro.c | 2 ++
23 8 files changed, 149 insertions(+), 5 deletions(-)
24 create mode 100644 libcpp/file-map.c
25 create mode 100644 libcpp/include/file-map.h
26
27diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
28index ea0e01b101c..a741c75a78f 100644
29--- a/gcc/c-family/c-opts.c
30+++ b/gcc/c-family/c-opts.c
31@@ -39,6 +39,14 @@ along with GCC; see the file COPYING3. If not see
32 #include "opts.h"
33 #include "plugin.h" /* For PLUGIN_INCLUDE_FILE event. */
34 #include "mkdeps.h"
35+#include "file-map.h"
36+#include "c-target.h"
37+#include "tm.h" /* For BYTES_BIG_ENDIAN,
38+ DOLLARS_IN_IDENTIFIERS,
39+ STDC_0_IN_SYSTEM_HEADERS,
40+ TARGET_FLT_EVAL_METHOD_NON_DEFAULT and
41+ TARGET_OPTF. */
42+#include "tm_p.h" /* For C_COMMON_OVERRIDE_OPTIONS. */
43 #include "dumpfile.h"
44
45 #ifndef DOLLARS_IN_IDENTIFIERS
46@@ -517,6 +525,11 @@ c_common_handle_option (size_t scode, const char *arg, int value,
47 cpp_opts->narrow_charset = arg;
48 break;
49
50+ case OPT_ffile_prefix_map_:
51+ if (add_file_prefix_map (arg) < 0)
52+ error ("invalid argument %qs to -ffile-prefix-map", arg);
53+ break;
54+
55 case OPT_fwide_exec_charset_:
56 cpp_opts->wide_charset = arg;
57 break;
58diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
59index c4ef7796282..73333dfd57c 100644
60--- a/gcc/c-family/c.opt
61+++ b/gcc/c-family/c.opt
62@@ -1372,6 +1372,10 @@ fexec-charset=
63 C ObjC C++ ObjC++ Joined RejectNegative
64 -fexec-charset=<cset> Convert all strings and character constants to character set <cset>.
65
66+ffile-prefix-map=
67+C ObjC C++ ObjC++ Joined RejectNegative
68+-ffile-prefix-map=<old=new> Map one directory name to another in __FILE__, __BASE_FILE__ and __builtin_FILE ()
69+
70 fextended-identifiers
71 C ObjC C++ ObjC++
72 Permit universal character names (\\u and \\U) in identifiers.
73diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
74index 98c51576ec2..762f69ae88e 100644
75--- a/gcc/dwarf2out.c
76+++ b/gcc/dwarf2out.c
77@@ -23421,6 +23421,7 @@ gen_producer_string (void)
78 case OPT_fltrans_output_list_:
79 case OPT_fresolution_:
80 case OPT_fdebug_prefix_map_:
81+ case OPT_ffile_prefix_map_:
82 /* Ignore these. */
83 continue;
84 default:
85diff --git a/gcc/gimplify.c b/gcc/gimplify.c
86index fd27eb1523f..5542b379f28 100644
87--- a/gcc/gimplify.c
88+++ b/gcc/gimplify.c
89@@ -58,6 +58,8 @@ along with GCC; see the file COPYING3. If not see
90 #include "gomp-constants.h"
91 #include "tree-dump.h"
92 #include "gimple-walk.h"
93+#include "file-map.h"
94+
95 #include "langhooks-def.h" /* FIXME: for lhd_set_decl_assembler_name */
96 #include "builtins.h"
97 #include "asan.h"
98diff --git a/libcpp/Makefile.in b/libcpp/Makefile.in
99index 0bd3787c25e..d3b52956b52 100644
100--- a/libcpp/Makefile.in
101+++ b/libcpp/Makefile.in
102@@ -84,12 +84,12 @@ DEPMODE = $(CXXDEPMODE)
103
104
105 libcpp_a_OBJS = charset.o directives.o directives-only.o errors.o \
106- expr.o files.o identifiers.o init.o lex.o line-map.o macro.o \
107- mkdeps.o pch.o symtab.o traditional.o
108+ expr.o file-map.o files.o identifiers.o init.o lex.o line-map.o \
109+ macro.o mkdeps.o pch.o symtab.o traditional.o
110
111 libcpp_a_SOURCES = charset.c directives.c directives-only.c errors.c \
112- expr.c files.c identifiers.c init.c lex.c line-map.c macro.c \
113- mkdeps.c pch.c symtab.c traditional.c
114+ expr.c file-map.c files.c identifiers.c init.c lex.c line-map.c \
115+ macro.c mkdeps.c pch.c symtab.c traditional.c
116
117 all: libcpp.a $(USED_CATALOGS)
118
119@@ -263,7 +263,7 @@ po/$(PACKAGE).pot: $(libcpp_a_SOURCES)
120
121 TAGS_SOURCES = $(libcpp_a_SOURCES) internal.h ucnid.h \
122 include/line-map.h include/symtab.h include/cpp-id-data.h \
123- include/cpplib.h include/mkdeps.h system.h
124+ include/cpplib.h include/mkdeps.h system.h include/file-map.h
125
126 TAGS: $(TAGS_SOURCES)
127 cd $(srcdir) && etags $(TAGS_SOURCES)
128diff --git a/libcpp/file-map.c b/libcpp/file-map.c
129new file mode 100644
130index 00000000000..18035ef6a72
131--- /dev/null
132+++ b/libcpp/file-map.c
133@@ -0,0 +1,92 @@
134+/* Map one directory name to another in __FILE__, __BASE_FILE__
135+ and __builtin_FILE ().
136+ Copyright (C) 2001-2016 Free Software Foundation, Inc.
137+
138+This program is free software; you can redistribute it and/or modify it
139+under the terms of the GNU General Public License as published by the
140+Free Software Foundation; either version 3, or (at your option) any
141+later version.
142+
143+This program is distributed in the hope that it will be useful,
144+but WITHOUT ANY WARRANTY; without even the implied warranty of
145+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
146+GNU General Public License for more details.
147+
148+You should have received a copy of the GNU General Public License
149+along with this program; see the file COPYING3. If not see
150+<http://www.gnu.org/licenses/>.
151+
152+ In other words, you are welcome to use, share and improve this program.
153+ You are forbidden to forbid anyone else to use, share and improve
154+ what you give them. Help stamp out software-hoarding! */
155+
156+#include "config.h"
157+#include "system.h"
158+#include "file-map.h"
159+
160+/* Structure recording the mapping from source file and directory
161+ names at compile time to __FILE__ */
162+typedef struct file_prefix_map
163+{
164+ const char *old_prefix;
165+ const char *new_prefix;
166+ size_t old_len;
167+ size_t new_len;
168+ struct file_prefix_map *next;
169+} file_prefix_map;
170+
171+/* Linked list of such structures. */
172+static file_prefix_map *file_prefix_maps;
173+
174+/* Record prefix mapping of __FILE__. ARG is the argument to
175+ -ffile-prefix-map and must be of the form OLD=NEW. */
176+int
177+add_file_prefix_map (const char *arg)
178+{
179+ file_prefix_map *map;
180+ const char *p;
181+
182+ p = strchr (arg, '=');
183+ if (!p)
184+ {
185+ fprintf(stderr, "invalid argument %qs to -ffile-prefix-map", arg);
186+ return -1;
187+ }
188+ map = XNEW (file_prefix_map);
189+ map->old_prefix = xstrndup (arg, p - arg);
190+ map->old_len = p - arg;
191+ p++;
192+ map->new_prefix = xstrdup (p);
193+ map->new_len = strlen (p);
194+ map->next = file_prefix_maps;
195+ file_prefix_maps = map;
196+
197+ return 0;
198+}
199+
200+/* Perform user-specified mapping of __FILE__ prefixes. Return
201+ the new name corresponding to filename. */
202+
203+const char *
204+remap_file_filename (const char *filename)
205+{
206+ file_prefix_map *map;
207+ char *s;
208+ const char *name;
209+ size_t name_len;
210+
211+ for (map = file_prefix_maps; map; map = map->next)
212+ if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
213+ break;
214+ if (!map)
215+ return filename;
216+ name = filename + map->old_len;
217+ name_len = strlen (name) + 1;
218+ s = (char *) alloca (name_len + map->new_len);
219+ memcpy (s, map->new_prefix, map->new_len);
220+ memcpy (s + map->new_len, name, name_len);
221+
222+ return xstrdup (s);
223+}
224+
225+
226diff --git a/libcpp/include/file-map.h b/libcpp/include/file-map.h
227new file mode 100644
228index 00000000000..87503152d27
229--- /dev/null
230+++ b/libcpp/include/file-map.h
231@@ -0,0 +1,30 @@
232+/* Map one directory name to another in __FILE__, __BASE_FILE__
233+ and __builtin_FILE ().
234+ Copyright (C) 2001-2016 Free Software Foundation, Inc.
235+
236+This program is free software; you can redistribute it and/or modify it
237+under the terms of the GNU General Public License as published by the
238+Free Software Foundation; either version 3, or (at your option) any
239+later version.
240+
241+This program is distributed in the hope that it will be useful,
242+but WITHOUT ANY WARRANTY; without even the implied warranty of
243+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
244+GNU General Public License for more details.
245+
246+You should have received a copy of the GNU General Public License
247+along with this program; see the file COPYING3. If not see
248+<http://www.gnu.org/licenses/>.
249+
250+ In other words, you are welcome to use, share and improve this program.
251+ You are forbidden to forbid anyone else to use, share and improve
252+ what you give them. Help stamp out software-hoarding! */
253+
254+#ifndef LIBCPP_FILE_MAP_H
255+#define LIBCPP_FILE_MAP_H
256+
257+const char * remap_file_filename (const char *filename);
258+
259+int add_file_prefix_map (const char *arg);
260+
261+#endif /* !LIBCPP_FILE_MAP_H */
262diff --git a/libcpp/macro.c b/libcpp/macro.c
263index de18c2210cf..2748c70d520 100644
264--- a/libcpp/macro.c
265+++ b/libcpp/macro.c
266@@ -26,6 +26,7 @@ along with this program; see the file COPYING3. If not see
267 #include "system.h"
268 #include "cpplib.h"
269 #include "internal.h"
270+#include "file-map.h"
271
272 typedef struct macro_arg macro_arg;
273 /* This structure represents the tokens of a macro argument. These
274@@ -301,6 +302,7 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node,
275 if (!name)
276 abort ();
277 }
278+ name = remap_file_filename (name);
279 len = strlen (name);
280 buf = _cpp_unaligned_alloc (pfile, len * 2 + 3);
281 result = buf;
282--
2832.12.2
284
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0042-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch b/meta/recipes-devtools/gcc/gcc-7.3/0042-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
deleted file mode 100644
index 524716790f..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0042-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From ddddc7335539fb8a6d30beba21781762df159186 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Wed, 16 Mar 2016 05:39:59 -0400
4Subject: [PATCH 42/47] Reuse -fdebug-prefix-map to replace -ffile-prefix-map
5
6The oe-core may use external toolchain to compile,
7which may not support -ffile-prefix-map.
8
9Since we use -fdebug-prefix-map to do the same thing,
10so we could reuse it to replace -ffile-prefix-map.
11
12Upstream-Status: Inappropriate[oe-core specific]
13
14Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
15---
16 gcc/opts-global.c | 4 ++++
17 1 file changed, 4 insertions(+)
18
19diff --git a/gcc/opts-global.c b/gcc/opts-global.c
20index 50bad77c347..32b1d286721 100644
21--- a/gcc/opts-global.c
22+++ b/gcc/opts-global.c
23@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
24 #include "langhooks.h"
25 #include "dbgcnt.h"
26 #include "debug.h"
27+#include "file-map.h"
28 #include "output.h"
29 #include "plugin.h"
30 #include "toplev.h"
31@@ -357,6 +358,9 @@ handle_common_deferred_options (void)
32
33 case OPT_fdebug_prefix_map_:
34 add_debug_prefix_map (opt->arg);
35+
36+ /* Reuse -fdebug-prefix-map to replace -ffile-prefix-map */
37+ add_file_prefix_map (opt->arg);
38 break;
39
40 case OPT_fdump_:
41--
422.12.2
43
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch b/meta/recipes-devtools/gcc/gcc-7.3/0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch
deleted file mode 100644
index 74a5c86446..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch
+++ /dev/null
@@ -1,54 +0,0 @@
1From 5bc97be388485a5f8dd85db34372a1299bffd263 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Thu, 24 Mar 2016 11:23:14 -0400
4Subject: [PATCH 43/47] gcc/final.c: -fdebug-prefix-map support to remap
5 sources with relative path
6
7PR other/70428
8* final.c (remap_debug_filename): Use lrealpath to translate
9relative path before remapping
10
11https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70428
12Upstream-Status: Submitted [gcc-patches@gcc.gnu.org]
13
14Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
15---
16 gcc/final.c | 15 ++++++++++++---
17 1 file changed, 12 insertions(+), 3 deletions(-)
18
19diff --git a/gcc/final.c b/gcc/final.c
20index 820162b2d28..d74cb901abd 100644
21--- a/gcc/final.c
22+++ b/gcc/final.c
23@@ -1559,16 +1559,25 @@ remap_debug_filename (const char *filename)
24 const char *name;
25 size_t name_len;
26
27+ /* Support to remap filename with relative path */
28+ char *realpath = lrealpath (filename);
29+ if (realpath == NULL)
30+ return filename;
31+
32 for (map = debug_prefix_maps; map; map = map->next)
33- if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
34+ if (filename_ncmp (realpath, map->old_prefix, map->old_len) == 0)
35 break;
36 if (!map)
37- return filename;
38- name = filename + map->old_len;
39+ {
40+ free (realpath);
41+ return filename;
42+ }
43+ name = realpath + map->old_len;
44 name_len = strlen (name) + 1;
45 s = (char *) alloca (name_len + map->new_len);
46 memcpy (s, map->new_prefix, map->new_len);
47 memcpy (s + map->new_len, name, name_len);
48+ free (realpath);
49 return ggc_strdup (s);
50 }
51
52--
532.12.2
54
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch b/meta/recipes-devtools/gcc/gcc-7.3/0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch
deleted file mode 100644
index f4dd891717..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch
+++ /dev/null
@@ -1,513 +0,0 @@
1From 847aec764540636ec654fd7a012e271afa8d4e0f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Apr 2016 20:03:28 +0000
4Subject: [PATCH 44/47] libgcc: Add knob to use ldbl-128 on ppc
5
6musl does not support ldbl 128 so we can not assume
7that linux as a whole supports ldbl-128 bits, instead
8act upon configure option passed to gcc and assume no
9on musl and yes otherwise if no option is passed since
10default behaviour is to assume ldbl128 it does not
11change the defaults
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14Upstream-Status: Pending
15---
16 libgcc/Makefile.in | 1 +
17 libgcc/config/rs6000/t-linux | 5 ++++-
18 libgcc/configure | 18 ++++++++++++++++++
19 libgcc/configure.ac | 12 ++++++++++++
20 4 files changed, 35 insertions(+), 1 deletion(-)
21 mode change 100644 => 100755 libgcc/configure
22
23diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
24index a1a392de88d..2fe6889a342 100644
25--- a/libgcc/Makefile.in
26+++ b/libgcc/Makefile.in
27@@ -48,6 +48,7 @@ unwind_header = @unwind_header@
28 md_unwind_header = @md_unwind_header@
29 sfp_machine_header = @sfp_machine_header@
30 thread_header = @thread_header@
31+with_ldbl128 = @with_ldbl128@
32
33 host_noncanonical = @host_noncanonical@
34 real_host_noncanonical = @real_host_noncanonical@
35diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
36index 4f6d4c4a4d2..c50dd94a2da 100644
37--- a/libgcc/config/rs6000/t-linux
38+++ b/libgcc/config/rs6000/t-linux
39@@ -1,3 +1,9 @@
40 SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
41
42-HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
43+ifeq ($(with_ldbl128),yes)
44+HOST_LIBGCC2_CFLAGS += -mlong-double-128
45+else
46+# We do not want to build ibm-ldouble.c.
47+LIB2ADD := $(filter-out %ibm-ldouble.c, $(LIB2ADD))
48+endif
49+HOST_LIBGCC2_CFLAGS += -mno-minimal-toc
50diff --git a/libgcc/config/rs6000/fixtfdi.c b/libgcc/config/rs6000/fixtfdi.c
51new file mode 100644
52index 0000000..9b979d0
53--- /dev/null
54+++ b/libgcc/config/rs6000/fixtfdi.c
55@@ -0,0 +1,42 @@
56+/* Software floating-point emulation.
57+ Convert a to 64bit signed integer
58+ Copyright (C) 1997-2016 Free Software Foundation, Inc.
59+ This file is part of the GNU C Library.
60+ Contributed by Richard Henderson (rth@cygnus.com) and
61+ Jakub Jelinek (jj@ultra.linux.cz).
62+
63+ The GNU C Library is free software; you can redistribute it and/or
64+ modify it under the terms of the GNU Lesser General Public
65+ License as published by the Free Software Foundation; either
66+ version 2.1 of the License, or (at your option) any later version.
67+
68+ In addition to the permissions in the GNU Lesser General Public
69+ License, the Free Software Foundation gives you unlimited
70+ permission to link the compiled version of this file into
71+ combinations with other programs, and to distribute those
72+ combinations without any restriction coming from the use of this
73+ file. (The Lesser General Public License restrictions do apply in
74+ other respects; for example, they cover modification of the file,
75+ and distribution when not linked into a combine executable.)
76+
77+ The GNU C Library is distributed in the hope that it will be useful,
78+ but WITHOUT ANY WARRANTY; without even the implied warranty of
79+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
80+ Lesser General Public License for more details.
81+
82+ You should have received a copy of the GNU Lesser General Public
83+ License along with the GNU C Library; if not, see
84+ <http://www.gnu.org/licenses/>. */
85+
86+#ifdef _ARCH_PPC64
87+#include "soft-fp.h"
88+#include "quad-float128.h"
89+
90+DItype
91+__fixtfdi (TFtype a)
92+{
93+ if (a < 0)
94+ return - __fixunstfdi (-a);
95+ return __fixunstfdi (a);
96+}
97+#endif
98diff --git a/libgcc/config/rs6000/fixunstfdi.c b/libgcc/config/rs6000/fixunstfdi.c
99new file mode 100644
100index 0000000..65e9590
101--- /dev/null
102+++ b/libgcc/config/rs6000/fixunstfdi.c
103@@ -0,0 +1,58 @@
104+/* Software floating-point emulation.
105+ Convert a to 64bit unsigned integer
106+ Copyright (C) 1997-2016 Free Software Foundation, Inc.
107+ This file is part of the GNU C Library.
108+ Contributed by Richard Henderson (rth@cygnus.com) and
109+ Jakub Jelinek (jj@ultra.linux.cz).
110+
111+ The GNU C Library is free software; you can redistribute it and/or
112+ modify it under the terms of the GNU Lesser General Public
113+ License as published by the Free Software Foundation; either
114+ version 2.1 of the License, or (at your option) any later version.
115+
116+ In addition to the permissions in the GNU Lesser General Public
117+ License, the Free Software Foundation gives you unlimited
118+ permission to link the compiled version of this file into
119+ combinations with other programs, and to distribute those
120+ combinations without any restriction coming from the use of this
121+ file. (The Lesser General Public License restrictions do apply in
122+ other respects; for example, they cover modification of the file,
123+ and distribution when not linked into a combine executable.)
124+
125+ The GNU C Library is distributed in the hope that it will be useful,
126+ but WITHOUT ANY WARRANTY; without even the implied warranty of
127+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
128+ Lesser General Public License for more details.
129+
130+ You should have received a copy of the GNU Lesser General Public
131+ License along with the GNU C Library; if not, see
132+ <http://www.gnu.org/licenses/>. */
133+
134+#ifdef _ARCH_PPC64
135+#include "soft-fp.h"
136+#include "quad-float128.h"
137+
138+DItype
139+__fixunstfdi (TFtype a)
140+{
141+ if (a < 0)
142+ return 0;
143+
144+ /* Compute high word of result, as a flonum. */
145+ const TFtype b = (a / (((UDItype) 1) << (sizeof (SItype) * 8)));
146+ /* Convert that to fixed (but not to DItype!),
147+ and shift it into the high word. */
148+ UDItype v = (USItype) b;
149+ v <<= (sizeof (SItype) * 8);
150+ /* Remove high part from the TFtype, leaving the low part as flonum. */
151+ a -= (TFtype) v;
152+ /* Convert that to fixed (but not to DItype!) and add it in.
153+ Sometimes A comes out negative. This is significant, since
154+ A has more bits than a long int does. */
155+ if (a < 0)
156+ v -= (USItype) (-a);
157+ else
158+ v += (USItype) a;
159+ return v;
160+}
161+#endif
162diff --git a/libgcc/config/rs6000/floatditf.c b/libgcc/config/rs6000/floatditf.c
163new file mode 100644
164index 0000000..20ad4c6
165--- /dev/null
166+++ b/libgcc/config/rs6000/floatditf.c
167@@ -0,0 +1,47 @@
168+/* Software floating-point emulation.
169+ Convert a 64bit signed integer to IEEE quad
170+ Copyright (C) 1997-2016 Free Software Foundation, Inc.
171+ This file is part of the GNU C Library.
172+ Contributed by Richard Henderson (rth@cygnus.com) and
173+ Jakub Jelinek (jj@ultra.linux.cz).
174+
175+ The GNU C Library is free software; you can redistribute it and/or
176+ modify it under the terms of the GNU Lesser General Public
177+ License as published by the Free Software Foundation; either
178+ version 2.1 of the License, or (at your option) any later version.
179+
180+ In addition to the permissions in the GNU Lesser General Public
181+ License, the Free Software Foundation gives you unlimited
182+ permission to link the compiled version of this file into
183+ combinations with other programs, and to distribute those
184+ combinations without any restriction coming from the use of this
185+ file. (The Lesser General Public License restrictions do apply in
186+ other respects; for example, they cover modification of the file,
187+ and distribution when not linked into a combine executable.)
188+
189+ The GNU C Library is distributed in the hope that it will be useful,
190+ but WITHOUT ANY WARRANTY; without even the implied warranty of
191+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
192+ Lesser General Public License for more details.
193+
194+ You should have received a copy of the GNU Lesser General Public
195+ License along with the GNU C Library; if not, see
196+ <http://www.gnu.org/licenses/>. */
197+
198+#ifdef _ARCH_PPC64
199+#include "soft-fp.h"
200+#include "double.h"
201+#include "quad-float128.h"
202+
203+TFtype
204+__floatditf (DItype u)
205+{
206+ DFtype dh, dl;
207+
208+ dh = (SItype) (u >> (sizeof (SItype) * 8));
209+ dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1));
210+ dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1));
211+
212+ return (TFtype) dh + (TFtype) dl;
213+}
214+#endif
215diff --git a/libgcc/config/rs6000/floatunditf.c b/libgcc/config/rs6000/floatunditf.c
216new file mode 100644
217index 0000000..23dbde2
218--- /dev/null
219+++ b/libgcc/config/rs6000/floatunditf.c
220@@ -0,0 +1,47 @@
221+/* Software floating-point emulation.
222+ Convert a 64bit unsigned integer to IEEE quad
223+ Copyright (C) 1997-2016 Free Software Foundation, Inc.
224+ This file is part of the GNU C Library.
225+ Contributed by Richard Henderson (rth@cygnus.com) and
226+ Jakub Jelinek (jj@ultra.linux.cz).
227+
228+ The GNU C Library is free software; you can redistribute it and/or
229+ modify it under the terms of the GNU Lesser General Public
230+ License as published by the Free Software Foundation; either
231+ version 2.1 of the License, or (at your option) any later version.
232+
233+ In addition to the permissions in the GNU Lesser General Public
234+ License, the Free Software Foundation gives you unlimited
235+ permission to link the compiled version of this file into
236+ combinations with other programs, and to distribute those
237+ combinations without any restriction coming from the use of this
238+ file. (The Lesser General Public License restrictions do apply in
239+ other respects; for example, they cover modification of the file,
240+ and distribution when not linked into a combine executable.)
241+
242+ The GNU C Library is distributed in the hope that it will be useful,
243+ but WITHOUT ANY WARRANTY; without even the implied warranty of
244+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
245+ Lesser General Public License for more details.
246+
247+ You should have received a copy of the GNU Lesser General Public
248+ License along with the GNU C Library; if not, see
249+ <http://www.gnu.org/licenses/>. */
250+
251+#ifdef _ARCH_PPC64
252+#include "soft-fp.h"
253+#include "double.h"
254+#include "quad-float128.h"
255+
256+TFtype
257+__floatunditf (UDItype u)
258+{
259+ DFtype dh, dl;
260+
261+ dh = (USItype) (u >> (sizeof (SItype) * 8));
262+ dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1));
263+ dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1));
264+
265+ return (TFtype) dh + (TFtype) dl;
266+}
267+#endif
268diff --git a/libgcc/config/rs6000/ppc64-fp.c b/libgcc/config/rs6000/ppc64-fp.c
269index 5e1cbdd..70ad3c9 100644
270--- a/libgcc/config/rs6000/ppc64-fp.c
271+++ b/libgcc/config/rs6000/ppc64-fp.c
272@@ -25,33 +25,20 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
273 <http://www.gnu.org/licenses/>. */
274
275 #if defined(__powerpc64__) || defined (__64BIT__) || defined(__ppc64__)
276-#define TMODES
277 #include "fp-bit.h"
278
279-extern DItype __fixtfdi (TFtype);
280 extern DItype __fixdfdi (DFtype);
281 extern DItype __fixsfdi (SFtype);
282 extern USItype __fixunsdfsi (DFtype);
283 extern USItype __fixunssfsi (SFtype);
284-extern TFtype __floatditf (DItype);
285-extern TFtype __floatunditf (UDItype);
286 extern DFtype __floatdidf (DItype);
287 extern DFtype __floatundidf (UDItype);
288 extern SFtype __floatdisf (DItype);
289 extern SFtype __floatundisf (UDItype);
290-extern DItype __fixunstfdi (TFtype);
291
292 static DItype local_fixunssfdi (SFtype);
293 static DItype local_fixunsdfdi (DFtype);
294
295-DItype
296-__fixtfdi (TFtype a)
297-{
298- if (a < 0)
299- return - __fixunstfdi (-a);
300- return __fixunstfdi (a);
301-}
302-
303 DItype
304 __fixdfdi (DFtype a)
305 {
306@@ -86,30 +73,6 @@ __fixunssfsi (SFtype a)
307 return (SItype) a;
308 }
309
310-TFtype
311-__floatditf (DItype u)
312-{
313- DFtype dh, dl;
314-
315- dh = (SItype) (u >> (sizeof (SItype) * 8));
316- dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1));
317- dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1));
318-
319- return (TFtype) dh + (TFtype) dl;
320-}
321-
322-TFtype
323-__floatunditf (UDItype u)
324-{
325- DFtype dh, dl;
326-
327- dh = (USItype) (u >> (sizeof (SItype) * 8));
328- dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1));
329- dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1));
330-
331- return (TFtype) dh + (TFtype) dl;
332-}
333-
334 DFtype
335 __floatdidf (DItype u)
336 {
337@@ -183,30 +146,6 @@ __floatundisf (UDItype u)
338 return (SFtype) f;
339 }
340
341-DItype
342-__fixunstfdi (TFtype a)
343-{
344- if (a < 0)
345- return 0;
346-
347- /* Compute high word of result, as a flonum. */
348- const TFtype b = (a / (((UDItype) 1) << (sizeof (SItype) * 8)));
349- /* Convert that to fixed (but not to DItype!),
350- and shift it into the high word. */
351- UDItype v = (USItype) b;
352- v <<= (sizeof (SItype) * 8);
353- /* Remove high part from the TFtype, leaving the low part as flonum. */
354- a -= (TFtype) v;
355- /* Convert that to fixed (but not to DItype!) and add it in.
356- Sometimes A comes out negative. This is significant, since
357- A has more bits than a long int does. */
358- if (a < 0)
359- v -= (USItype) (-a);
360- else
361- v += (USItype) a;
362- return v;
363-}
364-
365 /* This version is needed to prevent recursion; fixunsdfdi in libgcc
366 calls fixdfdi, which in turn calls calls fixunsdfdi. */
367
368diff --git a/libgcc/config/rs6000/quad-float128.h b/libgcc/config/rs6000/quad-float128.h
369index 7d69c87..a0c2664 100644
370--- a/libgcc/config/rs6000/quad-float128.h
371+++ b/libgcc/config/rs6000/quad-float128.h
372@@ -99,6 +99,11 @@ extern TItype_ppc __fixkfti (TFtype);
373 extern UTItype_ppc __fixunskfti (TFtype);
374 extern TFtype __floattikf (TItype_ppc);
375 extern TFtype __floatuntikf (UTItype_ppc);
376+
377+extern DItype_ppc __fixtfdi (TFtype);
378+extern DItype_ppc __fixunstfdi (TFtype);
379+extern TFtype __floatditf (DItype_ppc);
380+extern TFtype __floatunditf (UDItype_ppc);
381 #endif
382
383 /* Functions using the ISA 3.0 hardware support. If the code is compiled with
384diff --git a/libgcc/config/rs6000/t-float128 b/libgcc/config/rs6000/t-float128
385index 2c52ca6..3a241aa 100644
386--- a/libgcc/config/rs6000/t-float128
387+++ b/libgcc/config/rs6000/t-float128
388@@ -24,6 +24,7 @@ fp128_softfp_obj = $(fp128_softfp_static_obj) $(fp128_softfp_shared_obj)
389
390 # New functions for software emulation
391 fp128_ppc_funcs = floattikf floatuntikf fixkfti fixunskfti \
392+ floatditf floatunditf fixtfdi fixunstfdi \
393 extendkftf2-sw trunctfkf2-sw \
394 sfp-exceptions _mulkc3 _divkc3
395
396@@ -58,7 +59,7 @@ fp128_includes = $(srcdir)/soft-fp/double.h \
397 $(srcdir)/soft-fp/soft-fp.h
398
399 # Build the emulator without ISA 3.0 hardware support.
400-FP128_CFLAGS_SW = -Wno-type-limits -mvsx -mfloat128 \
401+FP128_CFLAGS_SW = -Wno-type-limits -mvsx -mfloat128 -mfloat128-type \
402 -mno-float128-hardware \
403 -I$(srcdir)/soft-fp \
404 -I$(srcdir)/config/rs6000 \
405diff --git a/libgcc/config/rs6000/t-float128-hw b/libgcc/config/rs6000/t-float128-hw
406index 161062f..0476874 100644
407--- a/libgcc/config/rs6000/t-float128-hw
408+++ b/libgcc/config/rs6000/t-float128-hw
409@@ -21,7 +21,7 @@ fp128_ifunc_obj = $(fp128_ifunc_static_obj) $(fp128_ifunc_shared_obj)
410 fp128_sed_hw = -hw
411
412 # Build the hardware support functions with appropriate hardware support
413-FP128_CFLAGS_HW = -Wno-type-limits -mvsx -mfloat128 \
414+FP128_CFLAGS_HW = -Wno-type-limits -mvsx -mfloat128 -mfloat128-type \
415 -mpower8-vector -mpower9-vector \
416 -mfloat128-hardware \
417 -I$(srcdir)/soft-fp \
418diff --git a/libgcc/configure b/libgcc/configure
419old mode 100644
420new mode 100755
421index 45c459788c3..e2d19b144b8
422--- a/libgcc/configure
423+++ b/libgcc/configure
424@@ -618,6 +618,7 @@ build_vendor
425 build_cpu
426 build
427 with_aix_soname
428+with_ldbl128
429 enable_vtable_verify
430 enable_shared
431 libgcc_topdir
432@@ -667,6 +668,7 @@ with_cross_host
433 with_ld
434 enable_shared
435 enable_vtable_verify
436+with_long_double_128
437 with_aix_soname
438 enable_version_specific_runtime_libs
439 with_slibdir
440@@ -1324,6 +1326,7 @@ Optional Packages:
441 --with-target-subdir=SUBDIR Configuring in a subdirectory for target
442 --with-cross-host=HOST Configuring with a cross compiler
443 --with-ld arrange to use the specified ld (full pathname)
444+ --with-long-double-128 use 128-bit long double by default
445 --with-aix-soname=aix|svr4|both
446 shared library versioning (aka "SONAME") variant to
447 provide on AIX
448@@ -2208,6 +2211,21 @@ fi
449
450
451
452+# Check whether --with-long-double-128 was given.
453+if test "${with_long_double_128+set}" = set; then :
454+ withval=$with_long_double_128; with_ldbl128="$with_long_double_128"
455+else
456+ case "${host}" in
457+ power*-*-musl*)
458+ with_ldbl128="no";;
459+ *) with_ldbl128="yes";;
460+ esac
461+
462+fi
463+
464+
465+
466+
467 # Check whether --with-aix-soname was given.
468 if test "${with_aix_soname+set}" = set; then :
469 withval=$with_aix_soname; case "${host}:${enable_shared}" in
470@@ -4999,7 +4999,7 @@ case ${host} in
471 # for hardware support.
472 powerpc*-*-linux*)
473 saved_CFLAGS="$CFLAGS"
474- CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128"
475+ CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128 -mfloat128-type"
476 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC ISA 2.06 to build __float128 libraries" >&5
477 $as_echo_n "checking for PowerPC ISA 2.06 to build __float128 libraries... " >&6; }
478 if test "${libgcc_cv_powerpc_float128+set}" = set; then :
479diff --git a/libgcc/configure.ac b/libgcc/configure.ac
480index af151473709..dada52416da 100644
481--- a/libgcc/configure.ac
482+++ b/libgcc/configure.ac
483@@ -77,6 +77,18 @@ AC_ARG_ENABLE(vtable-verify,
484 [enable_vtable_verify=no])
485 AC_SUBST(enable_vtable_verify)
486
487+AC_ARG_WITH(long-double-128,
488+[AS_HELP_STRING([--with-long-double-128],
489+ [use 128-bit long double by default])],
490+ with_ldbl128="$with_long_double_128",
491+[case "${host}" in
492+ power*-*-musl*)
493+ with_ldbl128="no";;
494+ *) with_ldbl128="yes";;
495+ esac
496+])
497+AC_SUBST(with_ldbl128)
498+
499 AC_ARG_WITH(aix-soname,
500 [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
501 [shared library versioning (aka "SONAME") variant to provide on AIX])],
502@@ -394,7 +394,7 @@ case ${host} in
503 # for hardware support.
504 powerpc*-*-linux*)
505 saved_CFLAGS="$CFLAGS"
506- CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128"
507+ CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128 -mfloat128-type"
508 AC_CACHE_CHECK([for PowerPC ISA 2.06 to build __float128 libraries],
509 [libgcc_cv_powerpc_float128],
510 [AC_COMPILE_IFELSE(
511--
5122.12.2
513
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0045-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch b/meta/recipes-devtools/gcc/gcc-7.3/0045-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch
deleted file mode 100644
index 3aa038c913..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0045-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From 92beb883ab57a23a35ba76c496bc1f4cabb1690e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 4 May 2016 21:11:34 -0700
4Subject: [PATCH 45/47] Link libgcc using LDFLAGS, not just SHLIB_LDFLAGS
5
6Upstream-Status: Pending
7
8Signed-off-by: Christopher Larson <chris_larson@mentor.com>
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 libgcc/config/t-slibgcc | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/libgcc/config/t-slibgcc b/libgcc/config/t-slibgcc
15index 76be7710960..a1ee2ee26ed 100644
16--- a/libgcc/config/t-slibgcc
17+++ b/libgcc/config/t-slibgcc
18@@ -32,7 +32,7 @@ SHLIB_INSTALL_SOLINK = $(LN_S) $(SHLIB_SONAME) \
19 $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
20
21 SHLIB_LINK = $(CC) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
22- $(SHLIB_LDFLAGS) \
23+ $(LDFLAGS) $(SHLIB_LDFLAGS) \
24 -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \
25 $(SHLIB_OBJS) $(SHLIB_LC) && \
26 rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \
27--
282.12.2
29
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0047-sync-gcc-stddef.h-with-musl.patch b/meta/recipes-devtools/gcc/gcc-7.3/0047-sync-gcc-stddef.h-with-musl.patch
deleted file mode 100644
index 65d22f169c..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0047-sync-gcc-stddef.h-with-musl.patch
+++ /dev/null
@@ -1,91 +0,0 @@
1From 9b951c8f6b0aaff7c16dc4db72b5e56ec73810bb Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 3 Feb 2017 12:56:00 -0800
4Subject: [PATCH 47/47] sync gcc stddef.h with musl
5
6musl defines ptrdiff_t size_t and wchar_t
7so dont define them here if musl is definining them
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11Upstream-Status: Inappropriate [OE-Specific]
12
13 gcc/ginclude/stddef.h | 9 +++++++++
14 1 file changed, 9 insertions(+)
15
16diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h
17index 872f451cac9..7e90938387c 100644
18--- a/gcc/ginclude/stddef.h
19+++ b/gcc/ginclude/stddef.h
20@@ -134,6 +134,7 @@ _TYPE_wchar_t;
21 #ifndef ___int_ptrdiff_t_h
22 #ifndef _GCC_PTRDIFF_T
23 #ifndef _PTRDIFF_T_DECLARED /* DragonFly */
24+#ifndef __DEFINED_ptrdiff_t /* musl */
25 #define _PTRDIFF_T
26 #define _T_PTRDIFF_
27 #define _T_PTRDIFF
28@@ -143,10 +144,12 @@ _TYPE_wchar_t;
29 #define ___int_ptrdiff_t_h
30 #define _GCC_PTRDIFF_T
31 #define _PTRDIFF_T_DECLARED
32+#define __DEFINED_ptrdiff_t /* musl */
33 #ifndef __PTRDIFF_TYPE__
34 #define __PTRDIFF_TYPE__ long int
35 #endif
36 typedef __PTRDIFF_TYPE__ ptrdiff_t;
37+#endif /* __DEFINED_ptrdiff_t */
38 #endif /* _PTRDIFF_T_DECLARED */
39 #endif /* _GCC_PTRDIFF_T */
40 #endif /* ___int_ptrdiff_t_h */
41@@ -184,6 +187,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
42 #ifndef _GCC_SIZE_T
43 #ifndef _SIZET_
44 #ifndef __size_t
45+#ifndef __DEFINED_size_t /* musl */
46 #define __size_t__ /* BeOS */
47 #define __SIZE_T__ /* Cray Unicos/Mk */
48 #define _SIZE_T
49@@ -200,6 +204,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
50 #define ___int_size_t_h
51 #define _GCC_SIZE_T
52 #define _SIZET_
53+#define __DEFINED_size_t /* musl */
54 #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
55 || defined(__DragonFly__) \
56 || defined(__FreeBSD_kernel__)
57@@ -235,6 +240,7 @@ typedef long ssize_t;
58 #endif /* _SIZE_T */
59 #endif /* __SIZE_T__ */
60 #endif /* __size_t__ */
61+#endif /* __DEFINED_size_t */
62 #undef __need_size_t
63 #endif /* _STDDEF_H or __need_size_t. */
64
65@@ -264,6 +270,7 @@ typedef long ssize_t;
66 #ifndef ___int_wchar_t_h
67 #ifndef __INT_WCHAR_T_H
68 #ifndef _GCC_WCHAR_T
69+#ifndef __DEFINED_wchar_t /* musl */
70 #define __wchar_t__ /* BeOS */
71 #define __WCHAR_T__ /* Cray Unicos/Mk */
72 #define _WCHAR_T
73@@ -279,6 +286,7 @@ typedef long ssize_t;
74 #define __INT_WCHAR_T_H
75 #define _GCC_WCHAR_T
76 #define _WCHAR_T_DECLARED
77+#define __DEFINED_wchar_t /* musl */
78
79 /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
80 instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
81@@ -344,6 +352,7 @@ typedef __WCHAR_TYPE__ wchar_t;
82 #endif
83 #endif /* __WCHAR_T__ */
84 #endif /* __wchar_t__ */
85+#endif /* __DEFINED_wchar_t musl */
86 #undef __need_wchar_t
87 #endif /* _STDDEF_H or __need_wchar_t. */
88
89--
902.12.2
91
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0048-gcc-Enable-static-PIE.patch b/meta/recipes-devtools/gcc/gcc-7.3/0048-gcc-Enable-static-PIE.patch
deleted file mode 100644
index a96e91339b..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0048-gcc-Enable-static-PIE.patch
+++ /dev/null
@@ -1,46 +0,0 @@
1From 44ef80688b56beea85c0070840dea1e2a4e34aed Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 13 Jun 2017 12:12:52 -0700
4Subject: [PATCH 49/49] gcc: Enable static PIE
5
6Static PIE support in GCC
7see
8https://gcc.gnu.org/ml/gcc/2015-06/msg00008.html
9
10startfiles before patch:
11 -static -> crt1.o crti.o crtbeginT.o
12 -static -PIE -> crt1.o crti.o crtbeginT.o
13
14after patch:
15 -static -> crt1.o crti.o crtbeginT.o
16 -static -PIE -> rcrt1.o crti.o crtbeginS.o
17
18Upstream-Status: Pending
19
20Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
21
22---
23 gcc/config/gnu-user.h | 6 +++---
24 1 file changed, 3 insertions(+), 3 deletions(-)
25
26diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
27index de605b0..b035bbe 100644
28--- a/gcc/config/gnu-user.h
29+++ b/gcc/config/gnu-user.h
30@@ -52,11 +52,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
31 #define GNU_USER_TARGET_STARTFILE_SPEC \
32 "%{shared:; \
33 pg|p|profile:gcrt1.o%s; \
34- static:crt1.o%s; \
35+ static: %{" PIE_SPEC ": rcrt1.o%s; :crt1.o%s}; \
36 " PIE_SPEC ":Scrt1.o%s; \
37 :crt1.o%s} \
38 crti.o%s \
39- %{static:crtbeginT.o%s; \
40+ %{static: %{" PIE_SPEC ": crtbeginS.o%s; :crtbeginT.o%s}; \
41 shared|" PIE_SPEC ":crtbeginS.o%s; \
42 :crtbegin.o%s} \
43 %{fvtable-verify=none:%s; \
44
452.13.1
46
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0049-gcc-override-TARGET_LIBC_PROVIDES_SSP.patch b/meta/recipes-devtools/gcc/gcc-7.3/0049-gcc-override-TARGET_LIBC_PROVIDES_SSP.patch
deleted file mode 100644
index 7c53c95c3a..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0049-gcc-override-TARGET_LIBC_PROVIDES_SSP.patch
+++ /dev/null
@@ -1,204 +0,0 @@
1From 9815bd97561c778ee0bc0c17f245e88e66570111 Mon Sep 17 00:00:00 2001
2From: sandra <sandra@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Wed, 1 Nov 2017 02:14:19 +0000
4Subject: [PATCH] 2017-10-31 Sandra Loosemore <sandra@codesourcery.com>
5
6 gcc/
7 * configure.ac (--enable-libssp): New.
8 (gcc_cv_libc_provides_ssp): Check for explicit setting before
9 trying to determine target-specific default. Adjust indentation.
10 * configure: Regenerated.
11 * doc/install.texi (Configuration): Expand --disable-libssp
12 documentation.
13
14
15git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254288 138bc75d-0d04-0410-961f-82ee72b054a4
16---
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18Upstream-Status: Backport [https://patchwork.ozlabs.org/patch/823049/]
19
20 gcc/ChangeLog | 9 +++++++++
21 gcc/configure | 26 +++++++++++++++++++++++---
22 gcc/configure.ac | 24 ++++++++++++++++++++----
23 gcc/doc/install.texi | 3 ++-
24 4 files changed, 54 insertions(+), 8 deletions(-)
25
26Index: gcc-7.3.0/gcc/configure.ac
27===================================================================
28--- gcc-7.3.0.orig/gcc/configure.ac
29+++ gcc-7.3.0/gcc/configure.ac
30@@ -5719,10 +5719,25 @@ if test x$gcc_cv_solaris_crts = xyes; th
31 [Define if the system-provided CRTs are present on Solaris.])
32 fi
33
34+AC_ARG_ENABLE(libssp,
35+[AS_HELP_STRING([--enable-libssp], [enable linking against libssp])],
36+[case "${enableval}" in
37+ yes|no)
38+ ;;
39+ *)
40+ AC_MSG_ERROR([unknown libssp setting $enableval])
41+ ;;
42+esac], [])
43+
44 # Test for stack protector support in target C library.
45 AC_CACHE_CHECK(__stack_chk_fail in target C library,
46- gcc_cv_libc_provides_ssp,
47- [gcc_cv_libc_provides_ssp=no
48+ gcc_cv_libc_provides_ssp,
49+ [gcc_cv_libc_provides_ssp=no
50+ if test "x$enable_libssp" = "xno"; then
51+ gcc_cv_libc_provides_ssp=yes
52+ elif test "x$enable_libssp" = "xyes"; then
53+ gcc_cv_libc_provides_ssp=no
54+ else
55 case "$target" in
56 *-*-musl*)
57 # All versions of musl provide stack protector
58@@ -5759,8 +5774,9 @@ AC_CACHE_CHECK(__stack_chk_fail in targe
59 AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes],
60 [echo "no __stack_chk_fail on this target"])
61 ;;
62- *) gcc_cv_libc_provides_ssp=no ;;
63- esac])
64+ *) gcc_cv_libc_provides_ssp=no ;;
65+ esac
66+ fi])
67
68 if test x$gcc_cv_libc_provides_ssp = xyes; then
69 AC_DEFINE(TARGET_LIBC_PROVIDES_SSP, 1,
70Index: gcc-7.3.0/gcc/doc/install.texi
71===================================================================
72--- gcc-7.3.0.orig/gcc/doc/install.texi
73+++ gcc-7.3.0/gcc/doc/install.texi
74@@ -1658,7 +1658,8 @@ not be built.
75
76 @item --disable-libssp
77 Specify that the run-time libraries for stack smashing protection
78-should not be built.
79+should not be built or linked against. On many targets library support
80+is provided by the C library instead.
81
82 @item --disable-libquadmath
83 Specify that the GCC quad-precision math library should not be built.
84Index: gcc-7.3.0/gcc/configure
85===================================================================
86--- gcc-7.3.0.orig/gcc/configure
87+++ gcc-7.3.0/gcc/configure
88@@ -940,6 +940,7 @@ enable_fix_cortex_a53_843419
89 with_glibc_version
90 enable_gnu_unique_object
91 enable_linker_build_id
92+enable_libssp
93 enable_default_ssp
94 with_long_double_128
95 with_gc
96@@ -1679,6 +1680,7 @@ Optional Features:
97 extension on glibc systems
98 --enable-linker-build-id
99 compiler will always pass --build-id to linker
100+ --enable-libssp enable linking against libssp
101 --enable-default-ssp enable Stack Smashing Protection as default
102 --enable-maintainer-mode
103 enable make rules and dependencies not useful (and
104@@ -18450,7 +18452,7 @@ else
105 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
106 lt_status=$lt_dlunknown
107 cat > conftest.$ac_ext <<_LT_EOF
108-#line 18436 "configure"
109+#line 18455 "configure"
110 #include "confdefs.h"
111
112 #if HAVE_DLFCN_H
113@@ -18556,7 +18558,7 @@ else
114 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
115 lt_status=$lt_dlunknown
116 cat > conftest.$ac_ext <<_LT_EOF
117-#line 18542 "configure"
118+#line 18561 "configure"
119 #include "confdefs.h"
120
121 #if HAVE_DLFCN_H
122@@ -25234,6 +25236,7 @@ $as_echo "#define HAVE_AS_SPARC5_VIS4 1"
123
124 fi
125
126+
127 { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for SPARC6 instructions" >&5
128 $as_echo_n "checking assembler for SPARC6 instructions... " >&6; }
129 if test "${gcc_cv_as_sparc_sparc6+set}" = set; then :
130@@ -25270,6 +25273,7 @@ $as_echo "#define HAVE_AS_SPARC6 1" >>co
131
132 fi
133
134+
135 { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for LEON instructions" >&5
136 $as_echo_n "checking assembler for LEON instructions... " >&6; }
137 if test "${gcc_cv_as_sparc_leon+set}" = set; then :
138@@ -28947,6 +28951,18 @@ $as_echo "#define HAVE_SOLARIS_CRTS 1" >
139
140 fi
141
142+# Check whether --enable-libssp was given.
143+if test "${enable_libssp+set}" = set; then :
144+ enableval=$enable_libssp; case "${enableval}" in
145+ yes|no)
146+ ;;
147+ *)
148+ as_fn_error "unknown libssp setting $enableval" "$LINENO" 5
149+ ;;
150+esac
151+fi
152+
153+
154 # Test for stack protector support in target C library.
155 { $as_echo "$as_me:${as_lineno-$LINENO}: checking __stack_chk_fail in target C library" >&5
156 $as_echo_n "checking __stack_chk_fail in target C library... " >&6; }
157@@ -28954,6 +28970,11 @@ if test "${gcc_cv_libc_provides_ssp+set}
158 $as_echo_n "(cached) " >&6
159 else
160 gcc_cv_libc_provides_ssp=no
161+ if test "x$enable_libssp" = "xno"; then
162+ gcc_cv_libc_provides_ssp=yes
163+ elif test "x$enable_libssp" = "xyes"; then
164+ gcc_cv_libc_provides_ssp=no
165+ else
166 case "$target" in
167 *-*-musl*)
168 # All versions of musl provide stack protector
169@@ -29001,8 +29022,9 @@ else
170 fi
171
172 ;;
173- *) gcc_cv_libc_provides_ssp=no ;;
174+ *) gcc_cv_libc_provides_ssp=no ;;
175 esac
176+ fi
177 fi
178 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_libc_provides_ssp" >&5
179 $as_echo "$gcc_cv_libc_provides_ssp" >&6; }
180@@ -29037,18 +29059,15 @@ fi
181
182
183 # Test for <sys/sdt.h> on the target.
184-
185-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
186-$as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
187-have_sys_sdt_h=no
188+#GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
189+#AC_MSG_CHECKING(sys/sdt.h in the target C library)
190+#have_sys_sdt_h=no
191 #if test -f $target_header_dir/sys/sdt.h; then
192 # have_sys_sdt_h=yes
193-#
194-#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
195-#
196+# AC_DEFINE(HAVE_SYS_SDT_H, 1,
197+# [Define if your target C library provides sys/sdt.h])
198 #fi
199-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
200-$as_echo "$have_sys_sdt_h" >&6; }
201+#AC_MSG_RESULT($have_sys_sdt_h)
202
203 # Check if TFmode long double should be used by default or not.
204 # Some glibc targets used DFmode long double, but with glibc 2.4
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0050-powerpc-powerpc64-Add-support-for-musl-ldso.patch b/meta/recipes-devtools/gcc/gcc-7.3/0050-powerpc-powerpc64-Add-support-for-musl-ldso.patch
deleted file mode 100644
index b0c735bb05..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0050-powerpc-powerpc64-Add-support-for-musl-ldso.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1From 3f5f5da776be86b408a15f38c9782f2185f97073 Mon Sep 17 00:00:00 2001
2From: Serhey Popovych <serhe.popovych@gmail.com>
3Date: Tue, 11 Dec 2018 02:30:50 -0500
4Subject: [PATCH] powerpc/powerpc64: Add support for musl ldso
5
6Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
7---
8Upstream-Status: Inappropriate [OE-Specific]
9
10 gcc/config/rs6000/linux64.h | 4 ++--
11 1 file changed, 2 insertions(+), 2 deletions(-)
12
13diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
14index 619e113..ee8b44f 100644
15--- a/gcc/config/rs6000/linux64.h
16+++ b/gcc/config/rs6000/linux64.h
17@@ -421,9 +421,9 @@ extern int dot_symbols;
18 #endif
19
20 #define MUSL_DYNAMIC_LINKER32 \
21- "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
22+ SYSTEMLIBS_DIR "ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
23 #define MUSL_DYNAMIC_LINKER64 \
24- "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
25+ SYSTEMLIBS_DIR "ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
26
27 #define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
28 #define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
29--
302.7.4
31
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch b/meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch
deleted file mode 100644
index c0adef6f2f..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch
+++ /dev/null
@@ -1,49 +0,0 @@
1
2Prevent a segmentation fault which occurs when using incorrect
3structure trying to access name of some named operators, such as
4CPP_NOT, CPP_AND etc. "token->val.node.spelling" cannot be used in
5those cases, as is may not be initialized at all.
6
7
8[YOCTO #11738]
9
10Upstream-Status: Pending
11
12Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
13
14diff --git a/libcpp/lex.c b/libcpp/lex.c
15--- a/libcpp/lex.c
16+++ b/libcpp/lex.c
17@@ -3229,11 +3229,27 @@
18 spell_ident:
19 case SPELL_IDENT:
20 if (forstring)
21- {
22- memcpy (buffer, NODE_NAME (token->val.node.spelling),
23- NODE_LEN (token->val.node.spelling));
24- buffer += NODE_LEN (token->val.node.spelling);
25- }
26+ {
27+ if (token->type == CPP_NAME)
28+ {
29+ memcpy (buffer, NODE_NAME (token->val.node.spelling),
30+ NODE_LEN (token->val.node.spelling));
31+ buffer += NODE_LEN (token->val.node.spelling);
32+ break;
33+ }
34+ /* NAMED_OP, cannot use node.spelling */
35+ if (token->flags & NAMED_OP)
36+ {
37+ const char *str = cpp_named_operator2name (token->type);
38+ if (str)
39+ {
40+ size_t len = strlen(str);
41+ memcpy(buffer, str, len);
42+ buffer += len;
43+ }
44+ break;
45+ }
46+ }
47 else
48 buffer = _cpp_spell_ident_ucns (buffer, token->val.node.node);
49 break;
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/no-sse-fix-test-case-failures.patch b/meta/recipes-devtools/gcc/gcc-7.3/no-sse-fix-test-case-failures.patch
deleted file mode 100644
index cb87c5ab7e..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/no-sse-fix-test-case-failures.patch
+++ /dev/null
@@ -1,259 +0,0 @@
1From f22830da2ba64577deb6f717d05d86c03dd2e50d Mon Sep 17 00:00:00 2001
2From: RAGHUNATH LOLUR <raghunath.lolur@kpit.com>
3Date: Wed, 6 Dec 2017 22:52:26 -0800
4Subject: [PATCH] Fix for testsuite failure
5
62017-11-16 Raghunath Lolur <raghunath.lolur@kpit.com>
7
8 * gcc.dg/pr56275.c: If SSE is disabled, ensure that
9 "-mfpmath" is not set to use SSE. Set "-mfpmath=387".
10 * gcc.dg/pr68306.c: Likewise
11 * gcc.dg/pr68306-2.c: Likewise
12 * gcc.dg/pr68306-3.c: Likewise
13 * gcc.dg/pr69634.c: Likewise
14 * gcc.target/i386/amd64-abi-1.c: Likewise
15 * gcc.target/i386/funcspec-6.c: Likewise
16 * gcc.target/i386/interrupt-387-err-1.c: Likewise
17 * gcc.target/i386/isa-14.c: Likewise
18 * gcc.target/i386/pr44948-2b.c: Likewise
19 * gcc.target/i386/pr53425-1.c: Likewise
20 * gcc.target/i386/pr53425-2.c: Likewise
21 * gcc.target/i386/pr55247.c: Likewise
22 * gcc.target/i386/pr59644.c: Likewise
23 * gcc.target/i386/pr62120.c: Likewise
24 * gcc.target/i386/pr70467-1.c: Likewise
25 * gcc.target/i386/warn-vect-op-1.c: Likewise
26
27If -Wall, -Werror are used during compilation various test cases fail
28to compile.
29
30If SSE is disabled, be sure to -mfpmath=387 to resolve this.
31
32This patch removes the changes to Changelog from the original patch.
33This will help us avoid conflicts.
34
35Upstream-Status: Pending
36
37Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
38---
39 gcc/testsuite/ChangeLog | 21 +++++++++++++++++++++
40 gcc/testsuite/gcc.dg/pr56275.c | 2 +-
41 gcc/testsuite/gcc.dg/pr68306-2.c | 2 +-
42 gcc/testsuite/gcc.dg/pr68306-3.c | 2 +-
43 gcc/testsuite/gcc.dg/pr68306.c | 2 +-
44 gcc/testsuite/gcc.dg/pr69634.c | 2 +-
45 .../gcc/testsuite/gcc.target/i386/amd64-abi-1.c | 2 +-
46 .../gcc/testsuite/gcc.target/i386/funcspec-6.c | 1 +
47 .../testsuite/gcc.target/i386/interrupt-387-err-1.c | 2 +-
48 gcc/testsuite/gcc.target/i386/isa-14.c | 2 +-
49 .../gcc/testsuite/gcc.target/i386/pr44948-2b.c | 2 +-
50 gcc/testsuite/gcc.target/i386/pr53425-1.c | 2 +-
51 gcc/testsuite/gcc.target/i386/pr53425-2.c | 2 +-
52 gcc/testsuite/gcc.target/i386/pr55247.c | 2 +-
53 gcc/testsuite/gcc.target/i386/pr59644.c | 2 +-
54 gcc/testsuite/gcc.target/i386/pr62120.c | 2 +-
55 gcc/testsuite/gcc.target/i386/pr70467-1.c | 2 +-
56 .../gcc/testsuite/gcc.target/i386/warn-vect-op-1.c | 2 +-
57 18 files changed, 38 insertions(+), 16 deletions(-)
58
59diff --git a/gcc/testsuite/gcc.dg/pr56275.c b/gcc/testsuite/gcc.dg/pr56275.c
60index b901bb2..a4f6c95 100644
61--- a/gcc/testsuite/gcc.dg/pr56275.c
62+++ b/gcc/testsuite/gcc.dg/pr56275.c
63@@ -1,6 +1,6 @@
64 /* { dg-do compile } */
65 /* { dg-options "-O2" } */
66-/* { dg-additional-options "-mno-sse" { target { i?86-*-* x86_64-*-* } } } */
67+/* { dg-additional-options "-mno-sse -mfpmath=387" { target { i?86-*-* x86_64-*-* } } } */
68
69 typedef long long v2tw __attribute__ ((vector_size (2 * sizeof (long long))));
70
71diff --git a/gcc/testsuite/gcc.dg/pr68306-2.c b/gcc/testsuite/gcc.dg/pr68306-2.c
72index 4672ebe..2a368c4 100644
73--- a/gcc/testsuite/gcc.dg/pr68306-2.c
74+++ b/gcc/testsuite/gcc.dg/pr68306-2.c
75@@ -1,6 +1,6 @@
76 /* { dg-do compile } */
77 /* { dg-options "-O3" } */
78-/* { dg-additional-options "-mno-sse -mno-mmx" { target i?86-*-* x86_64-*-* } } */
79+/* { dg-additional-options "-mno-sse -mno-mmx -mfpmath=387" { target i?86-*-* x86_64-*-* } } */
80
81 struct {
82 int tz_minuteswest;
83diff --git a/gcc/testsuite/gcc.dg/pr68306-3.c b/gcc/testsuite/gcc.dg/pr68306-3.c
84index f5a8c10..df3390c 100644
85--- a/gcc/testsuite/gcc.dg/pr68306-3.c
86+++ b/gcc/testsuite/gcc.dg/pr68306-3.c
87@@ -1,6 +1,6 @@
88 /* { dg-do compile } */
89 /* { dg-options "-O3" } */
90-/* { dg-additional-options "-mno-sse -mno-mmx" { target i?86-*-* x86_64-*-* } } */
91+/* { dg-additional-options "-mno-sse -mno-mmx -mfpmath=387" { target i?86-*-* x86_64-*-* } } */
92 /* { dg-additional-options "-mno-altivec -mno-vsx" { target powerpc*-*-* } } */
93
94 extern void fn2();
95diff --git a/gcc/testsuite/gcc.dg/pr68306.c b/gcc/testsuite/gcc.dg/pr68306.c
96index 54e5b40..0813389 100644
97--- a/gcc/testsuite/gcc.dg/pr68306.c
98+++ b/gcc/testsuite/gcc.dg/pr68306.c
99@@ -1,6 +1,6 @@
100 /* { dg-do compile } */
101 /* { dg-options "-O3" } */
102-/* { dg-additional-options "-mno-sse -mno-mmx" { target i?86-*-* x86_64-*-* } } */
103+/* { dg-additional-options "-mno-sse -mno-mmx -mfpmath=387" { target i?86-*-* x86_64-*-* } } */
104
105 enum powerpc_pmc_type { PPC_PMC_IBM };
106 struct {
107diff --git a/gcc/testsuite/gcc.dg/pr69634.c b/gcc/testsuite/gcc.dg/pr69634.c
108index 60a5614..bcc23f9 100644
109--- a/gcc/testsuite/gcc.dg/pr69634.c
110+++ b/gcc/testsuite/gcc.dg/pr69634.c
111@@ -1,6 +1,6 @@
112 /* { dg-do compile } */
113 /* { dg-options "-O2 -fno-dce -fschedule-insns -fno-tree-vrp -fcompare-debug -Wno-psabi" } */
114-/* { dg-additional-options "-mno-sse" { target i?86-*-* x86_64-*-* } } */
115+/* { dg-additional-options "-mno-sse -mfpmath=387" { target i?86-*-* x86_64-*-* } } */
116 /* { dg-require-effective-target scheduling } */
117
118 typedef unsigned short u16;
119diff --git a/gcc/testsuite/gcc.target/i386/amd64-abi-1.c b/gcc/testsuite/gcc.target/i386/amd64-abi-1.c
120index 69fde57..7f1f1c0 100644
121--- a/gcc/testsuite/gcc.target/i386/amd64-abi-1.c
122+++ b/gcc/testsuite/gcc.target/i386/amd64-abi-1.c
123@@ -1,5 +1,5 @@
124 /* { dg-do compile { target { ! ia32 } } } */
125-/* { dg-options "-mno-sse" } */
126+/* { dg-options "-mno-sse -mfpmath=387" } */
127 /* { dg-additional-options "-mabi=sysv" { target *-*-mingw* } } */
128
129 double foo(void) { return 0; } /* { dg-error "SSE disabled" } */
130diff --git a/gcc/testsuite/gcc.target/i386/funcspec-6.c b/gcc/testsuite/gcc.target/i386/funcspec-6.c
131index ea896b7..bf15569 100644
132--- a/gcc/testsuite/gcc.target/i386/funcspec-6.c
133+++ b/gcc/testsuite/gcc.target/i386/funcspec-6.c
134@@ -1,6 +1,7 @@
135 /* Test whether all of the 64-bit function specific options are accepted
136 without error. */
137 /* { dg-do compile { target { ! ia32 } } } */
138+/* { dg-additional-options "-mfpmath=387" } */
139
140 #include "funcspec-56.inc"
141
142diff --git a/gcc/testsuite/gcc.target/i386/interrupt-387-err-1.c b/gcc/testsuite/gcc.target/i386/interrupt-387-err-1.c
143index 3fbdc88..6b4d9d1 100644
144--- a/gcc/testsuite/gcc.target/i386/interrupt-387-err-1.c
145+++ b/gcc/testsuite/gcc.target/i386/interrupt-387-err-1.c
146@@ -1,5 +1,5 @@
147 /* { dg-do compile } */
148-/* { dg-options "-O2 -mgeneral-regs-only -mno-cld -mno-iamcu -m80387" } */
149+/* { dg-options "-O2 -mgeneral-regs-only -mno-cld -mno-iamcu -m80387 -mfpmath=387" } */
150
151 typedef unsigned int uword_t __attribute__ ((mode (__word__)));
152
153diff --git a/gcc/testsuite/gcc.target/i386/isa-14.c b/gcc/testsuite/gcc.target/i386/isa-14.c
154index 5d49e6e..1de2db9 100644
155--- a/gcc/testsuite/gcc.target/i386/isa-14.c
156+++ b/gcc/testsuite/gcc.target/i386/isa-14.c
157@@ -1,5 +1,5 @@
158 /* { dg-do run } */
159-/* { dg-options "-march=x86-64 -msse4a -mfma4 -mno-sse" } */
160+/* { dg-options "-march=x86-64 -msse4a -mfma4 -mno-sse -mfpmath=387" } */
161
162 extern void abort (void);
163
164diff --git a/gcc/testsuite/gcc.target/i386/pr44948-2b.c b/gcc/testsuite/gcc.target/i386/pr44948-2b.c
165index fa1769b..f79fb12 100644
166--- a/gcc/testsuite/gcc.target/i386/pr44948-2b.c
167+++ b/gcc/testsuite/gcc.target/i386/pr44948-2b.c
168@@ -1,5 +1,5 @@
169 /* { dg-do compile } */
170-/* { dg-options "-O -mno-sse -Wno-psabi -mtune=generic" } */
171+/* { dg-options "-O -mno-sse -Wno-psabi -mtune=generic -mfpmath=387" } */
172
173 struct A
174 {
175diff --git a/gcc/testsuite/gcc.target/i386/pr53425-1.c b/gcc/testsuite/gcc.target/i386/pr53425-1.c
176index 2e89ff7..6339bf6 100644
177--- a/gcc/testsuite/gcc.target/i386/pr53425-1.c
178+++ b/gcc/testsuite/gcc.target/i386/pr53425-1.c
179@@ -1,6 +1,6 @@
180 /* PR target/53425 */
181 /* { dg-do compile { target { ! ia32 } } } */
182-/* { dg-options "-O2 -mno-sse" } */
183+/* { dg-options "-O2 -mno-sse -mfpmath=387" } */
184 /* { dg-skip-if "no SSE vector" { x86_64-*-mingw* } } */
185
186 typedef double __v2df __attribute__ ((__vector_size__ (16)));
187diff --git a/gcc/testsuite/gcc.target/i386/pr53425-2.c b/gcc/testsuite/gcc.target/i386/pr53425-2.c
188index 61f6283..2c5a55f 100644
189--- a/gcc/testsuite/gcc.target/i386/pr53425-2.c
190+++ b/gcc/testsuite/gcc.target/i386/pr53425-2.c
191@@ -1,6 +1,6 @@
192 /* PR target/53425 */
193 /* { dg-do compile { target { ! ia32 } } } */
194-/* { dg-options "-O2 -mno-sse" } */
195+/* { dg-options "-O2 -mno-sse -mfpmath=387" } */
196 /* { dg-skip-if "no SSE vector" { x86_64-*-mingw* } } */
197
198 typedef float __v2sf __attribute__ ((__vector_size__ (8)));
199diff --git a/gcc/testsuite/gcc.target/i386/pr55247.c b/gcc/testsuite/gcc.target/i386/pr55247.c
200index 23366d0..9810e3a 100644
201--- a/gcc/testsuite/gcc.target/i386/pr55247.c
202+++ b/gcc/testsuite/gcc.target/i386/pr55247.c
203@@ -1,6 +1,6 @@
204 /* { dg-do compile { target { ! ia32 } } } */
205 /* { dg-require-effective-target maybe_x32 } */
206-/* { dg-options "-O2 -mno-sse -mno-mmx -mx32 -maddress-mode=long" } */
207+/* { dg-options "-O2 -mno-sse -mno-mmx -mx32 -maddress-mode=long -mfpmath=387" } */
208
209 typedef unsigned int uint32_t;
210 typedef uint32_t Elf32_Word;
211diff --git a/gcc/testsuite/gcc.target/i386/pr59644.c b/gcc/testsuite/gcc.target/i386/pr59644.c
212index 96006b3..4287e45 100644
213--- a/gcc/testsuite/gcc.target/i386/pr59644.c
214+++ b/gcc/testsuite/gcc.target/i386/pr59644.c
215@@ -1,6 +1,6 @@
216 /* PR target/59644 */
217 /* { dg-do run { target lp64 } } */
218-/* { dg-options "-O2 -ffreestanding -mno-sse -mpreferred-stack-boundary=3 -maccumulate-outgoing-args -mno-red-zone" } */
219+/* { dg-options "-O2 -ffreestanding -mno-sse -mpreferred-stack-boundary=3 -maccumulate-outgoing-args -mno-red-zone -mfpmath=387" } */
220
221 /* This test uses __builtin_trap () instead of e.g. abort,
222 because due to -mpreferred-stack-boundary=3 it should not call
223diff --git a/gcc/testsuite/gcc.target/i386/pr62120.c b/gcc/testsuite/gcc.target/i386/pr62120.c
224index bfb8c47..ed04cf1 100644
225--- a/gcc/testsuite/gcc.target/i386/pr62120.c
226+++ b/gcc/testsuite/gcc.target/i386/pr62120.c
227@@ -1,5 +1,5 @@
228 /* { dg-do compile } */
229-/* { dg-options "-mno-sse" } */
230+/* { dg-options "-mno-sse -mfpmath=387" } */
231
232 void foo ()
233 {
234diff --git a/gcc/testsuite/gcc.target/i386/pr70467-1.c b/gcc/testsuite/gcc.target/i386/pr70467-1.c
235index 4e112c8..bcfb396 100644
236--- a/gcc/testsuite/gcc.target/i386/pr70467-1.c
237+++ b/gcc/testsuite/gcc.target/i386/pr70467-1.c
238@@ -1,6 +1,6 @@
239 /* PR rtl-optimization/70467 */
240 /* { dg-do compile } */
241-/* { dg-options "-O2 -mno-sse" } */
242+/* { dg-options "-O2 -mno-sse -mfpmath=387" } */
243
244 void foo (unsigned long long *);
245
246diff --git a/gcc/testsuite/gcc.target/i386/warn-vect-op-1.c b/gcc/testsuite/gcc.target/i386/warn-vect-op-1.c
247index 6cda153..26e37f5 100644
248--- a/gcc/testsuite/gcc.target/i386/warn-vect-op-1.c
249+++ b/gcc/testsuite/gcc.target/i386/warn-vect-op-1.c
250@@ -1,5 +1,5 @@
251 /* { dg-do compile { target { ! ia32 } } } */
252-/* { dg-options "-mno-sse -Wvector-operation-performance" } */
253+/* { dg-options "-mno-sse -Wvector-operation-performance -mfpmath=387" } */
254 #define vector(elcount, type) \
255 __attribute__((vector_size((elcount)*sizeof(type)))) type
256
257--
2581.8.5.6
259
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian_7.3.bb b/meta/recipes-devtools/gcc/gcc-cross-canadian_7.3.bb
deleted file mode 100644
index bf53c5cd78..0000000000
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian_7.3.bb
+++ /dev/null
@@ -1,5 +0,0 @@
1require recipes-devtools/gcc/gcc-${PV}.inc
2require gcc-cross-canadian.inc
3
4
5
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial_7.3.bb b/meta/recipes-devtools/gcc/gcc-cross-initial_7.3.bb
deleted file mode 100644
index 4c73e5ce61..0000000000
--- a/meta/recipes-devtools/gcc/gcc-cross-initial_7.3.bb
+++ /dev/null
@@ -1,2 +0,0 @@
1require recipes-devtools/gcc/gcc-cross_${PV}.bb
2require gcc-cross-initial.inc
diff --git a/meta/recipes-devtools/gcc/gcc-cross_7.3.bb b/meta/recipes-devtools/gcc/gcc-cross_7.3.bb
deleted file mode 100644
index b43cca0c52..0000000000
--- a/meta/recipes-devtools/gcc/gcc-cross_7.3.bb
+++ /dev/null
@@ -1,3 +0,0 @@
1require recipes-devtools/gcc/gcc-${PV}.inc
2require gcc-cross.inc
3
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_7.3.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_7.3.bb
deleted file mode 100644
index fd90e1140f..0000000000
--- a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_7.3.bb
+++ /dev/null
@@ -1,3 +0,0 @@
1require recipes-devtools/gcc/gcc-cross-initial_${PV}.bb
2require gcc-crosssdk-initial.inc
3
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk_7.3.bb b/meta/recipes-devtools/gcc/gcc-crosssdk_7.3.bb
deleted file mode 100644
index 40a6c4feff..0000000000
--- a/meta/recipes-devtools/gcc/gcc-crosssdk_7.3.bb
+++ /dev/null
@@ -1,2 +0,0 @@
1require recipes-devtools/gcc/gcc-cross_${PV}.bb
2require gcc-crosssdk.inc
diff --git a/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb b/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb
deleted file mode 100644
index 8f31e7792e..0000000000
--- a/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb
+++ /dev/null
@@ -1,7 +0,0 @@
1require recipes-devtools/gcc/gcc-${PV}.inc
2require gcc-runtime.inc
3
4FILES_libgomp-dev += "\
5 ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/openacc.h \
6"
7
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers_7.3.bb b/meta/recipes-devtools/gcc/gcc-sanitizers_7.3.bb
deleted file mode 100644
index 601f666023..0000000000
--- a/meta/recipes-devtools/gcc/gcc-sanitizers_7.3.bb
+++ /dev/null
@@ -1,2 +0,0 @@
1require recipes-devtools/gcc/gcc-${PV}.inc
2require gcc-sanitizers.inc
diff --git a/meta/recipes-devtools/gcc/gcc-source_7.3.bb b/meta/recipes-devtools/gcc/gcc-source_7.3.bb
deleted file mode 100644
index b890fa33ea..0000000000
--- a/meta/recipes-devtools/gcc/gcc-source_7.3.bb
+++ /dev/null
@@ -1,4 +0,0 @@
1require recipes-devtools/gcc/gcc-${PV}.inc
2require recipes-devtools/gcc/gcc-source.inc
3
4EXCLUDE_FROM_WORLD = "1"
diff --git a/meta/recipes-devtools/gcc/gcc_7.3.bb b/meta/recipes-devtools/gcc/gcc_7.3.bb
deleted file mode 100644
index ab208e7026..0000000000
--- a/meta/recipes-devtools/gcc/gcc_7.3.bb
+++ /dev/null
@@ -1,10 +0,0 @@
1require recipes-devtools/gcc/gcc-${PV}.inc
2require gcc-target.inc
3
4# Building with thumb enabled on armv4t armv5t fails with
5# | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7438:(.text.unlikely+0x2fa): relocation truncated to fit: R_ARM_THM_CALL against symbol `fancy_abort(char const*, int, char const*)' defined in .glue_7 section in linker stubs
6# | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7442:(.text.unlikely+0x318): additional relocation overflows omitted from the output
7ARM_INSTRUCTION_SET_armv4 = "arm"
8ARM_INSTRUCTION_SET_armv5 = "arm"
9
10BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/gcc/libgcc-initial_7.3.bb b/meta/recipes-devtools/gcc/libgcc-initial_7.3.bb
deleted file mode 100644
index 19f253fce8..0000000000
--- a/meta/recipes-devtools/gcc/libgcc-initial_7.3.bb
+++ /dev/null
@@ -1,2 +0,0 @@
1require recipes-devtools/gcc/gcc-${PV}.inc
2require libgcc-initial.inc
diff --git a/meta/recipes-devtools/gcc/libgcc_7.3.bb b/meta/recipes-devtools/gcc/libgcc_7.3.bb
deleted file mode 100644
index a5152f28e9..0000000000
--- a/meta/recipes-devtools/gcc/libgcc_7.3.bb
+++ /dev/null
@@ -1,2 +0,0 @@
1require recipes-devtools/gcc/gcc-${PV}.inc
2require libgcc.inc
diff --git a/meta/recipes-devtools/gcc/libgfortran_7.3.bb b/meta/recipes-devtools/gcc/libgfortran_7.3.bb
deleted file mode 100644
index 71dd8b4bdc..0000000000
--- a/meta/recipes-devtools/gcc/libgfortran_7.3.bb
+++ /dev/null
@@ -1,3 +0,0 @@
1require recipes-devtools/gcc/gcc-${PV}.inc
2require libgfortran.inc
3