summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2022-04-21 19:04:10 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-22 23:42:51 +0100
commit44a36caa7c28cbf18890be9e4666fc76d2ea0f05 (patch)
treeaf9b8457f3cdf9911361c005cbbd8f4f5f3e3d8b /meta/recipes-devtools/gcc
parent7f89c7f9290a4e5421b01d64421297fe78ada00e (diff)
downloadpoky-44a36caa7c28cbf18890be9e4666fc76d2ea0f05.tar.gz
gcc: Upgrade to 11.3 release
This is a bugfix release on gcc-11 series, fixes 189 bugs [1] Drop backported patches already included in 11.3 release [1] https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=11.3 (From OE-Core rev: c6d508157058adae401059e36df7fa778852859b) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-11.3.inc (renamed from meta/recipes-devtools/gcc/gcc-11.2.inc)66
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-canadian_11.3.bb (renamed from meta/recipes-devtools/gcc/gcc-cross-canadian_11.2.bb)0
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross_11.3.bb (renamed from meta/recipes-devtools/gcc/gcc-cross_11.2.bb)0
-rw-r--r--meta/recipes-devtools/gcc/gcc-crosssdk_11.3.bb (renamed from meta/recipes-devtools/gcc/gcc-crosssdk_11.2.bb)0
-rw-r--r--meta/recipes-devtools/gcc/gcc-runtime_11.3.bb (renamed from meta/recipes-devtools/gcc/gcc-runtime_11.2.bb)0
-rw-r--r--meta/recipes-devtools/gcc/gcc-sanitizers_11.3.bb (renamed from meta/recipes-devtools/gcc/gcc-sanitizers_11.2.bb)0
-rw-r--r--meta/recipes-devtools/gcc/gcc-source_11.3.bb (renamed from meta/recipes-devtools/gcc/gcc-source_11.2.bb)0
-rw-r--r--meta/recipes-devtools/gcc/gcc/0001-CVE-2021-35465.patch138
-rw-r--r--meta/recipes-devtools/gcc/gcc/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch10
-rw-r--r--meta/recipes-devtools/gcc/gcc/0002-CVE-2021-35465.patch39
-rw-r--r--meta/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch26
-rw-r--r--meta/recipes-devtools/gcc/gcc/0003-64-bit-multilib-hack.patch (renamed from meta/recipes-devtools/gcc/gcc/0004-64-bit-multilib-hack.patch)2
-rw-r--r--meta/recipes-devtools/gcc/gcc/0003-CVE-2021-35465.patch103
-rw-r--r--meta/recipes-devtools/gcc/gcc/0004-CVE-2021-35465.patch304
-rw-r--r--meta/recipes-devtools/gcc/gcc/0004-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch (renamed from meta/recipes-devtools/gcc/gcc/0007-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch)12
-rw-r--r--meta/recipes-devtools/gcc/gcc/0005-cpp-honor-sysroot.patch53
-rw-r--r--meta/recipes-devtools/gcc/gcc/0006-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch (renamed from meta/recipes-devtools/gcc/gcc/0011-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch)101
-rw-r--r--meta/recipes-devtools/gcc/gcc/0007-gcc-Fix-argument-list-too-long-error.patch42
-rw-r--r--meta/recipes-devtools/gcc/gcc/0008-libtool.patch (renamed from meta/recipes-devtools/gcc/gcc/0014-libtool.patch)2
-rw-r--r--meta/recipes-devtools/gcc/gcc/0009-cpp-honor-sysroot.patch59
-rw-r--r--meta/recipes-devtools/gcc/gcc/0009-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch (renamed from meta/recipes-devtools/gcc/gcc/0015-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch)2
-rw-r--r--meta/recipes-devtools/gcc/gcc/0010-Use-the-multilib-config-files-from-B-instead-of-usin.patch (renamed from meta/recipes-devtools/gcc/gcc/0016-Use-the-multilib-config-files-from-B-instead-of-usin.patch)14
-rw-r--r--meta/recipes-devtools/gcc/gcc/0011-Avoid-using-libdir-from-.la-which-usually-points-to-.patch (renamed from meta/recipes-devtools/gcc/gcc/0017-Avoid-using-libdir-from-.la-which-usually-points-to-.patch)2
-rw-r--r--meta/recipes-devtools/gcc/gcc/0012-Ensure-target-gcc-headers-can-be-included.patch (renamed from meta/recipes-devtools/gcc/gcc/0019-Ensure-target-gcc-headers-can-be-included.patch)6
-rw-r--r--meta/recipes-devtools/gcc/gcc/0012-gcc-Fix-argument-list-too-long-error.patch38
-rw-r--r--meta/recipes-devtools/gcc/gcc/0013-Don-t-search-host-directory-during-relink-if-inst_pr.patch (renamed from meta/recipes-devtools/gcc/gcc/0020-Don-t-search-host-directory-during-relink-if-inst_pr.patch)2
-rw-r--r--meta/recipes-devtools/gcc/gcc/0014-libcc1-fix-libcc1-s-install-path-and-rpath.patch (renamed from meta/recipes-devtools/gcc/gcc/0023-libcc1-fix-libcc1-s-install-path-and-rpath.patch)8
-rw-r--r--meta/recipes-devtools/gcc/gcc/0015-Makefile.in-Ensure-build-CPP-CPPFLAGS-is-used-for-bu.patch (renamed from meta/recipes-devtools/gcc/gcc/0018-export-CPP.patch)89
-rw-r--r--meta/recipes-devtools/gcc/gcc/0016-If-CXXFLAGS-contains-something-unsupported-by-the-bu.patch (renamed from meta/recipes-devtools/gcc/gcc/0006-If-CXXFLAGS-contains-something-unsupported-by-the-bu.patch)39
-rw-r--r--meta/recipes-devtools/gcc/gcc/0017-handle-sysroot-support-for-nativesdk-gcc.patch (renamed from meta/recipes-devtools/gcc/gcc/0024-handle-sysroot-support-for-nativesdk-gcc.patch)14
-rw-r--r--meta/recipes-devtools/gcc/gcc/0018-Search-target-sysroot-gcc-version-specific-dirs-with.patch (renamed from meta/recipes-devtools/gcc/gcc/0025-Search-target-sysroot-gcc-version-specific-dirs-with.patch)8
-rw-r--r--meta/recipes-devtools/gcc/gcc/0019-nios2-Define-MUSL_DYNAMIC_LINKER.patch25
-rw-r--r--meta/recipes-devtools/gcc/gcc/0020-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch (renamed from meta/recipes-devtools/gcc/gcc/0028-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch)10
-rw-r--r--meta/recipes-devtools/gcc/gcc/0021-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch (renamed from meta/recipes-devtools/gcc/gcc/0029-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch)2
-rw-r--r--meta/recipes-devtools/gcc/gcc/0022-sync-gcc-stddef.h-with-musl.patch (renamed from meta/recipes-devtools/gcc/gcc/0030-sync-gcc-stddef.h-with-musl.patch)2
-rw-r--r--meta/recipes-devtools/gcc/gcc/0023-Re-introduce-spe-commandline-options.patch (renamed from meta/recipes-devtools/gcc/gcc/0033-Re-introduce-spe-commandline-options.patch)4
-rw-r--r--meta/recipes-devtools/gcc/gcc/0024-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch (renamed from meta/recipes-devtools/gcc/gcc/0034-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch)6
-rw-r--r--meta/recipes-devtools/gcc/gcc/0025-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch (renamed from meta/recipes-devtools/gcc/gcc/0035-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch)4
-rw-r--r--meta/recipes-devtools/gcc/gcc/0026-mingw32-Enable-operation_not_supported.patch (renamed from meta/recipes-devtools/gcc/gcc/0036-mingw32-Enable-operation_not_supported.patch)2
-rw-r--r--meta/recipes-devtools/gcc/gcc/0027-libatomic-Do-not-enforce-march-on-aarch64.patch (renamed from meta/recipes-devtools/gcc/gcc/0037-libatomic-Do-not-enforce-march-on-aarch64.patch)10
-rw-r--r--meta/recipes-devtools/gcc/gcc/0027-nios2-Define-MUSL_DYNAMIC_LINKER.patch31
-rw-r--r--meta/recipes-devtools/gcc/gcc/0028-debug-101473-apply-debug-prefix-maps-before-checksum.patch (renamed from meta/recipes-devtools/gcc/gcc/0041-apply-debug-prefix-maps-before-checksumming-DIEs.patch)24
-rw-r--r--meta/recipes-devtools/gcc/gcc/0029-Fix-install-path-of-linux64.h.patch (renamed from meta/recipes-devtools/gcc/gcc/0001-Fix-install-path-of-linux64.h.patch)10
-rw-r--r--meta/recipes-devtools/gcc/gcc/0042-Fix-thread-stack-size-init.patch23
-rw-r--r--meta/recipes-devtools/gcc/gcc_11.3.bb (renamed from meta/recipes-devtools/gcc/gcc_11.2.bb)0
-rw-r--r--meta/recipes-devtools/gcc/libgcc-initial_11.3.bb (renamed from meta/recipes-devtools/gcc/libgcc-initial_11.2.bb)0
-rw-r--r--meta/recipes-devtools/gcc/libgcc_11.3.bb (renamed from meta/recipes-devtools/gcc/libgcc_11.2.bb)0
-rw-r--r--meta/recipes-devtools/gcc/libgfortran_11.3.bb (renamed from meta/recipes-devtools/gcc/libgfortran_11.2.bb)0
48 files changed, 371 insertions, 961 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-11.2.inc b/meta/recipes-devtools/gcc/gcc-11.3.inc
index 68e0d203fc..b1ef9d25af 100644
--- a/meta/recipes-devtools/gcc/gcc-11.2.inc
+++ b/meta/recipes-devtools/gcc/gcc-11.3.inc
@@ -2,11 +2,11 @@ require gcc-common.inc
2 2
3# Third digit in PV should be incremented after a minor release 3# Third digit in PV should be incremented after a minor release
4 4
5PV = "11.2.0" 5PV = "11.3.0"
6 6
7# BINV should be incremented to a revision after a minor gcc release 7# BINV should be incremented to a revision after a minor gcc release
8 8
9BINV = "11.2.0" 9BINV = "11.3.0"
10 10
11FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc:${FILE_DIRNAME}/gcc/backport:" 11FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc:${FILE_DIRNAME}/gcc/backport:"
12 12
@@ -32,45 +32,41 @@ SRC_URI = "\
32 ${BASEURI} \ 32 ${BASEURI} \
33 file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \ 33 file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \
34 file://0002-gcc-poison-system-directories.patch \ 34 file://0002-gcc-poison-system-directories.patch \
35 file://0004-64-bit-multilib-hack.patch \ 35 file://0003-64-bit-multilib-hack.patch \
36 file://0007-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \ 36 file://0004-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \
37 file://0009-cpp-honor-sysroot.patch \ 37 file://0005-cpp-honor-sysroot.patch \
38 file://0011-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \ 38 file://0006-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
39 file://0012-gcc-Fix-argument-list-too-long-error.patch \ 39 file://0007-gcc-Fix-argument-list-too-long-error.patch \
40 file://0014-libtool.patch \ 40 file://0008-libtool.patch \
41 file://0015-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \ 41 file://0009-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
42 file://0016-Use-the-multilib-config-files-from-B-instead-of-usin.patch \ 42 file://0010-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
43 file://0017-Avoid-using-libdir-from-.la-which-usually-points-to-.patch \ 43 file://0011-Avoid-using-libdir-from-.la-which-usually-points-to-.patch \
44 file://0018-export-CPP.patch \ 44 file://0012-Ensure-target-gcc-headers-can-be-included.patch \
45 file://0019-Ensure-target-gcc-headers-can-be-included.patch \ 45 file://0013-Don-t-search-host-directory-during-relink-if-inst_pr.patch \
46 file://0020-Don-t-search-host-directory-during-relink-if-inst_pr.patch \ 46 file://0014-libcc1-fix-libcc1-s-install-path-and-rpath.patch \
47 file://0023-libcc1-fix-libcc1-s-install-path-and-rpath.patch \ 47 file://0015-Makefile.in-Ensure-build-CPP-CPPFLAGS-is-used-for-bu.patch \
48 file://0024-handle-sysroot-support-for-nativesdk-gcc.patch \ 48 file://0016-If-CXXFLAGS-contains-something-unsupported-by-the-bu.patch \
49 file://0025-Search-target-sysroot-gcc-version-specific-dirs-with.patch \ 49 file://0017-handle-sysroot-support-for-nativesdk-gcc.patch \
50 file://0027-nios2-Define-MUSL_DYNAMIC_LINKER.patch \ 50 file://0018-Search-target-sysroot-gcc-version-specific-dirs-with.patch \
51 file://0028-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch \ 51 file://0019-nios2-Define-MUSL_DYNAMIC_LINKER.patch \
52 file://0029-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch \ 52 file://0020-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch \
53 file://0030-sync-gcc-stddef.h-with-musl.patch \ 53 file://0021-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch \
54 file://0033-Re-introduce-spe-commandline-options.patch \ 54 file://0022-sync-gcc-stddef.h-with-musl.patch \
55 file://0034-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch \ 55 file://0023-Re-introduce-spe-commandline-options.patch \
56 file://0035-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch \ 56 file://0024-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch \
57 file://0036-mingw32-Enable-operation_not_supported.patch \ 57 file://0025-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch \
58 file://0037-libatomic-Do-not-enforce-march-on-aarch64.patch \ 58 file://0026-mingw32-Enable-operation_not_supported.patch \
59 file://0041-apply-debug-prefix-maps-before-checksumming-DIEs.patch \ 59 file://0027-libatomic-Do-not-enforce-march-on-aarch64.patch \
60 file://0006-If-CXXFLAGS-contains-something-unsupported-by-the-bu.patch \ 60 file://0028-debug-101473-apply-debug-prefix-maps-before-checksum.patch \
61 file://0001-Fix-install-path-of-linux64.h.patch \ 61 file://0029-Fix-install-path-of-linux64.h.patch \
62 file://0001-CVE-2021-35465.patch \ 62 \
63 file://0002-CVE-2021-35465.patch \
64 file://0003-CVE-2021-35465.patch \
65 file://0004-CVE-2021-35465.patch \
66 file://0001-CVE-2021-42574.patch \ 63 file://0001-CVE-2021-42574.patch \
67 file://0002-CVE-2021-42574.patch \ 64 file://0002-CVE-2021-42574.patch \
68 file://0003-CVE-2021-42574.patch \ 65 file://0003-CVE-2021-42574.patch \
69 file://0004-CVE-2021-42574.patch \ 66 file://0004-CVE-2021-42574.patch \
70 file://0001-CVE-2021-46195.patch \ 67 file://0001-CVE-2021-46195.patch \
71 file://0042-Fix-thread-stack-size-init.patch \
72" 68"
73SRC_URI[sha256sum] = "d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b" 69SRC_URI[sha256sum] = "b47cf2818691f5b1e21df2bb38c795fac2cfbd640ede2d0a5e1c89e338a3ac39"
74 70
75S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" 71S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
76 72
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian_11.2.bb b/meta/recipes-devtools/gcc/gcc-cross-canadian_11.3.bb
index bf53c5cd78..bf53c5cd78 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian_11.2.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian_11.3.bb
diff --git a/meta/recipes-devtools/gcc/gcc-cross_11.2.bb b/meta/recipes-devtools/gcc/gcc-cross_11.3.bb
index b43cca0c52..b43cca0c52 100644
--- a/meta/recipes-devtools/gcc/gcc-cross_11.2.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross_11.3.bb
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk_11.2.bb b/meta/recipes-devtools/gcc/gcc-crosssdk_11.3.bb
index 40a6c4feff..40a6c4feff 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk_11.2.bb
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk_11.3.bb
diff --git a/meta/recipes-devtools/gcc/gcc-runtime_11.2.bb b/meta/recipes-devtools/gcc/gcc-runtime_11.3.bb
index dd430b57eb..dd430b57eb 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime_11.2.bb
+++ b/meta/recipes-devtools/gcc/gcc-runtime_11.3.bb
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers_11.2.bb b/meta/recipes-devtools/gcc/gcc-sanitizers_11.3.bb
index 8bda2ccad6..8bda2ccad6 100644
--- a/meta/recipes-devtools/gcc/gcc-sanitizers_11.2.bb
+++ b/meta/recipes-devtools/gcc/gcc-sanitizers_11.3.bb
diff --git a/meta/recipes-devtools/gcc/gcc-source_11.2.bb b/meta/recipes-devtools/gcc/gcc-source_11.3.bb
index b890fa33ea..b890fa33ea 100644
--- a/meta/recipes-devtools/gcc/gcc-source_11.2.bb
+++ b/meta/recipes-devtools/gcc/gcc-source_11.3.bb
diff --git a/meta/recipes-devtools/gcc/gcc/0001-CVE-2021-35465.patch b/meta/recipes-devtools/gcc/gcc/0001-CVE-2021-35465.patch
deleted file mode 100644
index e4aee10e37..0000000000
--- a/meta/recipes-devtools/gcc/gcc/0001-CVE-2021-35465.patch
+++ /dev/null
@@ -1,138 +0,0 @@
1From 3929bca9ca95de9d35e82ae8828b188029e3eb70 Mon Sep 17 00:00:00 2001
2From: Richard Earnshaw <rearnsha@arm.com>
3Date: Fri, 11 Jun 2021 16:02:05 +0100
4Subject: [PATCH] arm: Add command-line option for enabling CVE-2021-35465
5 mitigation [PR102035]
6
7Add a new option, -mfix-cmse-cve-2021-35465 and document it. Enable it
8automatically for cortex-m33, cortex-m35p and cortex-m55.
9
10gcc:
11 PR target/102035
12 * config/arm/arm.opt (mfix-cmse-cve-2021-35465): New option.
13 * doc/invoke.texi (Arm Options): Document it.
14 * config/arm/arm-cpus.in (quirk_vlldm): New feature bit.
15 (ALL_QUIRKS): Add quirk_vlldm.
16 (cortex-m33): Add quirk_vlldm.
17 (cortex-m35p, cortex-m55): Likewise.
18 * config/arm/arm.c (arm_option_override): Enable fix_vlldm if
19 targetting an affected CPU and not explicitly controlled on
20 the command line.
21
22CVE: CVE-2021-35465
23Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=3929bca9ca95de9d35e82ae8828b188029e3eb70]
24Signed-off-by: Pgowda <pgowda.cve@gmail.com>
25
26---
27 gcc/config/arm/arm-cpus.in | 9 +++++++--
28 gcc/config/arm/arm.c | 9 +++++++++
29 gcc/config/arm/arm.opt | 4 ++++
30 gcc/doc/invoke.texi | 9 +++++++++
31 4 files changed, 29 insertions(+), 2 deletions(-)
32
33diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
34--- a/gcc/config/arm/arm.c 2021-11-15 02:13:11.100579812 -0800
35+++ b/gcc/config/arm/arm.c 2021-11-15 02:17:36.988237692 -0800
36@@ -3610,6 +3610,15 @@ arm_option_override (void)
37 fix_cm3_ldrd = 0;
38 }
39
40+ /* Enable fix_vlldm by default if required. */
41+ if (fix_vlldm == 2)
42+ {
43+ if (bitmap_bit_p (arm_active_target.isa, isa_bit_quirk_vlldm))
44+ fix_vlldm = 1;
45+ else
46+ fix_vlldm = 0;
47+ }
48+
49 /* Hot/Cold partitioning is not currently supported, since we can't
50 handle literal pool placement in that case. */
51 if (flag_reorder_blocks_and_partition)
52diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in
53--- a/gcc/config/arm/arm-cpus.in 2021-11-15 02:13:11.104579747 -0800
54+++ b/gcc/config/arm/arm-cpus.in 2021-11-15 02:17:36.984237757 -0800
55@@ -186,6 +186,9 @@ define feature quirk_armv6kz
56 # Cortex-M3 LDRD quirk.
57 define feature quirk_cm3_ldrd
58
59+# v8-m/v8.1-m VLLDM errata.
60+define feature quirk_vlldm
61+
62 # Don't use .cpu assembly directive
63 define feature quirk_no_asmcpu
64
65@@ -322,7 +325,7 @@ define implied vfp_base MVE MVE_FP ALL_F
66 # architectures.
67 # xscale isn't really a 'quirk', but it isn't an architecture either and we
68 # need to ignore it for matching purposes.
69-define fgroup ALL_QUIRKS quirk_no_volatile_ce quirk_armv6kz quirk_cm3_ldrd xscale quirk_no_asmcpu
70+define fgroup ALL_QUIRKS quirk_no_volatile_ce quirk_armv6kz quirk_cm3_ldrd quirk_vlldm xscale quirk_no_asmcpu
71
72 define fgroup IGNORE_FOR_MULTILIB cdecp0 cdecp1 cdecp2 cdecp3 cdecp4 cdecp5 cdecp6 cdecp7
73
74@@ -1570,6 +1573,7 @@ begin cpu cortex-m33
75 architecture armv8-m.main+dsp+fp
76 option nofp remove ALL_FP
77 option nodsp remove armv7em
78+ isa quirk_vlldm
79 costs v7m
80 end cpu cortex-m33
81
82@@ -1579,6 +1583,7 @@ begin cpu cortex-m35p
83 architecture armv8-m.main+dsp+fp
84 option nofp remove ALL_FP
85 option nodsp remove armv7em
86+ isa quirk_vlldm
87 costs v7m
88 end cpu cortex-m35p
89
90@@ -1590,7 +1595,7 @@ begin cpu cortex-m55
91 option nomve remove mve mve_float
92 option nofp remove ALL_FP mve_float
93 option nodsp remove MVE mve_float
94- isa quirk_no_asmcpu
95+ isa quirk_no_asmcpu quirk_vlldm
96 costs v7m
97 vendor 41
98 end cpu cortex-m55
99diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt
100--- a/gcc/config/arm/arm.opt 2021-11-15 02:13:11.104579747 -0800
101+++ b/gcc/config/arm/arm.opt 2021-11-15 02:17:36.988237692 -0800
102@@ -268,6 +268,10 @@ Target Var(fix_cm3_ldrd) Init(2)
103 Avoid overlapping destination and address registers on LDRD instructions
104 that may trigger Cortex-M3 errata.
105
106+mfix-cmse-cve-2021-35465
107+Target Var(fix_vlldm) Init(2)
108+Mitigate issues with VLLDM on some M-profile devices (CVE-2021-35465).
109+
110 munaligned-access
111 Target Var(unaligned_access) Init(2) Save
112 Enable unaligned word and halfword accesses to packed data.
113diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
114--- a/gcc/doc/invoke.texi 2021-11-15 02:13:11.112579616 -0800
115+++ b/gcc/doc/invoke.texi 2021-11-15 02:17:36.996237562 -0800
116@@ -804,6 +804,7 @@ Objective-C and Objective-C++ Dialects}.
117 -mverbose-cost-dump @gol
118 -mpure-code @gol
119 -mcmse @gol
120+-mfix-cmse-cve-2021-35465 @gol
121 -mfdpic}
122
123 @emph{AVR Options}
124@@ -20487,6 +20488,14 @@ Generate secure code as per the "ARMv8-M
125 Development Tools Engineering Specification", which can be found on
126 @url{https://developer.arm.com/documentation/ecm0359818/latest/}.
127
128+@item -mfix-cmse-cve-2021-35465
129+@opindex mfix-cmse-cve-2021-35465
130+Mitigate against a potential security issue with the @code{VLLDM} instruction
131+in some M-profile devices when using CMSE (CVE-2021-365465). This option is
132+enabled by default when the option @option{-mcpu=} is used with
133+@code{cortex-m33}, @code{cortex-m35p} or @code{cortex-m55}. The option
134+@option{-mno-fix-cmse-cve-2021-35465} can be used to disable the mitigation.
135+
136 @item -mfdpic
137 @itemx -mno-fdpic
138 @opindex mfdpic
diff --git a/meta/recipes-devtools/gcc/gcc/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
index 0a108ee51b..0bf8834bb2 100644
--- a/meta/recipes-devtools/gcc/gcc/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
+++ b/meta/recipes-devtools/gcc/gcc/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
@@ -1,4 +1,4 @@
1From 368eaf1846733a9920c7cf5bc547a377e7167785 Mon Sep 17 00:00:00 2001 1From 6badb97389cae4ff9a533d38dc7cceefe21b97a8 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 08:37:11 +0400 3Date: Fri, 29 Mar 2013 08:37:11 +0400
4Subject: [PATCH] gcc-4.3.1: ARCH_FLAGS_FOR_TARGET 4Subject: [PATCH] gcc-4.3.1: ARCH_FLAGS_FOR_TARGET
@@ -12,10 +12,10 @@ Upstream-Status: Inappropriate [embedded specific]
12 2 files changed, 2 insertions(+), 2 deletions(-) 12 2 files changed, 2 insertions(+), 2 deletions(-)
13 13
14diff --git a/configure b/configure 14diff --git a/configure b/configure
15index 504f6410274..bcebad264ec 100755 15index e218a19e333..45744e6e471 100755
16--- a/configure 16--- a/configure
17+++ b/configure 17+++ b/configure
18@@ -9728,7 +9728,7 @@ fi 18@@ -9750,7 +9750,7 @@ fi
19 # for target_alias and gcc doesn't manage it consistently. 19 # for target_alias and gcc doesn't manage it consistently.
20 target_configargs="--cache-file=./config.cache ${target_configargs}" 20 target_configargs="--cache-file=./config.cache ${target_configargs}"
21 21
@@ -25,10 +25,10 @@ index 504f6410274..bcebad264ec 100755
25 *" newlib "*) 25 *" newlib "*)
26 case " $target_configargs " in 26 case " $target_configargs " in
27diff --git a/configure.ac b/configure.ac 27diff --git a/configure.ac b/configure.ac
28index 088e735c5db..1289fe08760 100644 28index 7e8e628b325..bf66b51373c 100644
29--- a/configure.ac 29--- a/configure.ac
30+++ b/configure.ac 30+++ b/configure.ac
31@@ -3240,7 +3240,7 @@ fi 31@@ -3255,7 +3255,7 @@ fi
32 # for target_alias and gcc doesn't manage it consistently. 32 # for target_alias and gcc doesn't manage it consistently.
33 target_configargs="--cache-file=./config.cache ${target_configargs}" 33 target_configargs="--cache-file=./config.cache ${target_configargs}"
34 34
diff --git a/meta/recipes-devtools/gcc/gcc/0002-CVE-2021-35465.patch b/meta/recipes-devtools/gcc/gcc/0002-CVE-2021-35465.patch
deleted file mode 100644
index e09818fecf..0000000000
--- a/meta/recipes-devtools/gcc/gcc/0002-CVE-2021-35465.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1From 574e7950bd6b34e9e2cacce18c802b45505d1d0a Mon Sep 17 00:00:00 2001
2From: Richard Earnshaw <rearnsha@arm.com>
3Date: Fri, 18 Jun 2021 17:16:25 +0100
4Subject: [PATCH] arm: add erratum mitigation to __gnu_cmse_nonsecure_call
5 [PR102035]
6
7Add the recommended erratum mitigation sequence to
8__gnu_cmse_nonsecure_call for use on Armv8-m.main devices. Since this
9is in the library code we cannot know in advance whether the core we
10are running on will be affected by this, so always enable it.
11
12libgcc:
13 PR target/102035
14 * config/arm/cmse_nonsecure_call.S (__gnu_cmse_nonsecure_call):
15 Add vlldm erratum work-around.
16
17CVE: CVE-2021-35465
18Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=574e7950bd6b34e9e2cacce18c802b45505d1d0a]
19Signed-off-by: Pgowda <pgowda.cve@gmail.com>
20
21---
22 libgcc/config/arm/cmse_nonsecure_call.S | 5 +++++
23 1 file changed, 5 insertions(+)
24
25diff --git a/libgcc/config/arm/cmse_nonsecure_call.S b/libgcc/config/arm/cmse_nonsecure_call.S
26--- a/libgcc/config/arm/cmse_nonsecure_call.S
27+++ b/libgcc/config/arm/cmse_nonsecure_call.S
28@@ -102,6 +102,11 @@ blxns r4
29 #ifdef __ARM_PCS_VFP
30 vpop.f64 {d8-d15}
31 #else
32+/* VLLDM erratum mitigation sequence. */
33+mrs r5, control
34+tst r5, #8 /* CONTROL_S.SFPA */
35+it ne
36+.inst.w 0xeeb00a40 /* vmovne s0, s0 */
37 vlldm sp /* Lazy restore of d0-d16 and FPSCR. */
38 add sp, sp, #0x88 /* Free space used to save floating point registers. */
39 #endif /* __ARM_PCS_VFP */
diff --git a/meta/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch b/meta/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch
index 18a9fb8701..d19cefbdf9 100644
--- a/meta/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch
+++ b/meta/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch
@@ -1,4 +1,4 @@
1From 118c6f054711d437167ff125a88c9236bfc8099c Mon Sep 17 00:00:00 2001 1From 863f1f9dc78839ecd021b2cb01d501e8c9e00ef7 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 8 Mar 2021 16:04:20 -0800 3Date: Mon, 8 Mar 2021 16:04:20 -0800
4Subject: [PATCH] gcc: poison-system-directories 4Subject: [PATCH] gcc: poison-system-directories
@@ -25,7 +25,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
25 7 files changed, 86 insertions(+), 2 deletions(-) 25 7 files changed, 86 insertions(+), 2 deletions(-)
26 26
27diff --git a/gcc/common.opt b/gcc/common.opt 27diff --git a/gcc/common.opt b/gcc/common.opt
28index c75dd36843e..49acbd6ed44 100644 28index a75b44ee47e..d15105a73f3 100644
29--- a/gcc/common.opt 29--- a/gcc/common.opt
30+++ b/gcc/common.opt 30+++ b/gcc/common.opt
31@@ -683,6 +683,10 @@ Wreturn-local-addr 31@@ -683,6 +683,10 @@ Wreturn-local-addr
@@ -40,10 +40,10 @@ index c75dd36843e..49acbd6ed44 100644
40 Common Var(warn_shadow) Warning 40 Common Var(warn_shadow) Warning
41 Warn when one variable shadows another. Same as -Wshadow=global. 41 Warn when one variable shadows another. Same as -Wshadow=global.
42diff --git a/gcc/config.in b/gcc/config.in 42diff --git a/gcc/config.in b/gcc/config.in
43index 10a13cde586..8848284da41 100644 43index 048bf52e8c2..4f973f7906a 100644
44--- a/gcc/config.in 44--- a/gcc/config.in
45+++ b/gcc/config.in 45+++ b/gcc/config.in
46@@ -218,6 +218,16 @@ 46@@ -230,6 +230,16 @@
47 #endif 47 #endif
48 48
49 49
@@ -61,10 +61,10 @@ index 10a13cde586..8848284da41 100644
61 optimizer and back end) to be checked for dynamic type safety at runtime. 61 optimizer and back end) to be checked for dynamic type safety at runtime.
62 This is quite expensive. */ 62 This is quite expensive. */
63diff --git a/gcc/configure b/gcc/configure 63diff --git a/gcc/configure b/gcc/configure
64index 9bb436ce7bd..3f0734bff11 100755 64index 7218b0c331a..d7445339f9a 100755
65--- a/gcc/configure 65--- a/gcc/configure
66+++ b/gcc/configure 66+++ b/gcc/configure
67@@ -1020,6 +1020,7 @@ enable_maintainer_mode 67@@ -1019,6 +1019,7 @@ enable_maintainer_mode
68 enable_link_mutex 68 enable_link_mutex
69 enable_link_serialization 69 enable_link_serialization
70 enable_version_specific_runtime_libs 70 enable_version_specific_runtime_libs
@@ -72,7 +72,7 @@ index 9bb436ce7bd..3f0734bff11 100755
72 enable_plugin 72 enable_plugin
73 enable_host_shared 73 enable_host_shared
74 enable_libquadmath_support 74 enable_libquadmath_support
75@@ -1782,6 +1783,8 @@ Optional Features: 75@@ -1781,6 +1782,8 @@ Optional Features:
76 --enable-version-specific-runtime-libs 76 --enable-version-specific-runtime-libs
77 specify that runtime libraries should be installed 77 specify that runtime libraries should be installed
78 in a compiler-specific directory 78 in a compiler-specific directory
@@ -81,7 +81,7 @@ index 9bb436ce7bd..3f0734bff11 100755
81 --enable-plugin enable plugin support 81 --enable-plugin enable plugin support
82 --enable-host-shared build host code as shared libraries 82 --enable-host-shared build host code as shared libraries
83 --disable-libquadmath-support 83 --disable-libquadmath-support
84@@ -31325,6 +31328,22 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : 84@@ -31932,6 +31935,22 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
85 fi 85 fi
86 86
87 87
@@ -105,10 +105,10 @@ index 9bb436ce7bd..3f0734bff11 100755
105 105
106 106
107diff --git a/gcc/configure.ac b/gcc/configure.ac 107diff --git a/gcc/configure.ac b/gcc/configure.ac
108index caa611933df..54e21764b3e 100644 108index 49f043ed29b..fe488f2232b 100644
109--- a/gcc/configure.ac 109--- a/gcc/configure.ac
110+++ b/gcc/configure.ac 110+++ b/gcc/configure.ac
111@@ -7123,6 +7123,22 @@ AC_ARG_ENABLE(version-specific-runtime-libs, 111@@ -7393,6 +7393,22 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
112 [specify that runtime libraries should be 112 [specify that runtime libraries should be
113 installed in a compiler-specific directory])]) 113 installed in a compiler-specific directory])])
114 114
@@ -132,7 +132,7 @@ index caa611933df..54e21764b3e 100644
132 AC_SUBST(subdirs) 132 AC_SUBST(subdirs)
133 AC_SUBST(srcdir) 133 AC_SUBST(srcdir)
134diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi 134diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
135index 7a368959e5e..6659a903bf0 100644 135index 35508efb4ef..40f798eac78 100644
136--- a/gcc/doc/invoke.texi 136--- a/gcc/doc/invoke.texi
137+++ b/gcc/doc/invoke.texi 137+++ b/gcc/doc/invoke.texi
138@@ -369,6 +369,7 @@ Objective-C and Objective-C++ Dialects}. 138@@ -369,6 +369,7 @@ Objective-C and Objective-C++ Dialects}.
@@ -143,7 +143,7 @@ index 7a368959e5e..6659a903bf0 100644
143 -Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol 143 -Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol
144 -Wrestrict -Wno-return-local-addr -Wreturn-type @gol 144 -Wrestrict -Wno-return-local-addr -Wreturn-type @gol
145 -Wno-scalar-storage-order -Wsequence-point @gol 145 -Wno-scalar-storage-order -Wsequence-point @gol
146@@ -7735,6 +7736,14 @@ made up of data only and thus requires no special treatment. But, for 146@@ -7728,6 +7729,14 @@ made up of data only and thus requires no special treatment. But, for
147 most targets, it is made up of code and thus requires the stack to be 147 most targets, it is made up of code and thus requires the stack to be
148 made executable in order for the program to work properly. 148 made executable in order for the program to work properly.
149 149
@@ -159,7 +159,7 @@ index 7a368959e5e..6659a903bf0 100644
159 @opindex Wfloat-equal 159 @opindex Wfloat-equal
160 @opindex Wno-float-equal 160 @opindex Wno-float-equal
161diff --git a/gcc/gcc.c b/gcc/gcc.c 161diff --git a/gcc/gcc.c b/gcc/gcc.c
162index 7837553958b..19c75b6e20d 100644 162index 0af888c7d78..b047fc31c2f 100644
163--- a/gcc/gcc.c 163--- a/gcc/gcc.c
164+++ b/gcc/gcc.c 164+++ b/gcc/gcc.c
165@@ -1152,6 +1152,8 @@ proper position among the other output files. */ 165@@ -1152,6 +1152,8 @@ proper position among the other output files. */
diff --git a/meta/recipes-devtools/gcc/gcc/0004-64-bit-multilib-hack.patch b/meta/recipes-devtools/gcc/gcc/0003-64-bit-multilib-hack.patch
index 5f14dd2a58..c0e8cbd4d9 100644
--- a/meta/recipes-devtools/gcc/gcc/0004-64-bit-multilib-hack.patch
+++ b/meta/recipes-devtools/gcc/gcc/0003-64-bit-multilib-hack.patch
@@ -1,4 +1,4 @@
1From 2fa5c93641b75a662839c1b6eee172b6c481c70e Mon Sep 17 00:00:00 2001 1From b87a3ac51df372128be2fda992238c5aab4a719a Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:10:06 +0400 3Date: Fri, 29 Mar 2013 09:10:06 +0400
4Subject: [PATCH] 64-bit multilib hack. 4Subject: [PATCH] 64-bit multilib hack.
diff --git a/meta/recipes-devtools/gcc/gcc/0003-CVE-2021-35465.patch b/meta/recipes-devtools/gcc/gcc/0003-CVE-2021-35465.patch
deleted file mode 100644
index c7a7c76bf8..0000000000
--- a/meta/recipes-devtools/gcc/gcc/0003-CVE-2021-35465.patch
+++ /dev/null
@@ -1,103 +0,0 @@
1From 30461cf8dba3d3adb15a125e4da48800eb2b9b8f Mon Sep 17 00:00:00 2001
2From: Richard Earnshaw <rearnsha@arm.com>
3Date: Fri, 18 Jun 2021 17:18:37 +0100
4Subject: [PATCH] arm: fix vlldm erratum for Armv8.1-m [PR102035]
5
6For Armv8.1-m we generate code that emits VLLDM directly and do not
7rely on support code in the library, so emit the mitigation directly
8as well, when required. In this case, we can use the compiler options
9to determine when to apply the fix and when it is safe to omit it.
10
11gcc:
12 PR target/102035
13 * config/arm/arm.md (attribute arch): Add fix_vlldm.
14 (arch_enabled): Use it.
15 * config/arm/vfp.md (lazy_store_multiple_insn): Add alternative to
16 use when erratum mitigation is needed.
17
18CVE: CVE-2021-35465
19Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=30461cf8dba3d3adb15a125e4da48800eb2b9b8f]
20Signed-off-by: Pgowda <pgowda.cve@gmail.com>
21
22---
23 gcc/config/arm/arm.md | 11 +++++++++--
24 gcc/config/arm/vfp.md | 10 +++++++---
25 2 files changed, 16 insertions(+), 5 deletions(-)
26
27diff -upr a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
28--- a/gcc/config/arm/arm.md 2020-07-22 23:35:17.344384552 -0700
29+++ b/gcc/config/arm/arm.md 2021-11-11 20:33:58.431543947 -0800
30@@ -132,9 +132,12 @@
31 ; TARGET_32BIT, "t1" or "t2" to specify a specific Thumb mode. "v6"
32 ; for ARM or Thumb-2 with arm_arch6, and nov6 for ARM without
33 ; arm_arch6. "v6t2" for Thumb-2 with arm_arch6 and "v8mb" for ARMv8-M
34-; Baseline. This attribute is used to compute attribute "enabled",
35+; Baseline. "fix_vlldm" is for fixing the v8-m/v8.1-m VLLDM erratum.
36+; This attribute is used to compute attribute "enabled",
37 ; use type "any" to enable an alternative in all cases.
38-(define_attr "arch" "any,a,t,32,t1,t2,v6,nov6,v6t2,v8mb,iwmmxt,iwmmxt2,armv6_or_vfpv3,neon,mve"
39+(define_attr "arch" "any, a, t, 32, t1, t2, v6,nov6, v6t2, \
40+ v8mb, fix_vlldm, iwmmxt, iwmmxt2, armv6_or_vfpv3, \
41+ neon, mve"
42 (const_string "any"))
43
44 (define_attr "arch_enabled" "no,yes"
45@@ -177,6 +180,10 @@
46 (match_test "TARGET_THUMB1 && arm_arch8"))
47 (const_string "yes")
48
49+ (and (eq_attr "arch" "fix_vlldm")
50+ (match_test "fix_vlldm"))
51+ (const_string "yes")
52+
53 (and (eq_attr "arch" "iwmmxt2")
54 (match_test "TARGET_REALLY_IWMMXT2"))
55 (const_string "yes")
56diff -upr a/gcc/config/arm/vfp.md b/gcc/config/arm/vfp.md
57--- a/gcc/config/arm/vfp.md 2020-07-22 23:35:17.356384684 -0700
58+++ b/gcc/config/arm/vfp.md 2021-11-11 20:33:58.431543947 -0800
59@@ -1703,12 +1703,15 @@
60 (set_attr "type" "mov_reg")]
61 )
62
63+;; Both this and the next instruction are treated by GCC in the same
64+;; way as a blockage pattern. That's perhaps stronger than it needs
65+;; to be, but we do not want accesses to the VFP register bank to be
66+;; moved across either instruction.
67+
68 (define_insn "lazy_store_multiple_insn"
69- [(set (match_operand:SI 0 "s_register_operand" "+&rk")
70- (post_dec:SI (match_dup 0)))
71- (unspec_volatile [(const_int 0)
72- (mem:SI (post_dec:SI (match_dup 0)))]
73- VUNSPEC_VLSTM)]
74+ [(unspec_volatile
75+ [(mem:BLK (match_operand:SI 0 "s_register_operand" "rk"))]
76+ VUNSPEC_VLSTM)]
77 "use_cmse && reload_completed"
78 "vlstm%?\\t%0"
79 [(set_attr "predicable" "yes")
80@@ -1716,14 +1719,16 @@
81 )
82
83 (define_insn "lazy_load_multiple_insn"
84- [(set (match_operand:SI 0 "s_register_operand" "+&rk")
85- (post_inc:SI (match_dup 0)))
86- (unspec_volatile:SI [(const_int 0)
87- (mem:SI (match_dup 0))]
88- VUNSPEC_VLLDM)]
89+ [(unspec_volatile
90+ [(mem:BLK (match_operand:SI 0 "s_register_operand" "rk,rk"))]
91+ VUNSPEC_VLLDM)]
92 "use_cmse && reload_completed"
93- "vlldm%?\\t%0"
94- [(set_attr "predicable" "yes")
95+ "@
96+ vscclrm\\t{vpr}\;vlldm\\t%0
97+ vlldm\\t%0"
98+ [(set_attr "arch" "fix_vlldm,*")
99+ (set_attr "predicable" "no")
100+ (set_attr "length" "8,4")
101 (set_attr "type" "load_4")]
102 )
103
diff --git a/meta/recipes-devtools/gcc/gcc/0004-CVE-2021-35465.patch b/meta/recipes-devtools/gcc/gcc/0004-CVE-2021-35465.patch
deleted file mode 100644
index 9dd6a313c2..0000000000
--- a/meta/recipes-devtools/gcc/gcc/0004-CVE-2021-35465.patch
+++ /dev/null
@@ -1,304 +0,0 @@
1From 809330ab8450261e05919b472783bf15e4b000f7 Mon Sep 17 00:00:00 2001
2From: Richard Earnshaw <rearnsha@arm.com>
3Date: Tue, 6 Jul 2021 15:10:18 +0100
4Subject: [PATCH] arm: Add tests for VLLDM mitigation [PR102035]
5
6New tests for the erratum mitigation.
7
8gcc/testsuite:
9 PR target/102035
10 * gcc.target/arm/cmse/mainline/8_1m/soft/cmse-13a.c: New test.
11 * gcc.target/arm/cmse/mainline/8_1m/soft/cmse-7a.c: Likewise.
12 * gcc.target/arm/cmse/mainline/8_1m/soft/cmse-8a.c: Likewise.
13 * gcc.target/arm/cmse/mainline/8_1m/softfp-sp/cmse-7a.c: Likewise.
14 * gcc.target/arm/cmse/mainline/8_1m/softfp-sp/cmse-8a.c: Likewise.
15 * gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-13a.c: Likewise.
16 * gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-7a.c: Likewise.
17 * gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-8a.c: Likewise.
18
19CVE: CVE-2021-35465
20Upstream-Status: Backport [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=809330ab8450261e05919b472783bf15e4b000f7]
21Signed-off-by: Pgowda <pgowda.cve@gmail.com>
22
23---
24 .../arm/cmse/mainline/8_1m/soft/cmse-13a.c | 31 +++++++++++++++++++
25 .../arm/cmse/mainline/8_1m/soft/cmse-7a.c | 28 +++++++++++++++++
26 .../arm/cmse/mainline/8_1m/soft/cmse-8a.c | 30 ++++++++++++++++++
27 .../cmse/mainline/8_1m/softfp-sp/cmse-7a.c | 27 ++++++++++++++++
28 .../cmse/mainline/8_1m/softfp-sp/cmse-8a.c | 29 +++++++++++++++++
29 .../arm/cmse/mainline/8_1m/softfp/cmse-13a.c | 30 ++++++++++++++++++
30 .../arm/cmse/mainline/8_1m/softfp/cmse-7a.c | 27 ++++++++++++++++
31 .../arm/cmse/mainline/8_1m/softfp/cmse-8a.c | 29 +++++++++++++++++
32 8 files changed, 231 insertions(+)
33 create mode 100644 gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/soft/cmse-13a.c
34 create mode 100644 gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/soft/cmse-7a.c
35 create mode 100644 gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/soft/cmse-8a.c
36 create mode 100644 gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp-sp/cmse-7a.c
37 create mode 100644 gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp-sp/cmse-8a.c
38 create mode 100644 gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-13a.c
39 create mode 100644 gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-7a.c
40 create mode 100644 gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-8a.c
41
42diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/soft/cmse-13a.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/soft/cmse-13a.c
43--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/soft/cmse-13a.c 1969-12-31 16:00:00.000000000 -0800
44+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/soft/cmse-13a.c 2021-11-15 02:30:37.210637445 -0800
45@@ -0,0 +1,31 @@
46+/* { dg-do compile } */
47+/* { dg-options "-mcmse -mfloat-abi=soft -mfix-cmse-cve-2021-35465" } */
48+/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */
49+
50+#include "../../../cmse-13.x"
51+
52+/* Checks for saving and clearing prior to function call. */
53+/* Shift on the same register as blxns. */
54+/* { dg-final { scan-assembler "lsrs\t(r\[1,4-9\]|r10|fp|ip), \\1, #1.*blxns\t\\1" } } */
55+/* { dg-final { scan-assembler "lsls\t(r\[1,4-9\]|r10|fp|ip), \\1, #1.*blxns\t\\1" } } */
56+/* { dg-final { scan-assembler-not "mov\tr0, r4" } } */
57+/* { dg-final { scan-assembler-not "mov\tr2, r4" } } */
58+/* { dg-final { scan-assembler-not "mov\tr3, r4" } } */
59+/* { dg-final { scan-assembler "push\t\{r4, r5, r6, r7, r8, r9, r10, fp\}" } } */
60+/* { dg-final { scan-assembler "vlstm\tsp" } } */
61+/* Check the right registers are cleared and none appears twice. */
62+/* { dg-final { scan-assembler "clrm\t\{(r1, )?(r4, )?(r5, )?(r6, )?(r7, )?(r8, )?(r9, )?(r10, )?(fp, )?(ip, )?APSR\}" } } */
63+/* Check that the right number of registers is cleared and thus only one
64+ register is missing. */
65+/* { dg-final { scan-assembler "clrm\t\{((r\[1,4-9\]|r10|fp|ip), ){9}APSR\}" } } */
66+/* Check that no cleared register is used for blxns. */
67+/* { dg-final { scan-assembler-not "clrm\t\{\[^\}\]\+(r\[1,4-9\]|r10|fp|ip),\[^\}\]\+\}.*blxns\t\\1" } } */
68+/* Check for v8.1-m variant of erratum work-around. */
69+/* { dg-final { scan-assembler "vscclrm\t\{vpr\}" } } */
70+/* { dg-final { scan-assembler "vlldm\tsp" } } */
71+/* { dg-final { scan-assembler "pop\t\{r4, r5, r6, r7, r8, r9, r10, fp\}" } } */
72+/* { dg-final { scan-assembler-not "vmov" } } */
73+/* { dg-final { scan-assembler-not "vmsr" } } */
74+
75+/* Now we check that we use the correct intrinsic to call. */
76+/* { dg-final { scan-assembler "blxns" } } */
77diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/soft/cmse-7a.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/soft/cmse-7a.c
78--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/soft/cmse-7a.c 1969-12-31 16:00:00.000000000 -0800
79+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/soft/cmse-7a.c 2021-11-15 02:30:37.210637445 -0800
80@@ -0,0 +1,28 @@
81+/* { dg-do compile } */
82+/* { dg-options "-mcmse -mfloat-abi=soft -mfix-cmse-cve-2021-35465" } */
83+/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */
84+
85+#include "../../../cmse-7.x"
86+
87+/* Checks for saving and clearing prior to function call. */
88+/* Shift on the same register as blxns. */
89+/* { dg-final { scan-assembler "lsrs\t(r\[0-9\]|r10|fp|ip), \\1, #1.*blxns\t\\1" } } */
90+/* { dg-final { scan-assembler "lsls\t(r\[0-9\]|r10|fp|ip), \\1, #1.*blxns\t\\1" } } */
91+/* { dg-final { scan-assembler "push\t\{r4, r5, r6, r7, r8, r9, r10, fp\}" } } */
92+/* { dg-final { scan-assembler "vlstm\tsp" } } */
93+/* Check the right registers are cleared and none appears twice. */
94+/* { dg-final { scan-assembler "clrm\t\{(r0, )?(r1, )?(r2, )?(r3, )?(r4, )?(r5, )?(r6, )?(r7, )?(r8, )?(r9, )?(r10, )?(fp, )?(ip, )?APSR\}" } } */
95+/* Check that the right number of registers is cleared and thus only one
96+ register is missing. */
97+/* { dg-final { scan-assembler "clrm\t\{((r\[0-9\]|r10|fp|ip), ){12}APSR\}" } } */
98+/* Check that no cleared register is used for blxns. */
99+/* { dg-final { scan-assembler-not "clrm\t\{\[^\}\]\+(r\[0-9\]|r10|fp|ip),\[^\}\]\+\}.*blxns\t\\1" } } */
100+/* Check for v8.1-m variant of erratum work-around. */
101+/* { dg-final { scan-assembler "vscclrm\t\{vpr\}" } } */
102+/* { dg-final { scan-assembler "vlldm\tsp" } } */
103+/* { dg-final { scan-assembler "pop\t\{r4, r5, r6, r7, r8, r9, r10, fp\}" } } */
104+/* { dg-final { scan-assembler-not "vmov" } } */
105+/* { dg-final { scan-assembler-not "vmsr" } } */
106+
107+/* Now we check that we use the correct intrinsic to call. */
108+/* { dg-final { scan-assembler "blxns" } } */
109diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/soft/cmse-8a.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/soft/cmse-8a.c
110--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/soft/cmse-8a.c 1969-12-31 16:00:00.000000000 -0800
111+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/soft/cmse-8a.c 2021-11-15 02:30:37.210637445 -0800
112@@ -0,0 +1,30 @@
113+/* { dg-do compile } */
114+/* { dg-options "-mcmse -mfloat-abi=soft -mfix-cmse-cve-2021-35465" } */
115+/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */
116+
117+#include "../../../cmse-8.x"
118+
119+/* Checks for saving and clearing prior to function call. */
120+/* Shift on the same register as blxns. */
121+/* { dg-final { scan-assembler "lsrs\t(r\[2-9\]|r10|fp|ip), \\1, #1.*blxns\t\\1" } } */
122+/* { dg-final { scan-assembler "lsls\t(r\[2-9\]|r10|fp|ip), \\1, #1.*blxns\t\\1" } } */
123+/* { dg-final { scan-assembler-not "mov\tr0, r4" } } */
124+/* { dg-final { scan-assembler-not "mov\tr1, r4" } } */
125+/* { dg-final { scan-assembler "push\t\{r4, r5, r6, r7, r8, r9, r10, fp\}" } } */
126+/* { dg-final { scan-assembler "vlstm\tsp" } } */
127+/* Check the right registers are cleared and none appears twice. */
128+/* { dg-final { scan-assembler "clrm\t\{(r2, )?(r3, )?(r4, )?(r5, )?(r6, )?(r7, )?(r8, )?(r9, )?(r10, )?(fp, )?(ip, )?APSR\}" } } */
129+/* Check that the right number of registers is cleared and thus only one
130+ register is missing. */
131+/* { dg-final { scan-assembler "clrm\t\{((r\[2-9\]|r10|fp|ip), ){10}APSR\}" } } */
132+/* Check that no cleared register is used for blxns. */
133+/* { dg-final { scan-assembler-not "clrm\t\{\[^\}\]\+(r\[2-9\]|r10|fp|ip),\[^\}\]\+\}.*blxns\t\\1" } } */
134+/* Check for v8.1-m variant of erratum work-around. */
135+/* { dg-final { scan-assembler "vscclrm\t\{vpr\}" } } */
136+/* { dg-final { scan-assembler "vlldm\tsp" } } */
137+/* { dg-final { scan-assembler "pop\t\{r4, r5, r6, r7, r8, r9, r10, fp\}" } } */
138+/* { dg-final { scan-assembler-not "vmov" } } */
139+/* { dg-final { scan-assembler-not "vmsr" } } */
140+
141+/* Now we check that we use the correct intrinsic to call. */
142+/* { dg-final { scan-assembler "blxns" } } */
143diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-13a.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-13a.c
144--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-13a.c 1969-12-31 16:00:00.000000000 -0800
145+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-13a.c 2021-11-15 02:30:37.210637445 -0800
146@@ -0,0 +1,30 @@
147+/* { dg-do compile } */
148+/* { dg-options "-mcmse -mfloat-abi=softfp -mfpu=fpv5-d16 -mfix-cmse-cve-2021-35465" } */
149+/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=softfp" } } */
150+/* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
151+
152+#include "../../../cmse-13.x"
153+
154+/* Checks for saving and clearing prior to function call. */
155+/* Shift on the same register as blxns. */
156+/* { dg-final { scan-assembler "lsrs\t(r\[1,4-9\]|r10|fp|ip), \\1, #1.*blxns\t\\1" } } */
157+/* { dg-final { scan-assembler "lsls\t(r\[1,4-9\]|r10|fp|ip), \\1, #1.*blxns\t\\1" } } */
158+/* { dg-final { scan-assembler-not "mov\tr0, r4" } } */
159+/* { dg-final { scan-assembler-not "mov\tr2, r4" } } */
160+/* { dg-final { scan-assembler-not "mov\tr3, r4" } } */
161+/* { dg-final { scan-assembler "push\t\{r4, r5, r6, r7, r8, r9, r10, fp\}" } } */
162+/* { dg-final { scan-assembler "vlstm\tsp" } } */
163+/* Check the right registers are cleared and none appears twice. */
164+/* { dg-final { scan-assembler "clrm\t\{(r1, )?(r4, )?(r5, )?(r6, )?(r7, )?(r8, )?(r9, )?(r10, )?(fp, )?(ip, )?APSR\}" } } */
165+/* Check that the right number of registers is cleared and thus only one
166+ register is missing. */
167+/* { dg-final { scan-assembler "clrm\t\{((r\[1,4-9\]|r10|fp|ip), ){9}APSR\}" } } */
168+/* Check that no cleared register is used for blxns. */
169+/* { dg-final { scan-assembler-not "clrm\t\{\[^\}\]\+(r\[1,4-9\]|r10|fp|ip),\[^\}\]\+\}.*blxns\t\\1" } } */
170+/* Check for v8.1-m variant of erratum work-around. */
171+/* { dg-final { scan-assembler "vscclrm\t\{vpr\}" } } */
172+/* { dg-final { scan-assembler "vlldm\tsp" } } */
173+/* { dg-final { scan-assembler "pop\t\{r4, r5, r6, r7, r8, r9, r10, fp\}" } } */
174+
175+/* Now we check that we use the correct intrinsic to call. */
176+/* { dg-final { scan-assembler "blxns" } } */
177diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-7a.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-7a.c
178--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-7a.c 1969-12-31 16:00:00.000000000 -0800
179+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-7a.c 2021-11-15 02:30:37.210637445 -0800
180@@ -0,0 +1,27 @@
181+/* { dg-do compile } */
182+/* { dg-options "-mcmse -mfloat-abi=softfp -mfpu=fpv5-d16 -mfix-cmse-cve-2021-35465" } */
183+/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=softfp" } } */
184+/* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
185+
186+#include "../../../cmse-7.x"
187+
188+/* Checks for saving and clearing prior to function call. */
189+/* Shift on the same register as blxns. */
190+/* { dg-final { scan-assembler "lsrs\t(r\[0-9\]|r10|fp|ip), \\1, #1.*blxns\t\\1" } } */
191+/* { dg-final { scan-assembler "lsls\t(r\[0-9\]|r10|fp|ip), \\1, #1.*blxns\t\\1" } } */
192+/* { dg-final { scan-assembler "push\t\{r4, r5, r6, r7, r8, r9, r10, fp\}" } } */
193+/* { dg-final { scan-assembler "vlstm\tsp" } } */
194+/* Check the right registers are cleared and none appears twice. */
195+/* { dg-final { scan-assembler "clrm\t\{(r0, )?(r1, )?(r2, )?(r3, )?(r4, )?(r5, )?(r6, )?(r7, )?(r8, )?(r9, )?(r10, )?(fp, )?(ip, )?APSR\}" } } */
196+/* Check that the right number of registers is cleared and thus only one
197+ register is missing. */
198+/* { dg-final { scan-assembler "clrm\t\{((r\[0-9\]|r10|fp|ip), ){12}APSR\}" } } */
199+/* Check that no cleared register is used for blxns. */
200+/* { dg-final { scan-assembler-not "clrm\t\{\[^\}\]\+(r\[0-9\]|r10|fp|ip),\[^\}\]\+\}.*blxns\t\\1" } } */
201+/* Check for v8.1-m variant of erratum work-around. */
202+/* { dg-final { scan-assembler "vscclrm\t\{vpr\}" } } */
203+/* { dg-final { scan-assembler "vlldm\tsp" } } */
204+/* { dg-final { scan-assembler "pop\t\{r4, r5, r6, r7, r8, r9, r10, fp\}" } } */
205+
206+/* Now we check that we use the correct intrinsic to call. */
207+/* { dg-final { scan-assembler "blxns" } } */
208diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-8a.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-8a.c
209--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-8a.c 1969-12-31 16:00:00.000000000 -0800
210+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-8a.c 2021-11-15 02:30:37.210637445 -0800
211@@ -0,0 +1,29 @@
212+/* { dg-do compile } */
213+/* { dg-options "-mcmse -mfloat-abi=softfp -mfpu=fpv5-d16 -mfix-cmse-cve-2021-35465" } */
214+/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=softfp" } } */
215+/* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
216+
217+#include "../../../cmse-8.x"
218+
219+/* Checks for saving and clearing prior to function call. */
220+/* Shift on the same register as blxns. */
221+/* { dg-final { scan-assembler "lsrs\t(r\[2-9\]|r10|fp|ip), \\1, #1.*blxns\t\\1" } } */
222+/* { dg-final { scan-assembler "lsls\t(r\[2-9\]|r10|fp|ip), \\1, #1.*blxns\t\\1" } } */
223+/* { dg-final { scan-assembler-not "mov\tr0, r4" } } */
224+/* { dg-final { scan-assembler-not "mov\tr1, r4" } } */
225+/* { dg-final { scan-assembler "push\t\{r4, r5, r6, r7, r8, r9, r10, fp\}" } } */
226+/* { dg-final { scan-assembler "vlstm\tsp" } } */
227+/* Check the right registers are cleared and none appears twice. */
228+/* { dg-final { scan-assembler "clrm\t\{(r2, )?(r3, )?(r4, )?(r5, )?(r6, )?(r7, )?(r8, )?(r9, )?(r10, )?(fp, )?(ip, )?APSR\}" } } */
229+/* Check that the right number of registers is cleared and thus only one
230+ register is missing. */
231+/* { dg-final { scan-assembler "clrm\t\{((r\[2-9\]|r10|fp|ip), ){10}APSR\}" } } */
232+/* Check that no cleared register is used for blxns. */
233+/* { dg-final { scan-assembler-not "clrm\t\{\[^\}\]\+(r\[2-9\]|r10|fp|ip),\[^\}\]\+\}.*blxns\t\\1" } } */
234+/* Check for v8.1-m variant of erratum work-around. */
235+/* { dg-final { scan-assembler "vscclrm\t\{vpr\}" } } */
236+/* { dg-final { scan-assembler "vlldm\tsp" } } */
237+/* { dg-final { scan-assembler "pop\t\{r4, r5, r6, r7, r8, r9, r10, fp\}" } } */
238+
239+/* Now we check that we use the correct intrinsic to call. */
240+/* { dg-final { scan-assembler "blxns" } } */
241diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp-sp/cmse-7a.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp-sp/cmse-7a.c
242--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp-sp/cmse-7a.c 1969-12-31 16:00:00.000000000 -0800
243+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp-sp/cmse-7a.c 2021-11-15 02:30:37.210637445 -0800
244@@ -0,0 +1,27 @@
245+/* { dg-do compile } */
246+/* { dg-options "-mcmse -mfloat-abi=softfp -mfpu=fpv5-sp-d16 -mfix-cmse-cve-2021-35465" } */
247+/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=softfp" } } */
248+/* { dg-skip-if "Skip these if testing double precision" {*-*-*} {"-mfpu=fpv[4-5]-d16"} {""} } */
249+
250+#include "../../../cmse-7.x"
251+
252+/* Checks for saving and clearing prior to function call. */
253+/* Shift on the same register as blxns. */
254+/* { dg-final { scan-assembler "lsrs\t(r\[0-9\]|r10|fp|ip), \\1, #1.*blxns\t\\1" } } */
255+/* { dg-final { scan-assembler "lsls\t(r\[0-9\]|r10|fp|ip), \\1, #1.*blxns\t\\1" } } */
256+/* { dg-final { scan-assembler "push\t\{r4, r5, r6, r7, r8, r9, r10, fp\}" } } */
257+/* { dg-final { scan-assembler "vlstm\tsp" } } */
258+/* Check the right registers are cleared and none appears twice. */
259+/* { dg-final { scan-assembler "clrm\t\{(r0, )?(r1, )?(r2, )?(r3, )?(r4, )?(r5, )?(r6, )?(r7, )?(r8, )?(r9, )?(r10, )?(fp, )?(ip, )?APSR\}" } } */
260+/* Check that the right number of registers is cleared and thus only one
261+ register is missing. */
262+/* { dg-final { scan-assembler "clrm\t\{((r\[0-9\]|r10|fp|ip), ){12}APSR\}" } } */
263+/* Check that no cleared register is used for blxns. */
264+/* { dg-final { scan-assembler-not "clrm\t\{\[^\}\]\+(r\[0-9\]|r10|fp|ip),\[^\}\]\+\}.*blxns\t\\1" } } */
265+/* Check for v8.1-m variant of erratum work-around. */
266+/* { dg-final { scan-assembler "vscclrm\t\{vpr\}" } } */
267+/* { dg-final { scan-assembler "vlldm\tsp" } } */
268+/* { dg-final { scan-assembler "pop\t\{r4, r5, r6, r7, r8, r9, r10, fp\}" } } */
269+
270+/* Now we check that we use the correct intrinsic to call. */
271+/* { dg-final { scan-assembler "blxns" } } */
272diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp-sp/cmse-8a.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp-sp/cmse-8a.c
273--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp-sp/cmse-8a.c 1969-12-31 16:00:00.000000000 -0800
274+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/8_1m/softfp-sp/cmse-8a.c 2021-11-15 02:30:37.210637445 -0800
275@@ -0,0 +1,29 @@
276+/* { dg-do compile } */
277+/* { dg-options "-mcmse -mfloat-abi=softfp -mfpu=fpv5-sp-d16 -mfix-cmse-cve-2021-35465" } */
278+/* { dg-skip-if "Incompatible float ABI" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=softfp" } } */
279+/* { dg-skip-if "Skip these if testing double precision" {*-*-*} {"-mfpu=fpv[4-5]-d16"} {""} } */
280+
281+#include "../../../cmse-8.x"
282+
283+/* Checks for saving and clearing prior to function call. */
284+/* Shift on the same register as blxns. */
285+/* { dg-final { scan-assembler "lsrs\t(r\[2-9\]|r10|fp|ip), \\1, #1.*blxns\t\\1" } } */
286+/* { dg-final { scan-assembler "lsls\t(r\[2-9\]|r10|fp|ip), \\1, #1.*blxns\t\\1" } } */
287+/* { dg-final { scan-assembler-not "mov\tr0, r4" } } */
288+/* { dg-final { scan-assembler-not "mov\tr1, r4" } } */
289+/* { dg-final { scan-assembler "push\t\{r4, r5, r6, r7, r8, r9, r10, fp\}" } } */
290+/* { dg-final { scan-assembler "vlstm\tsp" } } */
291+/* Check the right registers are cleared and none appears twice. */
292+/* { dg-final { scan-assembler "clrm\t\{(r2, )?(r3, )?(r4, )?(r5, )?(r6, )?(r7, )?(r8, )?(r9, )?(r10, )?(fp, )?(ip, )?APSR\}" } } */
293+/* Check that the right number of registers is cleared and thus only one
294+ register is missing. */
295+/* { dg-final { scan-assembler "clrm\t\{((r\[2-9\]|r10|fp|ip), ){10}APSR\}" } } */
296+/* Check that no cleared register is used for blxns. */
297+/* { dg-final { scan-assembler-not "clrm\t\{\[^\}\]\+(r\[2-9\]|r10|fp|ip),\[^\}\]\+\}.*blxns\t\\1" } } */
298+/* Check for v8.1-m variant of erratum work-around. */
299+/* { dg-final { scan-assembler "vscclrm\t\{vpr\}" } } */
300+/* { dg-final { scan-assembler "vlldm\tsp" } } */
301+/* { dg-final { scan-assembler "pop\t\{r4, r5, r6, r7, r8, r9, r10, fp\}" } } */
302+
303+/* Now we check that we use the correct intrinsic to call. */
304+/* { dg-final { scan-assembler "blxns" } } */
diff --git a/meta/recipes-devtools/gcc/gcc/0007-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch b/meta/recipes-devtools/gcc/gcc/0004-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
index 9844c2ae8a..55a58851dc 100644
--- a/meta/recipes-devtools/gcc/gcc/0007-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
+++ b/meta/recipes-devtools/gcc/gcc/0004-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
@@ -1,4 +1,4 @@
1From e64342df647829d3e1c52fd480a5be7c1281ced0 Mon Sep 17 00:00:00 2001 1From 1766cf28fd7d917df510b1c262c47211b9ea70fa Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:17:25 +0400 3Date: Fri, 29 Mar 2013 09:17:25 +0400
4Subject: [PATCH] Use the defaults.h in ${B} instead of ${S}, and t-oe in ${B} 4Subject: [PATCH] Use the defaults.h in ${B} instead of ${S}, and t-oe in ${B}
@@ -26,7 +26,7 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
26 4 files changed, 7 insertions(+), 7 deletions(-) 26 4 files changed, 7 insertions(+), 7 deletions(-)
27 27
28diff --git a/gcc/Makefile.in b/gcc/Makefile.in 28diff --git a/gcc/Makefile.in b/gcc/Makefile.in
29index 8a5fb3fd99c..7da6f439fff 100644 29index 7bfd6ce653f..95962ae37b6 100644
30--- a/gcc/Makefile.in 30--- a/gcc/Makefile.in
31+++ b/gcc/Makefile.in 31+++ b/gcc/Makefile.in
32@@ -552,7 +552,7 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@ 32@@ -552,7 +552,7 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
@@ -39,10 +39,10 @@ index 8a5fb3fd99c..7da6f439fff 100644
39 TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@ 39 TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@
40 TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@ 40 TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@
41diff --git a/gcc/configure b/gcc/configure 41diff --git a/gcc/configure b/gcc/configure
42index 3f0734bff11..c5d3bc4ee2d 100755 42index d7445339f9a..f5b99d1cf7d 100755
43--- a/gcc/configure 43--- a/gcc/configure
44+++ b/gcc/configure 44+++ b/gcc/configure
45@@ -13090,8 +13090,8 @@ for f in $tm_file; do 45@@ -13131,8 +13131,8 @@ for f in $tm_file; do
46 tm_include_list="${tm_include_list} $f" 46 tm_include_list="${tm_include_list} $f"
47 ;; 47 ;;
48 defaults.h ) 48 defaults.h )
@@ -54,10 +54,10 @@ index 3f0734bff11..c5d3bc4ee2d 100755
54 * ) 54 * )
55 tm_file_list="${tm_file_list} \$(srcdir)/config/$f" 55 tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
56diff --git a/gcc/configure.ac b/gcc/configure.ac 56diff --git a/gcc/configure.ac b/gcc/configure.ac
57index 54e21764b3e..f83420326d6 100644 57index fe488f2232b..29005f6d18f 100644
58--- a/gcc/configure.ac 58--- a/gcc/configure.ac
59+++ b/gcc/configure.ac 59+++ b/gcc/configure.ac
60@@ -2263,8 +2263,8 @@ for f in $tm_file; do 60@@ -2294,8 +2294,8 @@ for f in $tm_file; do
61 tm_include_list="${tm_include_list} $f" 61 tm_include_list="${tm_include_list} $f"
62 ;; 62 ;;
63 defaults.h ) 63 defaults.h )
diff --git a/meta/recipes-devtools/gcc/gcc/0005-cpp-honor-sysroot.patch b/meta/recipes-devtools/gcc/gcc/0005-cpp-honor-sysroot.patch
new file mode 100644
index 0000000000..f2883fe074
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/0005-cpp-honor-sysroot.patch
@@ -0,0 +1,53 @@
1From e6a820a19c4cd115d8af7c235c5f9700c7a24730 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] 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: Submitted [https://gcc.gnu.org/pipermail/gcc-patches/2021-October/582725.html]
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 8902ae1d2ed..e99e2fcd6ad 100644
30--- a/gcc/cp/lang-specs.h
31+++ b/gcc/cp/lang-specs.h
32@@ -116,7 +116,7 @@ along with GCC; see the file COPYING3. If not see
33 {".ii", "@c++-cpp-output", 0, 0, 0},
34 {"@c++-cpp-output",
35 "%{!E:%{!M:%{!MM:"
36- " cc1plus -fpreprocessed %i %(cc1_options) %2"
37+ " cc1plus -fpreprocessed %i %I %(cc1_options) %2"
38 " %{!fsyntax-only:"
39 " %{fmodule-only:%{!S:-o %g.s%V}}"
40 " %{!fmodule-only:%{!fmodule-header*:%(invoke_as)}}}"
41diff --git a/gcc/gcc.c b/gcc/gcc.c
42index b047fc31c2f..bdee2671532 100644
43--- a/gcc/gcc.c
44+++ b/gcc/gcc.c
45@@ -1469,7 +1469,7 @@ static const struct compiler default_compilers[] =
46 %W{o*:--output-pch=%*}}%V}}}}}}}", 0, 0, 0},
47 {".i", "@cpp-output", 0, 0, 0},
48 {"@cpp-output",
49- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
50+ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
51 {".s", "@assembler", 0, 0, 0},
52 {"@assembler",
53 "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0},
diff --git a/meta/recipes-devtools/gcc/gcc/0011-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch b/meta/recipes-devtools/gcc/gcc/0006-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
index 0884730786..ef19eef822 100644
--- a/meta/recipes-devtools/gcc/gcc/0011-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
+++ b/meta/recipes-devtools/gcc/gcc/0006-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
@@ -1,4 +1,4 @@
1From 8e9d6efecdc8c42f47e3a012dee764b13c3dad59 Mon Sep 17 00:00:00 2001 1From 84dd8ea4c982fc2c82af642293d29e9c1880de5b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:24:50 +0400 3Date: Fri, 29 Mar 2013 09:24:50 +0400
4Subject: [PATCH] Define GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER 4Subject: [PATCH] Define GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER
@@ -12,25 +12,43 @@ SH, sparc, alpha for possible future support (if any)
12 12
13Removes the do_headerfix task in metadata 13Removes the do_headerfix task in metadata
14 14
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16
17Upstream-Status: Inappropriate [OE configuration] 15Upstream-Status: Inappropriate [OE configuration]
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
18--- 17---
19 gcc/config/alpha/linux-elf.h | 4 ++-- 18 gcc/config/aarch64/aarch64-linux.h | 4 ++--
20 gcc/config/arm/linux-eabi.h | 4 ++-- 19 gcc/config/alpha/linux-elf.h | 4 ++--
21 gcc/config/arm/linux-elf.h | 2 +- 20 gcc/config/arm/linux-eabi.h | 4 ++--
22 gcc/config/i386/linux.h | 2 +- 21 gcc/config/arm/linux-elf.h | 2 +-
23 gcc/config/i386/linux64.h | 6 +++--- 22 gcc/config/i386/linux.h | 2 +-
24 gcc/config/linux.h | 8 ++++---- 23 gcc/config/i386/linux64.h | 6 +++---
25 gcc/config/mips/linux.h | 12 ++++++------ 24 gcc/config/linux.h | 8 ++++----
26 gcc/config/riscv/linux.h | 2 +- 25 gcc/config/mips/linux.h | 12 ++++++------
27 gcc/config/rs6000/linux64.h | 15 +++++---------- 26 gcc/config/riscv/linux.h | 2 +-
28 gcc/config/sh/linux.h | 2 +- 27 gcc/config/rs6000/linux64.h | 15 +++++----------
29 gcc/config/sparc/linux.h | 2 +- 28 gcc/config/sh/linux.h | 2 +-
30 gcc/config/sparc/linux64.h | 4 ++-- 29 gcc/config/sparc/linux.h | 2 +-
31 12 files changed, 29 insertions(+), 34 deletions(-) 30 gcc/config/sparc/linux64.h | 4 ++--
31 13 files changed, 31 insertions(+), 36 deletions(-)
32 32
33unchanged: 33diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
34index 7f2529a2a1d..4bcae7f3110 100644
35--- a/gcc/config/aarch64/aarch64-linux.h
36+++ b/gcc/config/aarch64/aarch64-linux.h
37@@ -21,10 +21,10 @@
38 #ifndef GCC_AARCH64_LINUX_H
39 #define GCC_AARCH64_LINUX_H
40
41-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
42+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
43
44 #undef MUSL_DYNAMIC_LINKER
45-#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
46+#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
47
48 #undef ASAN_CC1_SPEC
49 #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
50diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
51index c1dae8ca2cf..3ce2b76c1a4 100644
34--- a/gcc/config/alpha/linux-elf.h 52--- a/gcc/config/alpha/linux-elf.h
35+++ b/gcc/config/alpha/linux-elf.h 53+++ b/gcc/config/alpha/linux-elf.h
36@@ -23,8 +23,8 @@ along with GCC; see the file COPYING3. If not see 54@@ -23,8 +23,8 @@ along with GCC; see the file COPYING3. If not see
@@ -44,7 +62,8 @@ unchanged:
44 #if DEFAULT_LIBC == LIBC_UCLIBC 62 #if DEFAULT_LIBC == LIBC_UCLIBC
45 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" 63 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
46 #elif DEFAULT_LIBC == LIBC_GLIBC 64 #elif DEFAULT_LIBC == LIBC_GLIBC
47unchanged: 65diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
66index 85d0136e76e..6bd95855827 100644
48--- a/gcc/config/arm/linux-eabi.h 67--- a/gcc/config/arm/linux-eabi.h
49+++ b/gcc/config/arm/linux-eabi.h 68+++ b/gcc/config/arm/linux-eabi.h
50@@ -65,8 +65,8 @@ 69@@ -65,8 +65,8 @@
@@ -58,7 +77,8 @@ unchanged:
58 #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT 77 #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
59 78
60 #define GLIBC_DYNAMIC_LINKER \ 79 #define GLIBC_DYNAMIC_LINKER \
61unchanged: 80diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
81index 0c1c4e70b6b..6bd643ade11 100644
62--- a/gcc/config/arm/linux-elf.h 82--- a/gcc/config/arm/linux-elf.h
63+++ b/gcc/config/arm/linux-elf.h 83+++ b/gcc/config/arm/linux-elf.h
64@@ -60,7 +60,7 @@ 84@@ -60,7 +60,7 @@
@@ -70,7 +90,8 @@ unchanged:
70 90
71 #define LINUX_TARGET_LINK_SPEC "%{h*} \ 91 #define LINUX_TARGET_LINK_SPEC "%{h*} \
72 %{static:-Bstatic} \ 92 %{static:-Bstatic} \
73unchanged: 93diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
94index 04b274f1654..7aafcf3ac2d 100644
74--- a/gcc/config/i386/linux.h 95--- a/gcc/config/i386/linux.h
75+++ b/gcc/config/i386/linux.h 96+++ b/gcc/config/i386/linux.h
76@@ -20,7 +20,7 @@ along with GCC; see the file COPYING3. If not see 97@@ -20,7 +20,7 @@ along with GCC; see the file COPYING3. If not see
@@ -82,7 +103,8 @@ unchanged:
82 103
83 #undef MUSL_DYNAMIC_LINKER 104 #undef MUSL_DYNAMIC_LINKER
84 #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1" 105 #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
85unchanged: 106diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
107index b3822ced528..92d303e80d6 100644
86--- a/gcc/config/i386/linux64.h 108--- a/gcc/config/i386/linux64.h
87+++ b/gcc/config/i386/linux64.h 109+++ b/gcc/config/i386/linux64.h
88@@ -27,9 +27,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 110@@ -27,9 +27,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -98,7 +120,8 @@ unchanged:
98 120
99 #undef MUSL_DYNAMIC_LINKER32 121 #undef MUSL_DYNAMIC_LINKER32
100 #define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1" 122 #define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
101unchanged: 123diff --git a/gcc/config/linux.h b/gcc/config/linux.h
124index 4e1db60fced..87efc5f69fe 100644
102--- a/gcc/config/linux.h 125--- a/gcc/config/linux.h
103+++ b/gcc/config/linux.h 126+++ b/gcc/config/linux.h
104@@ -94,10 +94,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 127@@ -94,10 +94,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -116,7 +139,8 @@ unchanged:
116 #define BIONIC_DYNAMIC_LINKER "/system/bin/linker" 139 #define BIONIC_DYNAMIC_LINKER "/system/bin/linker"
117 #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker" 140 #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
118 #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64" 141 #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
119unchanged: 142diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
143index 44a85e410d9..8d41b5574f6 100644
120--- a/gcc/config/mips/linux.h 144--- a/gcc/config/mips/linux.h
121+++ b/gcc/config/mips/linux.h 145+++ b/gcc/config/mips/linux.h
122@@ -22,20 +22,20 @@ along with GCC; see the file COPYING3. If not see 146@@ -22,20 +22,20 @@ along with GCC; see the file COPYING3. If not see
@@ -146,7 +170,8 @@ unchanged:
146 170
147 #undef MUSL_DYNAMIC_LINKER32 171 #undef MUSL_DYNAMIC_LINKER32
148 #define MUSL_DYNAMIC_LINKER32 \ 172 #define MUSL_DYNAMIC_LINKER32 \
149unchanged: 173diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
174index fce5b896e6e..03aa55cb5ab 100644
150--- a/gcc/config/riscv/linux.h 175--- a/gcc/config/riscv/linux.h
151+++ b/gcc/config/riscv/linux.h 176+++ b/gcc/config/riscv/linux.h
152@@ -22,7 +22,7 @@ along with GCC; see the file COPYING3. If not see 177@@ -22,7 +22,7 @@ along with GCC; see the file COPYING3. If not see
@@ -158,7 +183,8 @@ unchanged:
158 183
159 #define MUSL_ABI_SUFFIX \ 184 #define MUSL_ABI_SUFFIX \
160 "%{mabi=ilp32:-sf}" \ 185 "%{mabi=ilp32:-sf}" \
161unchanged: 186diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
187index e3f2cd254f6..a11e01faa3d 100644
162--- a/gcc/config/rs6000/linux64.h 188--- a/gcc/config/rs6000/linux64.h
163+++ b/gcc/config/rs6000/linux64.h 189+++ b/gcc/config/rs6000/linux64.h
164@@ -336,24 +336,19 @@ extern int dot_symbols; 190@@ -336,24 +336,19 @@ extern int dot_symbols;
@@ -191,7 +217,8 @@ unchanged:
191 217
192 #undef DEFAULT_ASM_ENDIAN 218 #undef DEFAULT_ASM_ENDIAN
193 #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN) 219 #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
194unchanged: 220diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h
221index 7558d2f7195..3aaa6c3a078 100644
195--- a/gcc/config/sh/linux.h 222--- a/gcc/config/sh/linux.h
196+++ b/gcc/config/sh/linux.h 223+++ b/gcc/config/sh/linux.h
197@@ -64,7 +64,7 @@ along with GCC; see the file COPYING3. If not see 224@@ -64,7 +64,7 @@ along with GCC; see the file COPYING3. If not see
@@ -203,7 +230,8 @@ unchanged:
203 230
204 #undef SUBTARGET_LINK_EMUL_SUFFIX 231 #undef SUBTARGET_LINK_EMUL_SUFFIX
205 #define SUBTARGET_LINK_EMUL_SUFFIX "%{mfdpic:_fd;:_linux}" 232 #define SUBTARGET_LINK_EMUL_SUFFIX "%{mfdpic:_fd;:_linux}"
206unchanged: 233diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
234index 2550d7ee8f0..a94f4cd8ba2 100644
207--- a/gcc/config/sparc/linux.h 235--- a/gcc/config/sparc/linux.h
208+++ b/gcc/config/sparc/linux.h 236+++ b/gcc/config/sparc/linux.h
209@@ -78,7 +78,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); 237@@ -78,7 +78,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
@@ -215,7 +243,8 @@ unchanged:
215 243
216 #undef LINK_SPEC 244 #undef LINK_SPEC
217 #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \ 245 #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
218unchanged: 246diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
247index 95af8afa9b5..63127afb074 100644
219--- a/gcc/config/sparc/linux64.h 248--- a/gcc/config/sparc/linux64.h
220+++ b/gcc/config/sparc/linux64.h 249+++ b/gcc/config/sparc/linux64.h
221@@ -78,8 +78,8 @@ along with GCC; see the file COPYING3. If not see 250@@ -78,8 +78,8 @@ along with GCC; see the file COPYING3. If not see
@@ -229,19 +258,3 @@ unchanged:
229 258
230 #ifdef SPARC_BI_ARCH 259 #ifdef SPARC_BI_ARCH
231 260
232diff -u b/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
233--- b/gcc/config/aarch64/aarch64-linux.h
234+++ b/gcc/config/aarch64/aarch64-linux.h
235@@ -21,10 +21,10 @@
236 #ifndef GCC_AARCH64_LINUX_H
237 #define GCC_AARCH64_LINUX_H
238
239-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
240+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
241
242 #undef MUSL_DYNAMIC_LINKER
243-#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
244+#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
245
246 #undef ASAN_CC1_SPEC
247 #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
diff --git a/meta/recipes-devtools/gcc/gcc/0007-gcc-Fix-argument-list-too-long-error.patch b/meta/recipes-devtools/gcc/gcc/0007-gcc-Fix-argument-list-too-long-error.patch
new file mode 100644
index 0000000000..9f9f8cc856
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/0007-gcc-Fix-argument-list-too-long-error.patch
@@ -0,0 +1,42 @@
1From 768e9075e88d811b00207d991123438bb996e4ea 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] 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
20RP: gcc then added *.h and *.def additions to this list, breaking the original
21fix. Add the sort to the original gcc code, leaving the tr+sort to fix the original
22issue but include the new files too as reported by Zhuang <qiuguang.zqg@alibaba-inc.com>
23
24Upstream-Status: Backport [https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=66e157188bd2f789809e17e85f917534c9381599]
25Signed-off-by: Khem Raj <raj.khem@gmail.com>
26---
27 gcc/Makefile.in | 2 +-
28 1 file changed, 1 insertion(+), 1 deletion(-)
29
30diff --git a/gcc/Makefile.in b/gcc/Makefile.in
31index 95962ae37b6..d1d4512bba3 100644
32--- a/gcc/Makefile.in
33+++ b/gcc/Makefile.in
34@@ -3671,7 +3671,7 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
35 # We keep the directory structure for files in config, common/config or
36 # c-family and .def files. All other files are flattened to a single directory.
37 $(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
38- headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
39+ headers=`echo $(sort $(PLUGIN_HEADERS)) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
40 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
41 for file in $$headers; do \
42 if [ -f $$file ] ; then \
diff --git a/meta/recipes-devtools/gcc/gcc/0014-libtool.patch b/meta/recipes-devtools/gcc/gcc/0008-libtool.patch
index f2b8924ebf..358e1d7b3c 100644
--- a/meta/recipes-devtools/gcc/gcc/0014-libtool.patch
+++ b/meta/recipes-devtools/gcc/gcc/0008-libtool.patch
@@ -1,4 +1,4 @@
1From a5b984db9669cf38a7bd76c3fcdb41c086f740db Mon Sep 17 00:00:00 2001 1From b19700ef0103f9414416b9a779a64d6138c58b1f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:29:11 +0400 3Date: Fri, 29 Mar 2013 09:29:11 +0400
4Subject: [PATCH] libtool 4Subject: [PATCH] libtool
diff --git a/meta/recipes-devtools/gcc/gcc/0009-cpp-honor-sysroot.patch b/meta/recipes-devtools/gcc/gcc/0009-cpp-honor-sysroot.patch
deleted file mode 100644
index 37f26f0728..0000000000
--- a/meta/recipes-devtools/gcc/gcc/0009-cpp-honor-sysroot.patch
+++ /dev/null
@@ -1,59 +0,0 @@
1From: Richard Purdie <richard.purdie@linuxfoundation.org>
2Subject: [PATCH 5/5] gcc: Pass sysroot options to cpp for preprocessed source
3
4OpenEmbedded/Yocto Project extensively uses the --sysroot support within gcc.
5We discovered that when compiling preprocessed source (.i or .ii files), the
6compiler will try and access the builtin sysroot location rather than the
7--sysroot option specified on the commandline. If access to that directory is
8permission denied (unreadable), gcc will error. This is particularly problematic
9when ccache is involved.
10
11This patch adds %I to the cpp-output spec macro so the default substitutions for
12-iprefix, -isystem, -isysroot happen and the correct sysroot is used.
13
142021-10-27 Richard Purdie <richard.purdie@linuxfoundation.org>
15
16gcc/cp/ChangeLog:
17
18 * lang-specs.h: Pass sysroot options to cpp for preprocessed source
19
20gcc/ChangeLog:
21
22 * gcc.c: Pass sysroot options to cpp for preprocessed source
23
24Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
25
26[YOCTO #2074]
27
28Upstream-Status: Submitted [https://gcc.gnu.org/pipermail/gcc-patches/2021-October/582725.html]
29---
30 gcc/cp/lang-specs.h | 2 +-
31 gcc/gcc.c | 2 +-
32 2 files changed, 2 insertions(+), 2 deletions(-)
33
34Index: gcc-11.2.0/gcc/cp/lang-specs.h
35===================================================================
36--- gcc-11.2.0.orig/gcc/cp/lang-specs.h
37+++ gcc-11.2.0/gcc/cp/lang-specs.h
38@@ -116,7 +116,7 @@ along with GCC; see the file COPYING3.
39 {".ii", "@c++-cpp-output", 0, 0, 0},
40 {"@c++-cpp-output",
41 "%{!E:%{!M:%{!MM:"
42- " cc1plus -fpreprocessed %i %(cc1_options) %2"
43+ " cc1plus -fpreprocessed %i %I %(cc1_options) %2"
44 " %{!fsyntax-only:"
45 " %{fmodule-only:%{!S:-o %g.s%V}}"
46 " %{!fmodule-only:%{!fmodule-header*:%(invoke_as)}}}"
47Index: gcc-11.2.0/gcc/gcc.c
48===================================================================
49--- gcc-11.2.0.orig/gcc/gcc.c
50+++ gcc-11.2.0/gcc/gcc.c
51@@ -1470,7 +1470,7 @@ static const struct compiler default_com
52 %W{o*:--output-pch=%*}}%V}}}}}}}", 0, 0, 0},
53 {".i", "@cpp-output", 0, 0, 0},
54 {"@cpp-output",
55- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
56+ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
57 {".s", "@assembler", 0, 0, 0},
58 {"@assembler",
59 "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0},
diff --git a/meta/recipes-devtools/gcc/gcc/0015-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch b/meta/recipes-devtools/gcc/gcc/0009-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
index 1ccf39ceba..ac139542f1 100644
--- a/meta/recipes-devtools/gcc/gcc/0015-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
+++ b/meta/recipes-devtools/gcc/gcc/0009-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
@@ -1,4 +1,4 @@
1From 0ae7090dec149cb2ff0c87eef87c043d4000ece1 Mon Sep 17 00:00:00 2001 1From 10d23d93697167396e223711bf6210e1642ee926 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:30:32 +0400 3Date: Fri, 29 Mar 2013 09:30:32 +0400
4Subject: [PATCH] gcc: armv4: pass fix-v4bx to linker to support EABI. 4Subject: [PATCH] gcc: armv4: pass fix-v4bx to linker to support EABI.
diff --git a/meta/recipes-devtools/gcc/gcc/0016-Use-the-multilib-config-files-from-B-instead-of-usin.patch b/meta/recipes-devtools/gcc/gcc/0010-Use-the-multilib-config-files-from-B-instead-of-usin.patch
index bde7ec6609..4912fa9dce 100644
--- a/meta/recipes-devtools/gcc/gcc/0016-Use-the-multilib-config-files-from-B-instead-of-usin.patch
+++ b/meta/recipes-devtools/gcc/gcc/0010-Use-the-multilib-config-files-from-B-instead-of-usin.patch
@@ -1,4 +1,4 @@
1From 5ce8aa4615a3816d12c43752323154744517ae9f Mon Sep 17 00:00:00 2001 1From 5970fb3fadccd8c43f7f7030e6ff51e0295731ef Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:33:04 +0400 3Date: Fri, 29 Mar 2013 09:33:04 +0400
4Subject: [PATCH] Use the multilib config files from ${B} instead of using the 4Subject: [PATCH] Use the multilib config files from ${B} instead of using the
@@ -18,10 +18,10 @@ Upstream-Status: Inappropriate [configuration]
18 2 files changed, 36 insertions(+), 8 deletions(-) 18 2 files changed, 36 insertions(+), 8 deletions(-)
19 19
20diff --git a/gcc/configure b/gcc/configure 20diff --git a/gcc/configure b/gcc/configure
21index 5160917d73e..e663052cad2 100755 21index f5b99d1cf7d..ec3c24482df 100755
22--- a/gcc/configure 22--- a/gcc/configure
23+++ b/gcc/configure 23+++ b/gcc/configure
24@@ -13070,10 +13070,20 @@ done 24@@ -13111,10 +13111,20 @@ done
25 tmake_file_= 25 tmake_file_=
26 for f in ${tmake_file} 26 for f in ${tmake_file}
27 do 27 do
@@ -46,7 +46,7 @@ index 5160917d73e..e663052cad2 100755
46 done 46 done
47 tmake_file="${tmake_file_}${omp_device_property_tmake_file}" 47 tmake_file="${tmake_file_}${omp_device_property_tmake_file}"
48 48
49@@ -13084,6 +13094,10 @@ tm_file_list="options.h" 49@@ -13125,6 +13135,10 @@ tm_file_list="options.h"
50 tm_include_list="options.h insn-constants.h" 50 tm_include_list="options.h insn-constants.h"
51 for f in $tm_file; do 51 for f in $tm_file; do
52 case $f in 52 case $f in
@@ -58,10 +58,10 @@ index 5160917d73e..e663052cad2 100755
58 f=`echo $f | sed 's/^..//'` 58 f=`echo $f | sed 's/^..//'`
59 tm_file_list="${tm_file_list} $f" 59 tm_file_list="${tm_file_list} $f"
60diff --git a/gcc/configure.ac b/gcc/configure.ac 60diff --git a/gcc/configure.ac b/gcc/configure.ac
61index 50f78308e8a..2b84875b028 100644 61index 29005f6d18f..ea794cd1763 100644
62--- a/gcc/configure.ac 62--- a/gcc/configure.ac
63+++ b/gcc/configure.ac 63+++ b/gcc/configure.ac
64@@ -2243,10 +2243,20 @@ done 64@@ -2274,10 +2274,20 @@ done
65 tmake_file_= 65 tmake_file_=
66 for f in ${tmake_file} 66 for f in ${tmake_file}
67 do 67 do
@@ -86,7 +86,7 @@ index 50f78308e8a..2b84875b028 100644
86 done 86 done
87 tmake_file="${tmake_file_}${omp_device_property_tmake_file}" 87 tmake_file="${tmake_file_}${omp_device_property_tmake_file}"
88 88
89@@ -2257,6 +2267,10 @@ tm_file_list="options.h" 89@@ -2288,6 +2298,10 @@ tm_file_list="options.h"
90 tm_include_list="options.h insn-constants.h" 90 tm_include_list="options.h insn-constants.h"
91 for f in $tm_file; do 91 for f in $tm_file; do
92 case $f in 92 case $f in
diff --git a/meta/recipes-devtools/gcc/gcc/0017-Avoid-using-libdir-from-.la-which-usually-points-to-.patch b/meta/recipes-devtools/gcc/gcc/0011-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
index 3e0a1b4136..e3e35942e6 100644
--- a/meta/recipes-devtools/gcc/gcc/0017-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
+++ b/meta/recipes-devtools/gcc/gcc/0011-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
@@ -1,4 +1,4 @@
1From 75a1ce0265ca123f74f17a40ad8bd8f26d9c2ab3 Mon Sep 17 00:00:00 2001 1From 2af537b9ff0018945a27a7f89efad736a0f647d4 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 20 Feb 2015 09:39:38 +0000 3Date: Fri, 20 Feb 2015 09:39:38 +0000
4Subject: [PATCH] Avoid using libdir from .la which usually points to a host 4Subject: [PATCH] Avoid using libdir from .la which usually points to a host
diff --git a/meta/recipes-devtools/gcc/gcc/0019-Ensure-target-gcc-headers-can-be-included.patch b/meta/recipes-devtools/gcc/gcc/0012-Ensure-target-gcc-headers-can-be-included.patch
index 120d5a29b2..d33925eb40 100644
--- a/meta/recipes-devtools/gcc/gcc/0019-Ensure-target-gcc-headers-can-be-included.patch
+++ b/meta/recipes-devtools/gcc/gcc/0012-Ensure-target-gcc-headers-can-be-included.patch
@@ -1,4 +1,4 @@
1From 6f410ed8fb7eee11ba7a25634c2257666b98ef52 Mon Sep 17 00:00:00 2001 1From 9427c6cedf88e15f747c48cb4fcf9eda6f5c4555 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 20 Feb 2015 10:25:11 +0000 3Date: Fri, 20 Feb 2015 10:25:11 +0000
4Subject: [PATCH] Ensure target gcc headers can be included 4Subject: [PATCH] Ensure target gcc headers can be included
@@ -25,7 +25,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
25 4 files changed, 22 insertions(+) 25 4 files changed, 22 insertions(+)
26 26
27diff --git a/gcc/Makefile.in b/gcc/Makefile.in 27diff --git a/gcc/Makefile.in b/gcc/Makefile.in
28index 59c45c81393..9b17d120aa1 100644 28index d1d4512bba3..06eb0d27a28 100644
29--- a/gcc/Makefile.in 29--- a/gcc/Makefile.in
30+++ b/gcc/Makefile.in 30+++ b/gcc/Makefile.in
31@@ -630,6 +630,7 @@ libexecdir = @libexecdir@ 31@@ -630,6 +630,7 @@ libexecdir = @libexecdir@
@@ -36,7 +36,7 @@ index 59c45c81393..9b17d120aa1 100644
36 # Directory in which the compiler finds executables 36 # Directory in which the compiler finds executables
37 libexecsubdir = $(libexecdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix) 37 libexecsubdir = $(libexecdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
38 # Directory in which all plugin resources are installed 38 # Directory in which all plugin resources are installed
39@@ -3016,6 +3017,7 @@ CFLAGS-intl.o += -DLOCALEDIR=\"$(localedir)\" 39@@ -3009,6 +3010,7 @@ CFLAGS-intl.o += -DLOCALEDIR=\"$(localedir)\"
40 40
41 PREPROCESSOR_DEFINES = \ 41 PREPROCESSOR_DEFINES = \
42 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ 42 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
diff --git a/meta/recipes-devtools/gcc/gcc/0012-gcc-Fix-argument-list-too-long-error.patch b/meta/recipes-devtools/gcc/gcc/0012-gcc-Fix-argument-list-too-long-error.patch
deleted file mode 100644
index ebee30bbd6..0000000000
--- a/meta/recipes-devtools/gcc/gcc/0012-gcc-Fix-argument-list-too-long-error.patch
+++ /dev/null
@@ -1,38 +0,0 @@
1From: Richard Purdie <richard.purdie@linuxfoundation.org>
2Subject: [PATCH 2/5] gcc: Fix "argument list too long" from install-plugins
3
4When building in longer build paths (200+ characters), the
5"echo $(PLUGIN_HEADERS)" from the install-plugins target would cause an
6"argument list too long error" on some systems.
7
8Avoid this by calling make's sort function on the list which removes
9duplicates and stops the overflow from reaching the echo command.
10The original sort is left to handle the the .h and .def files.
11
122021-10-26 Richard Purdie <richard.purdie@linuxfoundation.org>
13
14gcc/ChangeLog:
15
16 * Makefile.in: Fix "argument list too long" from install-plugins
17
18Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
19
20Submitted [https://gcc.gnu.org/pipermail/gcc-patches/2021-October/582722.html]
21Upstream-Status: Backport [https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=66e157188bd2f789809e17e85f917534c9381599]
22---
23 gcc/Makefile.in | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26Index: gcc-11.2.0/gcc/Makefile.in
27===================================================================
28--- gcc-11.2.0.orig/gcc/Makefile.in
29+++ gcc-11.2.0/gcc/Makefile.in
30@@ -3678,7 +3678,7 @@ install-plugin: installdirs lang.install
31 # We keep the directory structure for files in config, common/config or
32 # c-family and .def files. All other files are flattened to a single directory.
33 $(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
34- headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
35+ headers=`echo $(sort $(PLUGIN_HEADERS)) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
36 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
37 for file in $$headers; do \
38 if [ -f $$file ] ; then \
diff --git a/meta/recipes-devtools/gcc/gcc/0020-Don-t-search-host-directory-during-relink-if-inst_pr.patch b/meta/recipes-devtools/gcc/gcc/0013-Don-t-search-host-directory-during-relink-if-inst_pr.patch
index bb2a3671f0..5b5d229eff 100644
--- a/meta/recipes-devtools/gcc/gcc/0020-Don-t-search-host-directory-during-relink-if-inst_pr.patch
+++ b/meta/recipes-devtools/gcc/gcc/0013-Don-t-search-host-directory-during-relink-if-inst_pr.patch
@@ -1,4 +1,4 @@
1From cd09adb1e7f2a7e81a9f595a17c36f24911b90ac Mon Sep 17 00:00:00 2001 1From ab6e6af5deca6f4b35b089a6b197776df38780e6 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 3 Mar 2015 08:21:19 +0000 3Date: Tue, 3 Mar 2015 08:21:19 +0000
4Subject: [PATCH] Don't search host directory during "relink" if $inst_prefix 4Subject: [PATCH] Don't search host directory during "relink" if $inst_prefix
diff --git a/meta/recipes-devtools/gcc/gcc/0023-libcc1-fix-libcc1-s-install-path-and-rpath.patch b/meta/recipes-devtools/gcc/gcc/0014-libcc1-fix-libcc1-s-install-path-and-rpath.patch
index fb4511cc1a..b82277cc4b 100644
--- a/meta/recipes-devtools/gcc/gcc/0023-libcc1-fix-libcc1-s-install-path-and-rpath.patch
+++ b/meta/recipes-devtools/gcc/gcc/0014-libcc1-fix-libcc1-s-install-path-and-rpath.patch
@@ -1,4 +1,4 @@
1From 2cfc5ee38b3f5ec1d7965aae0991bcd48b5dc2e6 Mon Sep 17 00:00:00 2001 1From fd862c8c112067d8613d921ae89c99056aca54a1 Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com> 2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Sun, 5 Jul 2015 20:25:18 -0700 3Date: Sun, 5 Jul 2015 20:25:18 -0700
4Subject: [PATCH] libcc1: fix libcc1's install path and rpath 4Subject: [PATCH] libcc1: fix libcc1's install path and rpath
@@ -20,10 +20,10 @@ Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
20 2 files changed, 4 insertions(+), 4 deletions(-) 20 2 files changed, 4 insertions(+), 4 deletions(-)
21 21
22diff --git a/libcc1/Makefile.am b/libcc1/Makefile.am 22diff --git a/libcc1/Makefile.am b/libcc1/Makefile.am
23index f148fdd7aa2..0b6eb8f2855 100644 23index 3b75e7d9290..d3a4c4f9ddf 100644
24--- a/libcc1/Makefile.am 24--- a/libcc1/Makefile.am
25+++ b/libcc1/Makefile.am 25+++ b/libcc1/Makefile.am
26@@ -40,8 +40,8 @@ libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \ 26@@ -41,8 +41,8 @@ libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
27 $(Wc)$(libiberty_normal))) 27 $(Wc)$(libiberty_normal)))
28 libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty)) 28 libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty))
29 29
@@ -35,7 +35,7 @@ index f148fdd7aa2..0b6eb8f2855 100644
35 if ENABLE_PLUGIN 35 if ENABLE_PLUGIN
36 plugin_LTLIBRARIES = libcc1plugin.la libcp1plugin.la 36 plugin_LTLIBRARIES = libcc1plugin.la libcp1plugin.la
37diff --git a/libcc1/Makefile.in b/libcc1/Makefile.in 37diff --git a/libcc1/Makefile.in b/libcc1/Makefile.in
38index 753d435c9cb..455627b0a3b 100644 38index 07fa9d94c83..a9f737d78f2 100644
39--- a/libcc1/Makefile.in 39--- a/libcc1/Makefile.in
40+++ b/libcc1/Makefile.in 40+++ b/libcc1/Makefile.in
41@@ -398,8 +398,8 @@ libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \ 41@@ -398,8 +398,8 @@ libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
diff --git a/meta/recipes-devtools/gcc/gcc/0018-export-CPP.patch b/meta/recipes-devtools/gcc/gcc/0015-Makefile.in-Ensure-build-CPP-CPPFLAGS-is-used-for-bu.patch
index 86ab6574c7..45953f861d 100644
--- a/meta/recipes-devtools/gcc/gcc/0018-export-CPP.patch
+++ b/meta/recipes-devtools/gcc/gcc/0015-Makefile.in-Ensure-build-CPP-CPPFLAGS-is-used-for-bu.patch
@@ -1,5 +1,8 @@
1From 667b302f637be0a4b6ef714b5eb0026c54425386 Mon Sep 17 00:00:00 2001
1From: Richard Purdie <richard.purdie@linuxfoundation.org> 2From: Richard Purdie <richard.purdie@linuxfoundation.org>
2Subject: [PATCH 1/5] Makefile.in: Ensure build CPP/CPPFLAGS is used for build targets 3Date: Sun, 31 Oct 2021 17:40:12 -0700
4Subject: [PATCH] Makefile.in: Ensure build CPP/CPPFLAGS is used for build
5 targets
3 6
4During cross compiling, CPP is being set to the target compiler even for 7During cross compiling, CPP is being set to the target compiler even for
5build targets. As an example, when building a cross compiler targetting 8build targets. As an example, when building a cross compiler targetting
@@ -42,6 +45,8 @@ Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
42 45
43Submitted [https://gcc.gnu.org/pipermail/gcc-patches/2021-October/582727.html] 46Submitted [https://gcc.gnu.org/pipermail/gcc-patches/2021-October/582727.html]
44Upstream-Status: Backport [https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=84401ce5fb4ecab55decb472b168100e7593e01f] 47Upstream-Status: Backport [https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=84401ce5fb4ecab55decb472b168100e7593e01f]
48
49Signed-off-by: Khem Raj <raj.khem@gmail.com>
45--- 50---
46 Makefile.in | 6 ++++++ 51 Makefile.in | 6 ++++++
47 Makefile.tpl | 6 ++++++ 52 Makefile.tpl | 6 ++++++
@@ -51,11 +56,11 @@ Upstream-Status: Backport [https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=844
51 gcc/configure.ac | 2 +- 56 gcc/configure.ac | 2 +-
52 6 files changed, 22 insertions(+), 2 deletions(-) 57 6 files changed, 22 insertions(+), 2 deletions(-)
53 58
54Index: gcc-11.2.0/Makefile.in 59diff --git a/Makefile.in b/Makefile.in
55=================================================================== 60index 20cbbe2906d..33476d53327 100644
56--- gcc-11.2.0.orig/Makefile.in 61--- a/Makefile.in
57+++ gcc-11.2.0/Makefile.in 62+++ b/Makefile.in
58@@ -151,6 +151,8 @@ BUILD_EXPORTS = \ 63@@ -154,6 +154,8 @@ BUILD_EXPORTS = \
59 CC="$(CC_FOR_BUILD)"; export CC; \ 64 CC="$(CC_FOR_BUILD)"; export CC; \
60 CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ 65 CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
61 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ 66 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
@@ -64,7 +69,7 @@ Index: gcc-11.2.0/Makefile.in
64 CXX="$(CXX_FOR_BUILD)"; export CXX; \ 69 CXX="$(CXX_FOR_BUILD)"; export CXX; \
65 CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ 70 CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
66 GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \ 71 GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
67@@ -198,6 +200,8 @@ HOST_EXPORTS = \ 72@@ -202,6 +204,8 @@ HOST_EXPORTS = \
68 AR="$(AR)"; export AR; \ 73 AR="$(AR)"; export AR; \
69 AS="$(AS)"; export AS; \ 74 AS="$(AS)"; export AS; \
70 CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ 75 CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
@@ -72,8 +77,8 @@ Index: gcc-11.2.0/Makefile.in
72+ CPPFLAGS_FOR_BUILD="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS_FOR_BUILD; \ 77+ CPPFLAGS_FOR_BUILD="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS_FOR_BUILD; \
73 CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \ 78 CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \
74 DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ 79 DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
75 LD="$(LD)"; export LD; \ 80 DSYMUTIL="$(DSYMUTIL)"; export DSYMUTIL; \
76@@ -353,6 +357,8 @@ AR_FOR_BUILD = @AR_FOR_BUILD@ 81@@ -360,6 +364,8 @@ AR_FOR_BUILD = @AR_FOR_BUILD@
77 AS_FOR_BUILD = @AS_FOR_BUILD@ 82 AS_FOR_BUILD = @AS_FOR_BUILD@
78 CC_FOR_BUILD = @CC_FOR_BUILD@ 83 CC_FOR_BUILD = @CC_FOR_BUILD@
79 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ 84 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
@@ -82,11 +87,11 @@ Index: gcc-11.2.0/Makefile.in
82 CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@ 87 CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@
83 CXX_FOR_BUILD = @CXX_FOR_BUILD@ 88 CXX_FOR_BUILD = @CXX_FOR_BUILD@
84 DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@ 89 DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
85Index: gcc-11.2.0/Makefile.tpl 90diff --git a/Makefile.tpl b/Makefile.tpl
86=================================================================== 91index 9adf4f94728..e39d85d1109 100644
87--- gcc-11.2.0.orig/Makefile.tpl 92--- a/Makefile.tpl
88+++ gcc-11.2.0/Makefile.tpl 93+++ b/Makefile.tpl
89@@ -154,6 +154,8 @@ BUILD_EXPORTS = \ 94@@ -157,6 +157,8 @@ BUILD_EXPORTS = \
90 CC="$(CC_FOR_BUILD)"; export CC; \ 95 CC="$(CC_FOR_BUILD)"; export CC; \
91 CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ 96 CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
92 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ 97 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
@@ -95,7 +100,7 @@ Index: gcc-11.2.0/Makefile.tpl
95 CXX="$(CXX_FOR_BUILD)"; export CXX; \ 100 CXX="$(CXX_FOR_BUILD)"; export CXX; \
96 CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ 101 CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
97 GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \ 102 GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
98@@ -201,6 +203,8 @@ HOST_EXPORTS = \ 103@@ -205,6 +207,8 @@ HOST_EXPORTS = \
99 AR="$(AR)"; export AR; \ 104 AR="$(AR)"; export AR; \
100 AS="$(AS)"; export AS; \ 105 AS="$(AS)"; export AS; \
101 CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ 106 CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
@@ -103,8 +108,8 @@ Index: gcc-11.2.0/Makefile.tpl
103+ CPPFLAGS_FOR_BUILD="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS_FOR_BUILD; \ 108+ CPPFLAGS_FOR_BUILD="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS_FOR_BUILD; \
104 CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \ 109 CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \
105 DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ 110 DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
106 LD="$(LD)"; export LD; \ 111 DSYMUTIL="$(DSYMUTIL)"; export DSYMUTIL; \
107@@ -356,6 +360,8 @@ AR_FOR_BUILD = @AR_FOR_BUILD@ 112@@ -363,6 +367,8 @@ AR_FOR_BUILD = @AR_FOR_BUILD@
108 AS_FOR_BUILD = @AS_FOR_BUILD@ 113 AS_FOR_BUILD = @AS_FOR_BUILD@
109 CC_FOR_BUILD = @CC_FOR_BUILD@ 114 CC_FOR_BUILD = @CC_FOR_BUILD@
110 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ 115 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
@@ -113,11 +118,11 @@ Index: gcc-11.2.0/Makefile.tpl
113 CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@ 118 CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@
114 CXX_FOR_BUILD = @CXX_FOR_BUILD@ 119 CXX_FOR_BUILD = @CXX_FOR_BUILD@
115 DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@ 120 DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
116Index: gcc-11.2.0/configure 121diff --git a/configure b/configure
117=================================================================== 122index 45744e6e471..ff0de8a68b4 100755
118--- gcc-11.2.0.orig/configure 123--- a/configure
119+++ gcc-11.2.0/configure 124+++ b/configure
120@@ -652,6 +652,8 @@ GFORTRAN_FOR_BUILD 125@@ -655,6 +655,8 @@ DSYMUTIL_FOR_BUILD
121 DLLTOOL_FOR_BUILD 126 DLLTOOL_FOR_BUILD
122 CXX_FOR_BUILD 127 CXX_FOR_BUILD
123 CXXFLAGS_FOR_BUILD 128 CXXFLAGS_FOR_BUILD
@@ -126,15 +131,15 @@ Index: gcc-11.2.0/configure
126 CFLAGS_FOR_BUILD 131 CFLAGS_FOR_BUILD
127 CC_FOR_BUILD 132 CC_FOR_BUILD
128 AS_FOR_BUILD 133 AS_FOR_BUILD
129@@ -4092,6 +4094,7 @@ if test "${build}" != "${host}" ; then 134@@ -4100,6 +4102,7 @@ if test "${build}" != "${host}" ; then
130 AR_FOR_BUILD=${AR_FOR_BUILD-ar} 135 AR_FOR_BUILD=${AR_FOR_BUILD-ar}
131 AS_FOR_BUILD=${AS_FOR_BUILD-as} 136 AS_FOR_BUILD=${AS_FOR_BUILD-as}
132 CC_FOR_BUILD=${CC_FOR_BUILD-gcc} 137 CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
133+ CPP_FOR_BUILD="${CPP_FOR_BUILD-\$(CPP)}" 138+ CPP_FOR_BUILD="${CPP_FOR_BUILD-\$(CPP)}"
134 CXX_FOR_BUILD=${CXX_FOR_BUILD-g++} 139 CXX_FOR_BUILD=${CXX_FOR_BUILD-g++}
140 DSYMUTIL_FOR_BUILD=${DSYMUTIL_FOR_BUILD-dsymutil}
135 GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran} 141 GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran}
136 GOC_FOR_BUILD=${GOC_FOR_BUILD-gccgo} 142@@ -9831,6 +9834,7 @@ esac
137@@ -9809,6 +9812,7 @@ esac
138 # our build compiler if desired. 143 # our build compiler if desired.
139 if test x"${build}" = x"${host}" ; then 144 if test x"${build}" = x"${host}" ; then
140 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}} 145 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
@@ -142,19 +147,19 @@ Index: gcc-11.2.0/configure
142 CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}} 147 CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}}
143 LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}} 148 LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}}
144 fi 149 fi
145Index: gcc-11.2.0/configure.ac 150diff --git a/configure.ac b/configure.ac
146=================================================================== 151index bf66b51373c..09fa3896dc7 100644
147--- gcc-11.2.0.orig/configure.ac 152--- a/configure.ac
148+++ gcc-11.2.0/configure.ac 153+++ b/configure.ac
149@@ -1347,6 +1347,7 @@ if test "${build}" != "${host}" ; then 154@@ -1347,6 +1347,7 @@ if test "${build}" != "${host}" ; then
150 AR_FOR_BUILD=${AR_FOR_BUILD-ar} 155 AR_FOR_BUILD=${AR_FOR_BUILD-ar}
151 AS_FOR_BUILD=${AS_FOR_BUILD-as} 156 AS_FOR_BUILD=${AS_FOR_BUILD-as}
152 CC_FOR_BUILD=${CC_FOR_BUILD-gcc} 157 CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
153+ CPP_FOR_BUILD="${CPP_FOR_BUILD-\$(CPP)}" 158+ CPP_FOR_BUILD="${CPP_FOR_BUILD-\$(CPP)}"
154 CXX_FOR_BUILD=${CXX_FOR_BUILD-g++} 159 CXX_FOR_BUILD=${CXX_FOR_BUILD-g++}
160 DSYMUTIL_FOR_BUILD=${DSYMUTIL_FOR_BUILD-dsymutil}
155 GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran} 161 GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran}
156 GOC_FOR_BUILD=${GOC_FOR_BUILD-gccgo} 162@@ -3336,6 +3337,7 @@ esac
157@@ -3321,6 +3322,7 @@ esac
158 # our build compiler if desired. 163 # our build compiler if desired.
159 if test x"${build}" = x"${host}" ; then 164 if test x"${build}" = x"${host}" ; then
160 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}} 165 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
@@ -162,7 +167,7 @@ Index: gcc-11.2.0/configure.ac
162 CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}} 167 CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}}
163 LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}} 168 LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}}
164 fi 169 fi
165@@ -3387,6 +3389,8 @@ AC_SUBST(AR_FOR_BUILD) 170@@ -3402,6 +3404,8 @@ AC_SUBST(AR_FOR_BUILD)
166 AC_SUBST(AS_FOR_BUILD) 171 AC_SUBST(AS_FOR_BUILD)
167 AC_SUBST(CC_FOR_BUILD) 172 AC_SUBST(CC_FOR_BUILD)
168 AC_SUBST(CFLAGS_FOR_BUILD) 173 AC_SUBST(CFLAGS_FOR_BUILD)
@@ -171,11 +176,11 @@ Index: gcc-11.2.0/configure.ac
171 AC_SUBST(CXXFLAGS_FOR_BUILD) 176 AC_SUBST(CXXFLAGS_FOR_BUILD)
172 AC_SUBST(CXX_FOR_BUILD) 177 AC_SUBST(CXX_FOR_BUILD)
173 AC_SUBST(DLLTOOL_FOR_BUILD) 178 AC_SUBST(DLLTOOL_FOR_BUILD)
174Index: gcc-11.2.0/gcc/configure 179diff --git a/gcc/configure b/gcc/configure
175=================================================================== 180index ec3c24482df..31a460dc9d0 100755
176--- gcc-11.2.0.orig/gcc/configure 181--- a/gcc/configure
177+++ gcc-11.2.0/gcc/configure 182+++ b/gcc/configure
178@@ -12699,7 +12699,7 @@ else 183@@ -12740,7 +12740,7 @@ else
179 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ 184 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
180 CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \ 185 CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \
181 LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \ 186 LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \
@@ -184,11 +189,11 @@ Index: gcc-11.2.0/gcc/configure
184 ${realsrcdir}/configure \ 189 ${realsrcdir}/configure \
185 --enable-languages=${enable_languages-all} \ 190 --enable-languages=${enable_languages-all} \
186 ${enable_obsolete+--enable-obsolete="$enable_obsolete"} \ 191 ${enable_obsolete+--enable-obsolete="$enable_obsolete"} \
187Index: gcc-11.2.0/gcc/configure.ac 192diff --git a/gcc/configure.ac b/gcc/configure.ac
188=================================================================== 193index ea794cd1763..b965eb036bc 100644
189--- gcc-11.2.0.orig/gcc/configure.ac 194--- a/gcc/configure.ac
190+++ gcc-11.2.0/gcc/configure.ac 195+++ b/gcc/configure.ac
191@@ -2023,7 +2023,7 @@ else 196@@ -2054,7 +2054,7 @@ else
192 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ 197 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
193 CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \ 198 CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \
194 LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \ 199 LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \
diff --git a/meta/recipes-devtools/gcc/gcc/0006-If-CXXFLAGS-contains-something-unsupported-by-the-bu.patch b/meta/recipes-devtools/gcc/gcc/0016-If-CXXFLAGS-contains-something-unsupported-by-the-bu.patch
index 98a1bb2a66..7f807a991c 100644
--- a/meta/recipes-devtools/gcc/gcc/0006-If-CXXFLAGS-contains-something-unsupported-by-the-bu.patch
+++ b/meta/recipes-devtools/gcc/gcc/0016-If-CXXFLAGS-contains-something-unsupported-by-the-bu.patch
@@ -1,8 +1,8 @@
1From e700190743fa29ddaebd6ee075298a24b1688773 Mon Sep 17 00:00:00 2001 1From 2c2a92573598ddbc33c023fe5d499191491fb523 Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org> 2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Thu, 28 Oct 2021 11:33:40 +0100 3Date: Thu, 28 Oct 2021 11:33:40 +0100
4Subject: [PATCH 6/6] If CXXFLAGS contains something unsupported by the build 4Subject: [PATCH] If CXXFLAGS contains something unsupported by the build CXX,
5 CXX, we see build failures (e.g. using -fmacro-prefix-map for the target). 5 we see build failures (e.g. using -fmacro-prefix-map for the target).
6 6
7Pass CXXFLAGS_FOR_BUILD in a couple of places to avoid these errors. 7Pass CXXFLAGS_FOR_BUILD in a couple of places to avoid these errors.
8 8
@@ -13,19 +13,20 @@ ChangeLog:
13 * Makefile.in: Regenerate. 13 * Makefile.in: Regenerate.
14 * Makefile.tpl: Add missing CXXFLAGS_FOR_BUILD overrides 14 * Makefile.tpl: Add missing CXXFLAGS_FOR_BUILD overrides
15 15
16Upstream-Status: Pending [should be submittable]
17
16Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> 18Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
19Signed-off-by: Khem Raj <raj.khem@gmail.com>
17--- 20---
18 Makefile.in | 2 ++ 21 Makefile.in | 2 ++
19 Makefile.tpl | 2 ++ 22 Makefile.tpl | 2 ++
20 2 files changed, 4 insertions(+) 23 2 files changed, 4 insertions(+)
21 24
22Upstream-Status: Pending [should be submittable] 25diff --git a/Makefile.in b/Makefile.in
23 26index 33476d53327..b949dffee0e 100644
24Index: gcc-11.2.0/Makefile.in 27--- a/Makefile.in
25=================================================================== 28+++ b/Makefile.in
26--- gcc-11.2.0.orig/Makefile.in 29@@ -176,6 +176,7 @@ BUILD_EXPORTS = \
27+++ gcc-11.2.0/Makefile.in
28@@ -172,6 +172,7 @@ BUILD_EXPORTS = \
29 # built for the build system to override those in BASE_FLAGS_TO_PASS. 30 # built for the build system to override those in BASE_FLAGS_TO_PASS.
30 EXTRA_BUILD_FLAGS = \ 31 EXTRA_BUILD_FLAGS = \
31 CFLAGS="$(CFLAGS_FOR_BUILD)" \ 32 CFLAGS="$(CFLAGS_FOR_BUILD)" \
@@ -33,19 +34,19 @@ Index: gcc-11.2.0/Makefile.in
33 LDFLAGS="$(LDFLAGS_FOR_BUILD)" 34 LDFLAGS="$(LDFLAGS_FOR_BUILD)"
34 35
35 # This is the list of directories to built for the host system. 36 # This is the list of directories to built for the host system.
36@@ -203,6 +204,7 @@ HOST_EXPORTS = \ 37@@ -207,6 +208,7 @@ HOST_EXPORTS = \
37 CPP_FOR_BUILD="$(CPP_FOR_BUILD)"; export CPP_FOR_BUILD; \ 38 CPP_FOR_BUILD="$(CPP_FOR_BUILD)"; export CPP_FOR_BUILD; \
38 CPPFLAGS_FOR_BUILD="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS_FOR_BUILD; \ 39 CPPFLAGS_FOR_BUILD="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS_FOR_BUILD; \
39 CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \ 40 CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \
40+ CXXFLAGS_FOR_BUILD="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS_FOR_BUILD; \ 41+ CXXFLAGS_FOR_BUILD="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS_FOR_BUILD; \
41 DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ 42 DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
43 DSYMUTIL="$(DSYMUTIL)"; export DSYMUTIL; \
42 LD="$(LD)"; export LD; \ 44 LD="$(LD)"; export LD; \
43 LDFLAGS="$(STAGE1_LDFLAGS) $(LDFLAGS)"; export LDFLAGS; \ 45diff --git a/Makefile.tpl b/Makefile.tpl
44Index: gcc-11.2.0/Makefile.tpl 46index e39d85d1109..d8520cbb164 100644
45=================================================================== 47--- a/Makefile.tpl
46--- gcc-11.2.0.orig/Makefile.tpl 48+++ b/Makefile.tpl
47+++ gcc-11.2.0/Makefile.tpl 49@@ -179,6 +179,7 @@ BUILD_EXPORTS = \
48@@ -175,6 +175,7 @@ BUILD_EXPORTS = \
49 # built for the build system to override those in BASE_FLAGS_TO_PASS. 50 # built for the build system to override those in BASE_FLAGS_TO_PASS.
50 EXTRA_BUILD_FLAGS = \ 51 EXTRA_BUILD_FLAGS = \
51 CFLAGS="$(CFLAGS_FOR_BUILD)" \ 52 CFLAGS="$(CFLAGS_FOR_BUILD)" \
@@ -53,11 +54,11 @@ Index: gcc-11.2.0/Makefile.tpl
53 LDFLAGS="$(LDFLAGS_FOR_BUILD)" 54 LDFLAGS="$(LDFLAGS_FOR_BUILD)"
54 55
55 # This is the list of directories to built for the host system. 56 # This is the list of directories to built for the host system.
56@@ -206,6 +207,7 @@ HOST_EXPORTS = \ 57@@ -210,6 +211,7 @@ HOST_EXPORTS = \
57 CPP_FOR_BUILD="$(CPP_FOR_BUILD)"; export CPP_FOR_BUILD; \ 58 CPP_FOR_BUILD="$(CPP_FOR_BUILD)"; export CPP_FOR_BUILD; \
58 CPPFLAGS_FOR_BUILD="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS_FOR_BUILD; \ 59 CPPFLAGS_FOR_BUILD="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS_FOR_BUILD; \
59 CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \ 60 CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \
60+ CXXFLAGS_FOR_BUILD="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS_FOR_BUILD; \ 61+ CXXFLAGS_FOR_BUILD="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS_FOR_BUILD; \
61 DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ 62 DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
63 DSYMUTIL="$(DSYMUTIL)"; export DSYMUTIL; \
62 LD="$(LD)"; export LD; \ 64 LD="$(LD)"; export LD; \
63 LDFLAGS="$(STAGE1_LDFLAGS) $(LDFLAGS)"; export LDFLAGS; \
diff --git a/meta/recipes-devtools/gcc/gcc/0024-handle-sysroot-support-for-nativesdk-gcc.patch b/meta/recipes-devtools/gcc/gcc/0017-handle-sysroot-support-for-nativesdk-gcc.patch
index b1054fa749..5d86e4c12d 100644
--- a/meta/recipes-devtools/gcc/gcc/0024-handle-sysroot-support-for-nativesdk-gcc.patch
+++ b/meta/recipes-devtools/gcc/gcc/0017-handle-sysroot-support-for-nativesdk-gcc.patch
@@ -1,4 +1,4 @@
1From 354682ad8f71f62643dcd83f64b51b5979615a0c Mon Sep 17 00:00:00 2001 1From 68802ca536b01ab21cfa58e11ef332e30d9a3c5e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 7 Dec 2015 23:39:54 +0000 3Date: Mon, 7 Dec 2015 23:39:54 +0000
4Subject: [PATCH] handle sysroot support for nativesdk-gcc 4Subject: [PATCH] handle sysroot support for nativesdk-gcc
@@ -46,10 +46,10 @@ Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
46 8 files changed, 94 insertions(+), 72 deletions(-) 46 8 files changed, 94 insertions(+), 72 deletions(-)
47 47
48diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c 48diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
49index 89e05a4c551..5577383665d 100644 49index 6f001e0bb6c..55ab07c278f 100644
50--- a/gcc/c-family/c-opts.c 50--- a/gcc/c-family/c-opts.c
51+++ b/gcc/c-family/c-opts.c 51+++ b/gcc/c-family/c-opts.c
52@@ -1436,8 +1436,8 @@ add_prefixed_path (const char *suffix, incpath_kind chain) 52@@ -1438,8 +1438,8 @@ add_prefixed_path (const char *suffix, incpath_kind chain)
53 size_t prefix_len, suffix_len; 53 size_t prefix_len, suffix_len;
54 54
55 suffix_len = strlen (suffix); 55 suffix_len = strlen (suffix);
@@ -378,7 +378,7 @@ index fd3c655db1c..20669ac427d 100644
378 subdirectory of the actual installation. */ 378 subdirectory of the actual installation. */
379 extern const char *gcc_exec_prefix; 379 extern const char *gcc_exec_prefix;
380diff --git a/gcc/gcc.c b/gcc/gcc.c 380diff --git a/gcc/gcc.c b/gcc/gcc.c
381index 8737bae5353..aa6fbe43965 100644 381index bdee2671532..36e8af38630 100644
382--- a/gcc/gcc.c 382--- a/gcc/gcc.c
383+++ b/gcc/gcc.c 383+++ b/gcc/gcc.c
384@@ -252,6 +252,8 @@ FILE *report_times_to_file = NULL; 384@@ -252,6 +252,8 @@ FILE *report_times_to_file = NULL;
@@ -398,7 +398,7 @@ index 8737bae5353..aa6fbe43965 100644
398 %S process STARTFILE_SPEC as a spec. A capital S is actually used here. 398 %S process STARTFILE_SPEC as a spec. A capital S is actually used here.
399 %E process ENDFILE_SPEC as a spec. A capital E is actually used here. 399 %E process ENDFILE_SPEC as a spec. A capital E is actually used here.
400 %C process CPP_SPEC as a spec. 400 %C process CPP_SPEC as a spec.
401@@ -1621,10 +1624,10 @@ static const char *gcc_libexec_prefix; 401@@ -1620,10 +1623,10 @@ static const char *gcc_libexec_prefix;
402 gcc_exec_prefix is set because, in that case, we know where the 402 gcc_exec_prefix is set because, in that case, we know where the
403 compiler has been installed, and use paths relative to that 403 compiler has been installed, and use paths relative to that
404 location instead. */ 404 location instead. */
@@ -413,7 +413,7 @@ index 8737bae5353..aa6fbe43965 100644
413 413
414 /* For native compilers, these are well-known paths containing 414 /* For native compilers, these are well-known paths containing
415 components that may be provided by the system. For cross 415 components that may be provided by the system. For cross
416@@ -1632,9 +1635,9 @@ static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX; 416@@ -1631,9 +1634,9 @@ static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
417 static const char *md_exec_prefix = MD_EXEC_PREFIX; 417 static const char *md_exec_prefix = MD_EXEC_PREFIX;
418 static const char *md_startfile_prefix = MD_STARTFILE_PREFIX; 418 static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
419 static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1; 419 static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
@@ -425,7 +425,7 @@ index 8737bae5353..aa6fbe43965 100644
425 = STANDARD_STARTFILE_PREFIX_2; 425 = STANDARD_STARTFILE_PREFIX_2;
426 426
427 /* A relative path to be used in finding the location of tools 427 /* A relative path to be used in finding the location of tools
428@@ -6564,6 +6567,11 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part) 428@@ -6570,6 +6573,11 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
429 } 429 }
430 break; 430 break;
431 431
diff --git a/meta/recipes-devtools/gcc/gcc/0025-Search-target-sysroot-gcc-version-specific-dirs-with.patch b/meta/recipes-devtools/gcc/gcc/0018-Search-target-sysroot-gcc-version-specific-dirs-with.patch
index ff622b1056..0f43e985cf 100644
--- a/meta/recipes-devtools/gcc/gcc/0025-Search-target-sysroot-gcc-version-specific-dirs-with.patch
+++ b/meta/recipes-devtools/gcc/gcc/0018-Search-target-sysroot-gcc-version-specific-dirs-with.patch
@@ -1,4 +1,4 @@
1From c55e24459370ad96577496ecd87475e3a9de7dad Mon Sep 17 00:00:00 2001 1From 14291076874b133e7fb67ef1714b768a2c48ea44 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 7 Dec 2015 23:41:45 +0000 3Date: Mon, 7 Dec 2015 23:41:45 +0000
4Subject: [PATCH] Search target sysroot gcc version specific dirs with 4Subject: [PATCH] Search target sysroot gcc version specific dirs with
@@ -51,10 +51,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
51 1 file changed, 28 insertions(+), 1 deletion(-) 51 1 file changed, 28 insertions(+), 1 deletion(-)
52 52
53diff --git a/gcc/gcc.c b/gcc/gcc.c 53diff --git a/gcc/gcc.c b/gcc/gcc.c
54index aa6fbe43965..f8a71a13826 100644 54index 36e8af38630..d1faa788d60 100644
55--- a/gcc/gcc.c 55--- a/gcc/gcc.c
56+++ b/gcc/gcc.c 56+++ b/gcc/gcc.c
57@@ -2811,7 +2811,7 @@ for_each_path (const struct path_prefix *paths, 57@@ -2810,7 +2810,7 @@ for_each_path (const struct path_prefix *paths,
58 if (path == NULL) 58 if (path == NULL)
59 { 59 {
60 len = paths->max_len + extra_space + 1; 60 len = paths->max_len + extra_space + 1;
@@ -63,7 +63,7 @@ index aa6fbe43965..f8a71a13826 100644
63 path = XNEWVEC (char, len); 63 path = XNEWVEC (char, len);
64 } 64 }
65 65
66@@ -2823,6 +2823,33 @@ for_each_path (const struct path_prefix *paths, 66@@ -2822,6 +2822,33 @@ for_each_path (const struct path_prefix *paths,
67 /* Look first in MACHINE/VERSION subdirectory. */ 67 /* Look first in MACHINE/VERSION subdirectory. */
68 if (!skip_multi_dir) 68 if (!skip_multi_dir)
69 { 69 {
diff --git a/meta/recipes-devtools/gcc/gcc/0019-nios2-Define-MUSL_DYNAMIC_LINKER.patch b/meta/recipes-devtools/gcc/gcc/0019-nios2-Define-MUSL_DYNAMIC_LINKER.patch
new file mode 100644
index 0000000000..76ebfd7f77
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/0019-nios2-Define-MUSL_DYNAMIC_LINKER.patch
@@ -0,0 +1,25 @@
1From 9ec4db8e910d9a51ae43f6b20d4bf1dac2d8cca8 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] nios2: Define MUSL_DYNAMIC_LINKER
5
6Upstream-Status: Backport [https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=e5ddbbf992b909d8e38851bd3179d29389e6ac97]
7
8Signed-off-by: Marek Vasut <marex@denx.de>
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
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 08edf1521f6..15696d86241 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 \
diff --git a/meta/recipes-devtools/gcc/gcc/0028-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch b/meta/recipes-devtools/gcc/gcc/0020-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch
index 9c616d24d0..b82fa44537 100644
--- a/meta/recipes-devtools/gcc/gcc/0028-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch
+++ b/meta/recipes-devtools/gcc/gcc/0020-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch
@@ -1,4 +1,4 @@
1From 745a2ac7825c73102b888226c54397d21512f86b Mon Sep 17 00:00:00 2001 1From af72a47a677ce98c08cb73444bdd741ca8e28422 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 27 Jun 2017 18:10:54 -0700 3Date: Tue, 27 Jun 2017 18:10:54 -0700
4Subject: [PATCH] Add ssp_nonshared to link commandline for musl targets 4Subject: [PATCH] Add ssp_nonshared to link commandline for musl targets
@@ -22,9 +22,11 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
22 gcc/config/rs6000/linux64.h | 10 ++++++++++ 22 gcc/config/rs6000/linux64.h | 10 ++++++++++
23 3 files changed, 27 insertions(+) 23 3 files changed, 27 insertions(+)
24 24
25diff --git a/gcc/config/linux.h b/gcc/config/linux.h
26index ba02c013e30..8fcaa0c9faf 100644
25--- a/gcc/config/linux.h 27--- a/gcc/config/linux.h
26+++ b/gcc/config/linux.h 28+++ b/gcc/config/linux.h
27@@ -203,6 +203,13 @@ see the files COPYING3 and COPYING.RUNTI 29@@ -203,6 +203,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
28 { GCC_INCLUDE_DIRVAR, "GCC", 0, 1, 0, 0 }, \ 30 { GCC_INCLUDE_DIRVAR, "GCC", 0, 1, 0, 0 }, \
29 { 0, 0, 0, 0, 0, 0 } \ 31 { 0, 0, 0, 0, 0, 0 } \
30 } 32 }
@@ -38,6 +40,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
38 #endif 40 #endif
39 41
40 #if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */ 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 47c9d9ac0b6..d065f88b377 100644
41--- a/gcc/config/rs6000/linux.h 45--- a/gcc/config/rs6000/linux.h
42+++ b/gcc/config/rs6000/linux.h 46+++ b/gcc/config/rs6000/linux.h
43@@ -94,6 +94,16 @@ 47@@ -94,6 +94,16 @@
@@ -57,6 +61,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
57 #undef LINK_OS_LINUX_SPEC 61 #undef LINK_OS_LINUX_SPEC
58 #define LINK_OS_LINUX_SPEC LINK_OS_LINUX_EMUL " %{!shared: %{!static: \ 62 #define LINK_OS_LINUX_SPEC LINK_OS_LINUX_EMUL " %{!shared: %{!static: \
59 %{!static-pie: \ 63 %{!static-pie: \
64diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
65index a11e01faa3d..ce464f3626b 100644
60--- a/gcc/config/rs6000/linux64.h 66--- a/gcc/config/rs6000/linux64.h
61+++ b/gcc/config/rs6000/linux64.h 67+++ b/gcc/config/rs6000/linux64.h
62@@ -369,6 +369,16 @@ extern int dot_symbols; 68@@ -369,6 +369,16 @@ extern int dot_symbols;
diff --git a/meta/recipes-devtools/gcc/gcc/0029-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch b/meta/recipes-devtools/gcc/gcc/0021-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch
index b74aeb8bb6..9b7c5c5642 100644
--- a/meta/recipes-devtools/gcc/gcc/0029-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch
+++ b/meta/recipes-devtools/gcc/gcc/0021-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch
@@ -1,4 +1,4 @@
1From 695adb4dffb23c6f5cbc757e05cf4187a2bd6528 Mon Sep 17 00:00:00 2001 1From 79a568dec47baa264eb6290fed3df3244450a92e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 4 May 2016 21:11:34 -0700 3Date: Wed, 4 May 2016 21:11:34 -0700
4Subject: [PATCH] Link libgcc using LDFLAGS, not just SHLIB_LDFLAGS 4Subject: [PATCH] Link libgcc using LDFLAGS, not just SHLIB_LDFLAGS
diff --git a/meta/recipes-devtools/gcc/gcc/0030-sync-gcc-stddef.h-with-musl.patch b/meta/recipes-devtools/gcc/gcc/0022-sync-gcc-stddef.h-with-musl.patch
index fd7d604e98..86fb22ffd3 100644
--- a/meta/recipes-devtools/gcc/gcc/0030-sync-gcc-stddef.h-with-musl.patch
+++ b/meta/recipes-devtools/gcc/gcc/0022-sync-gcc-stddef.h-with-musl.patch
@@ -1,4 +1,4 @@
1From a9173429ae256c4b4a3ab4d758a6adf42f8c4239 Mon Sep 17 00:00:00 2001 1From 07a06aa8e8285c1bb06d0bebeaa9ad04eb76f2e2 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 3 Feb 2017 12:56:00 -0800 3Date: Fri, 3 Feb 2017 12:56:00 -0800
4Subject: [PATCH] sync gcc stddef.h with musl 4Subject: [PATCH] sync gcc stddef.h with musl
diff --git a/meta/recipes-devtools/gcc/gcc/0033-Re-introduce-spe-commandline-options.patch b/meta/recipes-devtools/gcc/gcc/0023-Re-introduce-spe-commandline-options.patch
index 129f555a48..23cf02a6e4 100644
--- a/meta/recipes-devtools/gcc/gcc/0033-Re-introduce-spe-commandline-options.patch
+++ b/meta/recipes-devtools/gcc/gcc/0023-Re-introduce-spe-commandline-options.patch
@@ -1,4 +1,4 @@
1From 0b900d6410b7c1938e86eceb87b032fd538566a9 Mon Sep 17 00:00:00 2001 1From ca73043041c3c7aa86af9a3d4f316abc87eb3254 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 6 Jun 2018 12:10:22 -0700 3Date: Wed, 6 Jun 2018 12:10:22 -0700
4Subject: [PATCH] Re-introduce spe commandline options 4Subject: [PATCH] Re-introduce spe commandline options
@@ -14,7 +14,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 1 file changed, 13 insertions(+) 14 1 file changed, 13 insertions(+)
15 15
16diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt 16diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
17index 0dbdf753673..b273eb65c35 100644 17index 6b0a3e27529..1bd2e356ac9 100644
18--- a/gcc/config/rs6000/rs6000.opt 18--- a/gcc/config/rs6000/rs6000.opt
19+++ b/gcc/config/rs6000/rs6000.opt 19+++ b/gcc/config/rs6000/rs6000.opt
20@@ -352,6 +352,19 @@ mdebug= 20@@ -352,6 +352,19 @@ mdebug=
diff --git a/meta/recipes-devtools/gcc/gcc/0034-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch b/meta/recipes-devtools/gcc/gcc/0024-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch
index 3f666dc7bd..f915f284ea 100644
--- a/meta/recipes-devtools/gcc/gcc/0034-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch
+++ b/meta/recipes-devtools/gcc/gcc/0024-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch
@@ -1,4 +1,4 @@
1From ea9154338cb3acbd75945fddde4202e73c20dd1a Mon Sep 17 00:00:00 2001 1From b3957bc1fd52ec427a1b71b10055905cab4bbc7c Mon Sep 17 00:00:00 2001
2From: Szabolcs Nagy <nsz@port70.net> 2From: Szabolcs Nagy <nsz@port70.net>
3Date: Sat, 24 Oct 2015 20:09:53 +0000 3Date: Sat, 24 Oct 2015 20:09:53 +0000
4Subject: [PATCH] libgcc_s: Use alias for __cpu_indicator_init instead of 4Subject: [PATCH] libgcc_s: Use alias for __cpu_indicator_init instead of
@@ -39,10 +39,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
39 3 files changed, 6 insertions(+), 6 deletions(-) 39 3 files changed, 6 insertions(+), 6 deletions(-)
40 40
41diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c 41diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
42index ac69eed4d32..ffaa44a16fc 100644 42index 31eae75d277..ec7e858ec83 100644
43--- a/gcc/config/i386/i386-expand.c 43--- a/gcc/config/i386/i386-expand.c
44+++ b/gcc/config/i386/i386-expand.c 44+++ b/gcc/config/i386/i386-expand.c
45@@ -11038,10 +11038,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, 45@@ -11066,10 +11066,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
46 { 46 {
47 case IX86_BUILTIN_CPU_INIT: 47 case IX86_BUILTIN_CPU_INIT:
48 { 48 {
diff --git a/meta/recipes-devtools/gcc/gcc/0035-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch b/meta/recipes-devtools/gcc/gcc/0025-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch
index 874cd7798d..f33193ebcf 100644
--- a/meta/recipes-devtools/gcc/gcc/0035-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch
+++ b/meta/recipes-devtools/gcc/gcc/0025-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch
@@ -1,4 +1,4 @@
1From 520411cf364ee4b0b5a8f0857498aaabd790afb3 Mon Sep 17 00:00:00 2001 1From 5fd90d243ae14034a4699443110070dafc0d4d30 Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org> 2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Tue, 10 Mar 2020 08:26:53 -0700 3Date: Tue, 10 Mar 2020 08:26:53 -0700
4Subject: [PATCH] gentypes/genmodes: Do not use __LINE__ for maintaining 4Subject: [PATCH] gentypes/genmodes: Do not use __LINE__ for maintaining
@@ -17,7 +17,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
17 2 files changed, 19 insertions(+), 19 deletions(-) 17 2 files changed, 19 insertions(+), 19 deletions(-)
18 18
19diff --git a/gcc/gengtype.c b/gcc/gengtype.c 19diff --git a/gcc/gengtype.c b/gcc/gengtype.c
20index 5f50242e857..cbaca9b8cd0 100644 20index 98d4626f87e..f602da8b501 100644
21--- a/gcc/gengtype.c 21--- a/gcc/gengtype.c
22+++ b/gcc/gengtype.c 22+++ b/gcc/gengtype.c
23@@ -991,7 +991,7 @@ create_field_at (pair_p next, type_p type, const char *name, options_p opt, 23@@ -991,7 +991,7 @@ create_field_at (pair_p next, type_p type, const char *name, options_p opt,
diff --git a/meta/recipes-devtools/gcc/gcc/0036-mingw32-Enable-operation_not_supported.patch b/meta/recipes-devtools/gcc/gcc/0026-mingw32-Enable-operation_not_supported.patch
index 3a7618c820..b46bde1eda 100644
--- a/meta/recipes-devtools/gcc/gcc/0036-mingw32-Enable-operation_not_supported.patch
+++ b/meta/recipes-devtools/gcc/gcc/0026-mingw32-Enable-operation_not_supported.patch
@@ -1,4 +1,4 @@
1From 96d895c8d5dc895d24fe37aa2b4f201a2566b4cc Mon Sep 17 00:00:00 2001 1From 7bc34769f0b055e25286576e4ba6d211e8159834 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 12 May 2020 10:39:09 -0700 3Date: Tue, 12 May 2020 10:39:09 -0700
4Subject: [PATCH] mingw32: Enable operation_not_supported 4Subject: [PATCH] mingw32: Enable operation_not_supported
diff --git a/meta/recipes-devtools/gcc/gcc/0037-libatomic-Do-not-enforce-march-on-aarch64.patch b/meta/recipes-devtools/gcc/gcc/0027-libatomic-Do-not-enforce-march-on-aarch64.patch
index 4c9a79cb64..85b1251482 100644
--- a/meta/recipes-devtools/gcc/gcc/0037-libatomic-Do-not-enforce-march-on-aarch64.patch
+++ b/meta/recipes-devtools/gcc/gcc/0027-libatomic-Do-not-enforce-march-on-aarch64.patch
@@ -1,4 +1,4 @@
1From 36d4fdbc99e69f9d70a29e2bada40cc3c1534557 Mon Sep 17 00:00:00 2001 1From df1c63bbd7a520e8c6d0d0692b4d8bff56952394 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 13 May 2020 15:10:38 -0700 3Date: Wed, 13 May 2020 15:10:38 -0700
4Subject: [PATCH] libatomic: Do not enforce march on aarch64 4Subject: [PATCH] libatomic: Do not enforce march on aarch64
@@ -17,7 +17,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
17 2 files changed, 2 deletions(-) 17 2 files changed, 2 deletions(-)
18 18
19diff --git a/libatomic/Makefile.am b/libatomic/Makefile.am 19diff --git a/libatomic/Makefile.am b/libatomic/Makefile.am
20index 0f3cd6f7121..c8124c1d5aa 100644 20index ab8c2da24a1..f614a46b34d 100644
21--- a/libatomic/Makefile.am 21--- a/libatomic/Makefile.am
22+++ b/libatomic/Makefile.am 22+++ b/libatomic/Makefile.am
23@@ -125,7 +125,6 @@ libatomic_la_LIBADD = $(foreach s,$(SIZES),$(addsuffix _$(s)_.lo,$(SIZEOBJS))) 23@@ -125,7 +125,6 @@ libatomic_la_LIBADD = $(foreach s,$(SIZES),$(addsuffix _$(s)_.lo,$(SIZEOBJS)))
@@ -29,14 +29,14 @@ index 0f3cd6f7121..c8124c1d5aa 100644
29 endif 29 endif
30 if ARCH_ARM_LINUX 30 if ARCH_ARM_LINUX
31diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in 31diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in
32index 0a51bd55f01..6d5b1581706 100644 32index 80d25653dc7..7377689ab34 100644
33--- a/libatomic/Makefile.in 33--- a/libatomic/Makefile.in
34+++ b/libatomic/Makefile.in 34+++ b/libatomic/Makefile.in
35@@ -432,7 +432,6 @@ M_SRC = $(firstword $(filter %/$(M_FILE), $(all_c_files))) 35@@ -434,7 +434,6 @@ M_SRC = $(firstword $(filter %/$(M_FILE), $(all_c_files)))
36 libatomic_la_LIBADD = $(foreach s,$(SIZES),$(addsuffix \ 36 libatomic_la_LIBADD = $(foreach s,$(SIZES),$(addsuffix \
37 _$(s)_.lo,$(SIZEOBJS))) $(am__append_1) $(am__append_2) \ 37 _$(s)_.lo,$(SIZEOBJS))) $(am__append_1) $(am__append_2) \
38 $(am__append_3) $(am__append_4) 38 $(am__append_3) $(am__append_4)
39-@ARCH_AARCH64_LINUX_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=armv8-a+lse 39-@ARCH_AARCH64_LINUX_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=armv8-a+lse
40 @ARCH_ARM_LINUX_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=armv7-a+fp -DHAVE_KERNEL64 40 @ARCH_ARM_LINUX_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=armv7-a+fp -DHAVE_KERNEL64
41 @ARCH_I386_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=i586 41 @ARCH_I386_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=i586
42 @ARCH_X86_64_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -mcx16 42 @ARCH_X86_64_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -mcx16 -mcx16
diff --git a/meta/recipes-devtools/gcc/gcc/0027-nios2-Define-MUSL_DYNAMIC_LINKER.patch b/meta/recipes-devtools/gcc/gcc/0027-nios2-Define-MUSL_DYNAMIC_LINKER.patch
deleted file mode 100644
index 97c271373b..0000000000
--- a/meta/recipes-devtools/gcc/gcc/0027-nios2-Define-MUSL_DYNAMIC_LINKER.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1From: Richard Purdie <richard.purdie@linuxfoundation.org>
2Subject: [PATCH 4/5] gcc/nios2: Define the musl linker
3
4Add a definition of the musl linker used on the nios2 platform.
5
62021-10-26 Richard Purdie <richard.purdie@linuxfoundation.org>
7
8gcc/ChangeLog:
9
10 * config/nios2/linux.h (MUSL_DYNAMIC_LINKER): Add musl linker
11
12Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
13
14Submitted [https://gcc.gnu.org/pipermail/gcc-patches/2021-October/582723.html]
15Upstream-Status: Backport [https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=e5ddbbf992b909d8e38851bd3179d29389e6ac97]
16---
17 gcc/config/nios2/linux.h | 1 +
18 1 file changed, 1 insertion(+)
19
20Index: gcc-11.2.0/gcc/config/nios2/linux.h
21===================================================================
22--- gcc-11.2.0.orig/gcc/config/nios2/linux.h
23+++ gcc-11.2.0/gcc/config/nios2/linux.h
24@@ -30,6 +30,7 @@
25 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
26
27 #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-nios2.so.1"
28+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-nios2.so.1"
29
30 #undef LINK_SPEC
31 #define LINK_SPEC LINK_SPEC_ENDIAN \
diff --git a/meta/recipes-devtools/gcc/gcc/0041-apply-debug-prefix-maps-before-checksumming-DIEs.patch b/meta/recipes-devtools/gcc/gcc/0028-debug-101473-apply-debug-prefix-maps-before-checksum.patch
index c8dcd74b9d..de06793482 100644
--- a/meta/recipes-devtools/gcc/gcc/0041-apply-debug-prefix-maps-before-checksumming-DIEs.patch
+++ b/meta/recipes-devtools/gcc/gcc/0028-debug-101473-apply-debug-prefix-maps-before-checksum.patch
@@ -1,7 +1,8 @@
1From 7cc2df084b7977653a9b59cbc34a9ad500ae619c Mon Sep 17 00:00:00 2001 1From 49008eeedc97014f44e12afe179d3785e4438372 Mon Sep 17 00:00:00 2001
2From: Richard Biener <rguenther@suse.de> 2From: Richard Biener <rguenther@suse.de>
3Date: Tue, 20 Jul 2021 11:00:33 +0200 3Date: Tue, 20 Jul 2021 11:00:33 +0200
4Subject: [PATCH] debug/101473 - apply debug prefix maps before checksumming DIEs 4Subject: [PATCH] debug/101473 - apply debug prefix maps before checksumming
5 DIEs
5 6
6The following makes sure to apply the debug prefix maps to filenames 7The following makes sure to apply the debug prefix maps to filenames
7before checksumming DIEs to create the global symbol for the CU DIE 8before checksumming DIEs to create the global symbol for the CU DIE
@@ -36,10 +37,15 @@ The upstream patch was modified to compensate for the definition of
36this version of gcc. 37this version of gcc.
37 38
38Signed-off-by: Tony Battersby <tonyb@cybernetics.com> 39Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
40Signed-off-by: Khem Raj <raj.khem@gmail.com>
39--- 41---
40diff -urpN a/gcc/dwarf2out.c b/gcc/dwarf2out.c 42 gcc/dwarf2out.c | 13 +++++++------
41--- a/gcc/dwarf2out.c 2021-04-27 06:00:13.000000000 -0400 43 1 file changed, 7 insertions(+), 6 deletions(-)
42+++ b/gcc/dwarf2out.c 2021-07-23 16:40:06.141886167 -0400 44
45diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
46index e5d3ce4966d..41ac3008507 100644
47--- a/gcc/dwarf2out.c
48+++ b/gcc/dwarf2out.c
43@@ -1283,6 +1283,7 @@ dwarf2out_switch_text_section (void) 49@@ -1283,6 +1283,7 @@ dwarf2out_switch_text_section (void)
44 50
45 /* Data about a single source file. */ 51 /* Data about a single source file. */
@@ -48,7 +54,7 @@ diff -urpN a/gcc/dwarf2out.c b/gcc/dwarf2out.c
48 const char * filename; 54 const char * filename;
49 int emitted_number; 55 int emitted_number;
50 }; 56 };
51@@ -12334,7 +12335,7 @@ file_name_acquire (dwarf_file_data **slo 57@@ -12335,7 +12336,7 @@ file_name_acquire (dwarf_file_data **slot, file_name_acquire_data *fnad)
52 58
53 fi = fnad->files + fnad->used_files++; 59 fi = fnad->files + fnad->used_files++;
54 60
@@ -57,7 +63,7 @@ diff -urpN a/gcc/dwarf2out.c b/gcc/dwarf2out.c
57 63
58 /* Skip all leading "./". */ 64 /* Skip all leading "./". */
59 while (f[0] == '.' && IS_DIR_SEPARATOR (f[1])) 65 while (f[0] == '.' && IS_DIR_SEPARATOR (f[1]))
60@@ -27231,13 +27232,13 @@ dwarf2out_ignore_block (const_tree block 66@@ -27259,13 +27260,13 @@ dwarf2out_ignore_block (const_tree block)
61 bool 67 bool
62 dwarf_file_hasher::equal (dwarf_file_data *p1, const char *p2) 68 dwarf_file_hasher::equal (dwarf_file_data *p1, const char *p2)
63 { 69 {
@@ -73,7 +79,7 @@ diff -urpN a/gcc/dwarf2out.c b/gcc/dwarf2out.c
73 } 79 }
74 80
75 /* Lookup FILE_NAME (in the list of filenames that we know about here in 81 /* Lookup FILE_NAME (in the list of filenames that we know about here in
76@@ -27267,7 +27268,8 @@ lookup_filename (const char *file_name) 82@@ -27295,7 +27296,8 @@ lookup_filename (const char *file_name)
77 return *slot; 83 return *slot;
78 84
79 created = ggc_alloc<dwarf_file_data> (); 85 created = ggc_alloc<dwarf_file_data> ();
@@ -83,7 +89,7 @@ diff -urpN a/gcc/dwarf2out.c b/gcc/dwarf2out.c
83 created->emitted_number = 0; 89 created->emitted_number = 0;
84 *slot = created; 90 *slot = created;
85 return created; 91 return created;
86@@ -27293,8 +27295,7 @@ maybe_emit_file (struct dwarf_file_data 92@@ -27321,8 +27323,7 @@ maybe_emit_file (struct dwarf_file_data * fd)
87 if (output_asm_line_debug_info ()) 93 if (output_asm_line_debug_info ())
88 { 94 {
89 fprintf (asm_out_file, "\t.file %u ", fd->emitted_number); 95 fprintf (asm_out_file, "\t.file %u ", fd->emitted_number);
diff --git a/meta/recipes-devtools/gcc/gcc/0001-Fix-install-path-of-linux64.h.patch b/meta/recipes-devtools/gcc/gcc/0029-Fix-install-path-of-linux64.h.patch
index 5bf895d6e7..d7e156e7a3 100644
--- a/meta/recipes-devtools/gcc/gcc/0001-Fix-install-path-of-linux64.h.patch
+++ b/meta/recipes-devtools/gcc/gcc/0029-Fix-install-path-of-linux64.h.patch
@@ -1,4 +1,4 @@
1From 58211c7ceb0510b2a11a7f1da3c7fa968c658749 Mon Sep 17 00:00:00 2001 1From 8a62cc0a64670e39f462c1dbbf82e04d2f03b89e Mon Sep 17 00:00:00 2001
2From: Andrei Gherzan <andrei.gherzan@huawei.com> 2From: Andrei Gherzan <andrei.gherzan@huawei.com>
3Date: Wed, 22 Dec 2021 12:49:25 +0100 3Date: Wed, 22 Dec 2021 12:49:25 +0100
4Subject: [PATCH] Fix install path of linux64.h 4Subject: [PATCH] Fix install path of linux64.h
@@ -11,15 +11,16 @@ adapts the install path of linux64.h to match the include in tm.h.
11Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com> 11Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
12 12
13Upstream-Status: Inappropriate [configuration] 13Upstream-Status: Inappropriate [configuration]
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
14--- 15---
15 gcc/Makefile.in | 2 ++ 16 gcc/Makefile.in | 2 ++
16 1 file changed, 2 insertions(+) 17 1 file changed, 2 insertions(+)
17 18
18diff --git a/gcc/Makefile.in b/gcc/Makefile.in 19diff --git a/gcc/Makefile.in b/gcc/Makefile.in
19index 9b17d120a..d175ec4e3 100644 20index 06eb0d27a28..a8678ca24ed 100644
20--- a/gcc/Makefile.in 21--- a/gcc/Makefile.in
21+++ b/gcc/Makefile.in 22+++ b/gcc/Makefile.in
22@@ -3693,6 +3693,8 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype 23@@ -3686,6 +3686,8 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
23 "$(srcdir)"/config/* | "$(srcdir)"/common/config/* \ 24 "$(srcdir)"/config/* | "$(srcdir)"/common/config/* \
24 | "$(srcdir)"/c-family/* | "$(srcdir)"/*.def ) \ 25 | "$(srcdir)"/c-family/* | "$(srcdir)"/*.def ) \
25 base=`echo "$$path" | sed -e "s|$$srcdirstrip/||"`;; \ 26 base=`echo "$$path" | sed -e "s|$$srcdirstrip/||"`;; \
@@ -28,6 +29,3 @@ index 9b17d120a..d175ec4e3 100644
28 *) base=`basename $$path` ;; \ 29 *) base=`basename $$path` ;; \
29 esac; \ 30 esac; \
30 dest=$(plugin_includedir)/$$base; \ 31 dest=$(plugin_includedir)/$$base; \
31--
322.25.1
33
diff --git a/meta/recipes-devtools/gcc/gcc/0042-Fix-thread-stack-size-init.patch b/meta/recipes-devtools/gcc/gcc/0042-Fix-thread-stack-size-init.patch
deleted file mode 100644
index 3fb9ee98de..0000000000
--- a/meta/recipes-devtools/gcc/gcc/0042-Fix-thread-stack-size-init.patch
+++ /dev/null
@@ -1,23 +0,0 @@
1The patch is needed in order to support recent glibc (2.34).
2
3Upstream-Status: Backport [https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=91f8a7a34cf29ae7c465603a801326767f1cc7e9]
4
5Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6
7---
8--- a/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp 2022-03-15 07:59:54.515325204 -0700
9+++ b/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp 2022-03-15 08:01:45.919405931 -0700
10@@ -166,9 +166,10 @@
11 #if !SANITIZER_GO
12 // TODO(glider): different tools may require different altstack size.
13 static uptr GetAltStackSize() {
14- // SIGSTKSZ is not enough.
15- static const uptr kAltStackSize = SIGSTKSZ * 4;
16- return kAltStackSize;
17+ // Note: since GLIBC_2.31, SIGSTKSZ may be a function call, so this may be
18+ // more costly that you think. However GetAltStackSize is only call 2-3 times
19+ // per thread so don't cache the evaluation.
20+ return SIGSTKSZ * 4;
21 }
22
23 void SetAlternateSignalStack() {
diff --git a/meta/recipes-devtools/gcc/gcc_11.2.bb b/meta/recipes-devtools/gcc/gcc_11.3.bb
index 255fe552bd..255fe552bd 100644
--- a/meta/recipes-devtools/gcc/gcc_11.2.bb
+++ b/meta/recipes-devtools/gcc/gcc_11.3.bb
diff --git a/meta/recipes-devtools/gcc/libgcc-initial_11.2.bb b/meta/recipes-devtools/gcc/libgcc-initial_11.3.bb
index a259082b47..a259082b47 100644
--- a/meta/recipes-devtools/gcc/libgcc-initial_11.2.bb
+++ b/meta/recipes-devtools/gcc/libgcc-initial_11.3.bb
diff --git a/meta/recipes-devtools/gcc/libgcc_11.2.bb b/meta/recipes-devtools/gcc/libgcc_11.3.bb
index f88963b0a4..f88963b0a4 100644
--- a/meta/recipes-devtools/gcc/libgcc_11.2.bb
+++ b/meta/recipes-devtools/gcc/libgcc_11.3.bb
diff --git a/meta/recipes-devtools/gcc/libgfortran_11.2.bb b/meta/recipes-devtools/gcc/libgfortran_11.3.bb
index 71dd8b4bdc..71dd8b4bdc 100644
--- a/meta/recipes-devtools/gcc/libgfortran_11.2.bb
+++ b/meta/recipes-devtools/gcc/libgfortran_11.3.bb