summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-15.1.inc (renamed from meta/recipes-devtools/gcc/gcc-14.1.inc)22
-rw-r--r--meta/recipes-devtools/gcc/gcc-common.inc32
-rw-r--r--meta/recipes-devtools/gcc/gcc-configure-common.inc4
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-canadian.inc9
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-canadian_15.1.bb (renamed from meta/recipes-devtools/gcc/gcc-cross-canadian_14.1.bb)2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross.inc24
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross_15.1.bb (renamed from meta/recipes-devtools/gcc/gcc-cross_14.1.bb)0
-rw-r--r--meta/recipes-devtools/gcc/gcc-crosssdk.inc4
-rw-r--r--meta/recipes-devtools/gcc/gcc-crosssdk_15.1.bb (renamed from meta/recipes-devtools/gcc/gcc-crosssdk_14.1.bb)0
-rw-r--r--meta/recipes-devtools/gcc/gcc-multilib-config.inc11
-rw-r--r--meta/recipes-devtools/gcc/gcc-runtime.inc28
-rw-r--r--meta/recipes-devtools/gcc/gcc-runtime_15.1.bb (renamed from meta/recipes-devtools/gcc/gcc-runtime_14.1.bb)0
-rw-r--r--meta/recipes-devtools/gcc/gcc-sanitizers.inc15
-rw-r--r--meta/recipes-devtools/gcc/gcc-sanitizers_15.1.bb (renamed from meta/recipes-devtools/gcc/gcc-sanitizers_14.1.bb)0
-rw-r--r--meta/recipes-devtools/gcc/gcc-shared-source.inc4
-rw-r--r--meta/recipes-devtools/gcc/gcc-source_15.1.bb (renamed from meta/recipes-devtools/gcc/gcc-source_14.1.bb)1
-rw-r--r--meta/recipes-devtools/gcc/gcc-target.inc75
-rw-r--r--meta/recipes-devtools/gcc/gcc-testsuite.inc6
-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-gcc-poison-system-directories.patch105
-rw-r--r--meta/recipes-devtools/gcc/gcc/0003-64-bit-multilib-hack.patch12
-rw-r--r--meta/recipes-devtools/gcc/gcc/0004-Pass-CXXFLAGS_FOR_BUILD-in-a-couple-of-places-to-avo.patch10
-rw-r--r--meta/recipes-devtools/gcc/gcc/0005-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch16
-rw-r--r--meta/recipes-devtools/gcc/gcc/0006-cpp-honor-sysroot.patch10
-rw-r--r--meta/recipes-devtools/gcc/gcc/0007-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch64
-rw-r--r--meta/recipes-devtools/gcc/gcc/0008-libtool.patch6
-rw-r--r--meta/recipes-devtools/gcc/gcc/0009-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch6
-rw-r--r--meta/recipes-devtools/gcc/gcc/0010-Use-the-multilib-config-files-from-B-instead-of-usin.patch14
-rw-r--r--meta/recipes-devtools/gcc/gcc/0011-aarch64-Fix-include-paths-when-S-B.patch20
-rw-r--r--meta/recipes-devtools/gcc/gcc/0012-Avoid-using-libdir-from-.la-which-usually-points-to-.patch6
-rw-r--r--meta/recipes-devtools/gcc/gcc/0013-Ensure-target-gcc-headers-can-be-included.patch18
-rw-r--r--meta/recipes-devtools/gcc/gcc/0014-Don-t-search-host-directory-during-relink-if-inst_pr.patch6
-rw-r--r--meta/recipes-devtools/gcc/gcc/0015-libcc1-fix-libcc1-s-install-path-and-rpath.patch6
-rw-r--r--meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch34
-rw-r--r--meta/recipes-devtools/gcc/gcc/0017-Search-target-sysroot-gcc-version-specific-dirs-with.patch8
-rw-r--r--meta/recipes-devtools/gcc/gcc/0018-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch8
-rw-r--r--meta/recipes-devtools/gcc/gcc/0019-Re-introduce-spe-commandline-options.patch6
-rw-r--r--meta/recipes-devtools/gcc/gcc/0020-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch8
-rw-r--r--meta/recipes-devtools/gcc/gcc/0021-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch8
-rw-r--r--meta/recipes-devtools/gcc/gcc/0022-libatomic-Do-not-enforce-march-on-aarch64.patch8
-rw-r--r--meta/recipes-devtools/gcc/gcc/0023-Fix-install-path-of-linux64.h.patch6
-rw-r--r--meta/recipes-devtools/gcc/gcc/0024-Avoid-hardcoded-build-paths-into-ppc-libgcc.patch2
-rw-r--r--meta/recipes-devtools/gcc/gcc/0025-gcc-testsuite-tweaks-for-mips-OE.patch118
-rw-r--r--meta/recipes-devtools/gcc/gcc/0026-arm-fully-validate-mem_noofs_operand-PR120351.patch95
-rw-r--r--meta/recipes-devtools/gcc/gcc/0026-fix-incorrect-preprocessor-line-numbers.patch475
-rw-r--r--meta/recipes-devtools/gcc/gcc_15.1.bb (renamed from meta/recipes-devtools/gcc/gcc_14.1.bb)0
-rw-r--r--meta/recipes-devtools/gcc/libgcc-common.inc6
-rw-r--r--meta/recipes-devtools/gcc/libgcc-initial.inc2
-rw-r--r--meta/recipes-devtools/gcc/libgcc-initial_15.1.bb (renamed from meta/recipes-devtools/gcc/libgcc-initial_14.1.bb)0
-rw-r--r--meta/recipes-devtools/gcc/libgcc.inc3
-rw-r--r--meta/recipes-devtools/gcc/libgcc_15.1.bb (renamed from meta/recipes-devtools/gcc/libgcc_14.1.bb)0
-rw-r--r--meta/recipes-devtools/gcc/libgfortran.inc5
-rw-r--r--meta/recipes-devtools/gcc/libgfortran_15.1.bb (renamed from meta/recipes-devtools/gcc/libgfortran_14.1.bb)0
53 files changed, 947 insertions, 391 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-14.1.inc b/meta/recipes-devtools/gcc/gcc-15.1.inc
index b057e570f3..af29db8e5b 100644
--- a/meta/recipes-devtools/gcc/gcc-14.1.inc
+++ b/meta/recipes-devtools/gcc/gcc-15.1.inc
@@ -2,14 +2,16 @@ 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 = "14.1.0" 5PV = "15.1.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 = "14.1.0" 9BINV = "15.1.0"
10 10
11FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc:${FILE_DIRNAME}/gcc/backport:" 11FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc:${FILE_DIRNAME}/gcc/backport:"
12 12
13TOOLCHAIN = "gcc"
14
13DEPENDS =+ "mpfr gmp libmpc zlib zstd flex-native" 15DEPENDS =+ "mpfr gmp libmpc zlib zstd flex-native"
14NATIVEDEPS = "mpfr-native gmp-native libmpc-native zlib-native flex-native zstd-native" 16NATIVEDEPS = "mpfr-native gmp-native libmpc-native zlib-native flex-native zstd-native"
15 17
@@ -31,16 +33,17 @@ LIC_FILES_CHKSUM = "\
31#SRC_URI[sha256sum] = "41bf7be5dc029112a9df625266e7de030ffc36ff3638f270b180ae8c91fe6449" 33#SRC_URI[sha256sum] = "41bf7be5dc029112a9df625266e7de030ffc36ff3638f270b180ae8c91fe6449"
32 34
33# from snapshot 35# from snapshot
34#RELEASE ?= "14-20240504" 36#RELEASE ?= "15-20250420"
37#RELEASE ?= "15.1.0-RC-20250418"
35#BASEURI ?= "https://gcc.gnu.org/pub/gcc/snapshots/${RELEASE}/gcc-${RELEASE}.tar.xz" 38#BASEURI ?= "https://gcc.gnu.org/pub/gcc/snapshots/${RELEASE}/gcc-${RELEASE}.tar.xz"
36#SOURCEDIR ?= "gcc-${RELEASE}" 39#SOURCEDIR ?= "gcc-${RELEASE}"
37#SRC_URI[sha256sum] = "34ac232bbf31e0cd5752fd344c2cf55719aaaad2ca0096593e01c97a3d5e274e" 40#SRC_URI[sha256sum] = "fe18624317c6c662977eea8b5a506ec6c132fc11c7a8d53e2f6d21b139b0af3c"
38 41
39# official release 42# official release
40RELEASE ?= "${PV}" 43RELEASE ?= "${PV}"
41BASEURI ?= "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.xz" 44BASEURI ?= "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.xz"
42SOURCEDIR ?= "gcc-${PV}" 45SOURCEDIR ?= "gcc-${PV}"
43SRC_URI[sha256sum] = "e283c654987afe3de9d8080bc0bd79534b5ca0d681a73a11ff2b5d3767426840" 46SRC_URI[sha256sum] = "e2b09ec21660f01fecffb715e0120265216943f038d0e48a9868713e54f06cea"
44 47
45SRC_URI = "${BASEURI} \ 48SRC_URI = "${BASEURI} \
46 file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \ 49 file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \
@@ -68,14 +71,16 @@ SRC_URI = "${BASEURI} \
68 file://0023-Fix-install-path-of-linux64.h.patch \ 71 file://0023-Fix-install-path-of-linux64.h.patch \
69 file://0024-Avoid-hardcoded-build-paths-into-ppc-libgcc.patch \ 72 file://0024-Avoid-hardcoded-build-paths-into-ppc-libgcc.patch \
70 file://0025-gcc-testsuite-tweaks-for-mips-OE.patch \ 73 file://0025-gcc-testsuite-tweaks-for-mips-OE.patch \
74 file://0026-arm-fully-validate-mem_noofs_operand-PR120351.patch \
75 file://0026-fix-incorrect-preprocessor-line-numbers.patch \
71" 76"
72 77
73S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/${SOURCEDIR}" 78UNPACKDIR = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/sources"
79S = "${UNPACKDIR}/${SOURCEDIR}"
74B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}" 80B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
75 81
76# Language Overrides 82# Language Overrides
77FORTRAN = "" 83FORTRAN ?= ""
78JAVA = ""
79 84
80SSP ?= "--disable-libssp" 85SSP ?= "--disable-libssp"
81SSP:mingw32 = "--enable-libssp" 86SSP:mingw32 = "--enable-libssp"
@@ -109,3 +114,4 @@ EXTRA_OECONF_INITIAL = "\
109" 114"
110 115
111CVE_STATUS[CVE-2021-37322] = "cpe-incorrect: Is a binutils 2.26 issue, not gcc" 116CVE_STATUS[CVE-2021-37322] = "cpe-incorrect: Is a binutils 2.26 issue, not gcc"
117CVE_STATUS[CVE-2023-4039] = "fixed-version: Fixed from version 14.0+"
diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc
index 5ac82b1b57..8d95698743 100644
--- a/meta/recipes-devtools/gcc/gcc-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-common.inc
@@ -11,7 +11,8 @@ CVE_PRODUCT = "gcc"
11inherit autotools gettext texinfo 11inherit autotools gettext texinfo
12 12
13BPN = "gcc" 13BPN = "gcc"
14COMPILERDEP = "virtual/${TARGET_PREFIX}gcc:do_gcc_stash_builddir" 14COMPILERDEP = "${MLPREFIX}gcc-cross-${TARGET_ARCH}:do_gcc_stash_builddir"
15COMPILERDEP:class-nativesdk = "gcc-crosssdk-${SDK_SYS}:do_gcc_stash_builddir"
15 16
16python extract_stashed_builddir () { 17python extract_stashed_builddir () {
17 src = d.expand("${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir-${TARGET_SYS}") 18 src = d.expand("${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir-${TARGET_SYS}")
@@ -103,7 +104,8 @@ MIRRORS =+ "\
103gcclibdir = "${libdir}/gcc" 104gcclibdir = "${libdir}/gcc"
104BINV = "${PV}" 105BINV = "${PV}"
105#S = "${WORKDIR}/gcc-${PV}" 106#S = "${WORKDIR}/gcc-${PV}"
106S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}" 107UNPACKDIR = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/sources"
108S = "${UNPACKDIR}/gcc-${PV}"
107 109
108B ?= "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}" 110B ?= "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
109 111
@@ -116,3 +118,29 @@ target_prefix ?= "${prefix}"
116# The real WORKDIR location isn't a dependency for the shared workdir. 118# The real WORKDIR location isn't a dependency for the shared workdir.
117src_patches[vardepsexclude] = "WORKDIR" 119src_patches[vardepsexclude] = "WORKDIR"
118should_apply[vardepsexclude] += "PN" 120should_apply[vardepsexclude] += "PN"
121
122remove_sysroot_paths_from_configargs () {
123 replacement=${1}
124 # Prevent sysroot path from being used in configargs.h header, as it will
125 # be rewritten when used by other sysroots preventing support for gcc
126 # plugins. Additionally the path is embeddeded into the output binary, this
127 # prevents building a reproducible binary.
128 oe_runmake configure-gcc
129 sed -i "s@${STAGING_DIR_TARGET}@$replacement@g" ${B}/gcc/configargs.h
130 sed -i "s@${STAGING_DIR_HOST}@/$replacement@g" ${B}/gcc/configargs.h
131}
132
133remove_sysroot_paths_from_checksum_options () {
134 stagingdir=${1}
135 replacement=${2}
136 # Prevent sysroot/workdir paths from being used in checksum-options.
137 # checksum-options is used to generate a checksum which is embedded into
138 # the output binary.
139 oe_runmake TARGET-gcc=checksum-options all-gcc
140 sed -i "s@${DEBUG_PREFIX_MAP}@@g" ${B}/gcc/checksum-options
141 sed -i "s@$stagingdir@$replacement@g" ${B}/gcc/checksum-options
142}
143
144cleanup_installed_include_fixed () {
145 find ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed -type f -not -name "README" -not -name limits.h -not -name syslimits.h | xargs rm -f
146}
diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc
index dba25eb754..50ff0d2e82 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -6,7 +6,7 @@ require gcc-shared-source.inc
6# These can be overridden by the version specific .inc file. 6# These can be overridden by the version specific .inc file.
7 7
8# gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran' 8# gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran'
9FORTRAN ?= ",f77" 9FORTRAN ??= ",fortran"
10LANGUAGES ?= "c,c++${FORTRAN}" 10LANGUAGES ?= "c,c++${FORTRAN}"
11 11
12EXTRA_OECONF_BASE ?= "" 12EXTRA_OECONF_BASE ?= ""
@@ -116,7 +116,5 @@ do_configure () {
116 export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" 116 export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
117 export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" 117 export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
118 118
119
120 oe_runconf 119 oe_runconf
121} 120}
122
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
index 7c4233c211..20dbec7248 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
@@ -3,7 +3,7 @@ inherit cross-canadian
3SUMMARY = "GNU cc and gcc C compilers (cross-canadian for ${TARGET_ARCH} target)" 3SUMMARY = "GNU cc and gcc C compilers (cross-canadian for ${TARGET_ARCH} target)"
4PN = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}" 4PN = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}"
5 5
6DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}gcc virtual/${HOST_PREFIX}binutils virtual/nativesdk-libc nativesdk-gettext flex-native virtual/libc" 6DEPENDS = "virtual/nativesdk-cross-cc virtual/cross-cc virtual/nativesdk-cross-binutils virtual/nativesdk-libc nativesdk-gettext flex-native virtual/libc"
7 7
8GCCMULTILIB = "--enable-multilib" 8GCCMULTILIB = "--enable-multilib"
9 9
@@ -64,6 +64,9 @@ do_configure () {
64} 64}
65 65
66do_compile () { 66do_compile () {
67 remove_sysroot_paths_from_configargs '/host'
68 remove_sysroot_paths_from_checksum_options '${STAGING_DIR_HOST}' '/host'
69
67 oe_runmake all-host configure-target-libgcc 70 oe_runmake all-host configure-target-libgcc
68 (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h) 71 (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
69} 72}
@@ -129,7 +132,7 @@ do_install () {
129 dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/ 132 dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
130 install -d $dest 133 install -d $dest
131 suffix=${EXEEXT} 134 suffix=${EXEEXT}
132 for t in ar as ld ld.bfd ld.gold nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do 135 for t in ar as ld ld.bfd nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
133 if [ "$t" = "g77" -o "$t" = "gfortran" ] && [ ! -e ${D}${bindir}/${TARGET_PREFIX}$t$suffix ]; then 136 if [ "$t" = "g77" -o "$t" = "gfortran" ] && [ ! -e ${D}${bindir}/${TARGET_PREFIX}$t$suffix ]; then
134 continue 137 continue
135 fi 138 fi
@@ -172,6 +175,8 @@ do_install () {
172 done 175 done
173 done 176 done
174 done 177 done
178
179 cleanup_installed_include_fixed
175} 180}
176 181
177ELFUTILS = "nativesdk-elfutils" 182ELFUTILS = "nativesdk-elfutils"
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian_14.1.bb b/meta/recipes-devtools/gcc/gcc-cross-canadian_15.1.bb
index bf53c5cd78..355757c656 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian_14.1.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian_15.1.bb
@@ -1,5 +1,3 @@
1require recipes-devtools/gcc/gcc-${PV}.inc 1require recipes-devtools/gcc/gcc-${PV}.inc
2require gcc-cross-canadian.inc 2require gcc-cross-canadian.inc
3 3
4
5
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index 5b0ca15d47..80b85fb054 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -2,8 +2,7 @@ inherit cross
2 2
3INHIBIT_DEFAULT_DEPS = "1" 3INHIBIT_DEFAULT_DEPS = "1"
4EXTRADEPENDS = "" 4EXTRADEPENDS = ""
5DEPENDS = "virtual/${TARGET_PREFIX}binutils ${EXTRADEPENDS} ${NATIVEDEPS}" 5DEPENDS = "virtual/cross-binutils ${EXTRADEPENDS} ${NATIVEDEPS}"
6PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
7python () { 6python () {
8 if d.getVar("TARGET_OS").startswith("linux"): 7 if d.getVar("TARGET_OS").startswith("linux"):
9 d.setVar("EXTRADEPENDS", "linux-libc-headers") 8 d.setVar("EXTRADEPENDS", "linux-libc-headers")
@@ -34,6 +33,7 @@ EXTRA_OECONF += "\
34EXTRA_OECONF:append:libc-baremetal = " --without-headers" 33EXTRA_OECONF:append:libc-baremetal = " --without-headers"
35EXTRA_OECONF:remove:libc-baremetal = "--enable-threads=posix" 34EXTRA_OECONF:remove:libc-baremetal = "--enable-threads=posix"
36EXTRA_OECONF:remove:libc-newlib = "--enable-threads=posix" 35EXTRA_OECONF:remove:libc-newlib = "--enable-threads=posix"
36EXTRA_OECONF:remove:libc-picolibc = "--enable-threads=posix"
37 37
38EXTRA_OECONF_PATHS = "\ 38EXTRA_OECONF_PATHS = "\
39 --with-gxx-include-dir=/not/exist${target_includedir}/c++/${BINV} \ 39 --with-gxx-include-dir=/not/exist${target_includedir}/c++/${BINV} \
@@ -44,7 +44,6 @@ EXTRA_OECONF_PATHS = "\
44 44
45ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}" 45ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
46 46
47
48do_configure:prepend () { 47do_configure:prepend () {
49 install -d ${RECIPE_SYSROOT}${target_includedir} 48 install -d ${RECIPE_SYSROOT}${target_includedir}
50 touch ${RECIPE_SYSROOT}${target_includedir}/limits.h 49 touch ${RECIPE_SYSROOT}${target_includedir}/limits.h
@@ -62,19 +61,8 @@ do_compile () {
62 export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" 61 export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
63 export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" 62 export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
64 63
65 # Prevent native/host sysroot path from being used in configargs.h header, 64 remove_sysroot_paths_from_configargs '/host'
66 # as it will be rewritten when used by other sysroots preventing support 65 remove_sysroot_paths_from_checksum_options '${STAGING_DIR_HOST}' '/host'
67 # for gcc plugins
68 oe_runmake configure-gcc
69 sed -i 's@${STAGING_DIR_TARGET}@/host@g' ${B}/gcc/configargs.h
70 sed -i 's@${STAGING_DIR_HOST}@/host@g' ${B}/gcc/configargs.h
71
72 # Prevent sysroot/workdir paths from being used in checksum-options.
73 # checksum-options is used to generate a checksum which is embedded into
74 # the output binary.
75 oe_runmake TARGET-gcc=checksum-options all-gcc
76 sed -i 's@${DEBUG_PREFIX_MAP}@@g' ${B}/gcc/checksum-options
77 sed -i 's@${STAGING_DIR_HOST}@/host@g' ${B}/gcc/checksum-options
78 66
79 oe_runmake all-host configure-target-libgcc 67 oe_runmake all-host configure-target-libgcc
80 (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h) 68 (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
@@ -105,7 +93,7 @@ do_install () {
105 # found. These need to be relative paths so they work in different locations. 93 # found. These need to be relative paths so they work in different locations.
106 dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/ 94 dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
107 install -d $dest 95 install -d $dest
108 for t in ar as ld ld.bfd ld.gold nm objcopy objdump ranlib strip gcc cpp $fortsymlinks; do 96 for t in ar as ld ld.bfd nm objcopy objdump ranlib strip gcc cpp $fortsymlinks; do
109 ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t 97 ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
110 ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t ${dest}${TARGET_PREFIX}$t 98 ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t ${dest}${TARGET_PREFIX}$t
111 done 99 done
@@ -120,7 +108,7 @@ do_install () {
120 cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ 108 cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
121 cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ 109 cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
122 110
123 find ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed -type f -not -name "README" -not -name limits.h -not -name syslimits.h | xargs rm -f 111 cleanup_installed_include_fixed
124 112
125 # install LTO linker plugins where binutils tools can find it 113 # install LTO linker plugins where binutils tools can find it
126 install -d ${D}${libdir}/bfd-plugins 114 install -d ${D}${libdir}/bfd-plugins
diff --git a/meta/recipes-devtools/gcc/gcc-cross_14.1.bb b/meta/recipes-devtools/gcc/gcc-cross_15.1.bb
index b43cca0c52..b43cca0c52 100644
--- a/meta/recipes-devtools/gcc/gcc-cross_14.1.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross_15.1.bb
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk.inc b/meta/recipes-devtools/gcc/gcc-crosssdk.inc
index 7eaad2314c..4397dd898d 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk.inc
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk.inc
@@ -8,7 +8,7 @@ SYSTEMLIBS1 = "${SDKPATHNATIVE}${libdir_nativesdk}/"
8 8
9GCCMULTILIB = "--disable-multilib" 9GCCMULTILIB = "--disable-multilib"
10 10
11DEPENDS = "virtual/${TARGET_PREFIX}binutils gettext-native ${NATIVEDEPS}" 11DEPENDS = "virtual/nativesdk-cross-binutils gettext-native ${NATIVEDEPS}"
12PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++" 12PROVIDES = "virtual/nativesdk-cross-cc virtual/nativesdk-cross-c++"
13 13
14gcc_multilib_setup[vardepsexclude] = "MULTILIB_VARIANTS" 14gcc_multilib_setup[vardepsexclude] = "MULTILIB_VARIANTS"
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk_14.1.bb b/meta/recipes-devtools/gcc/gcc-crosssdk_15.1.bb
index 40a6c4feff..40a6c4feff 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk_14.1.bb
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk_15.1.bb
diff --git a/meta/recipes-devtools/gcc/gcc-multilib-config.inc b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
index 2dbbc23c94..2afd8f6f2a 100644
--- a/meta/recipes-devtools/gcc/gcc-multilib-config.inc
+++ b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
@@ -34,6 +34,7 @@ python gcc_multilib_setup() {
34 '%s/aarch64/aarch64-linux.h' % src_conf_dir, 34 '%s/aarch64/aarch64-linux.h' % src_conf_dir,
35 '%s/aarch64/aarch64-cores.def' % src_conf_dir, 35 '%s/aarch64/aarch64-cores.def' % src_conf_dir,
36 '%s/arm/linux-eabi.h' % src_conf_dir, 36 '%s/arm/linux-eabi.h' % src_conf_dir,
37 '%s/riscv/t-linux*' % src_conf_dir,
37 '%s/*/linux.h' % src_conf_dir, 38 '%s/*/linux.h' % src_conf_dir,
38 '%s/linux.h' % src_conf_dir) 39 '%s/linux.h' % src_conf_dir)
39 40
@@ -45,6 +46,9 @@ python gcc_multilib_setup() {
45 bb.utils.mkdirhier('%s/%s' % (build_conf_dir, parent_dir)) 46 bb.utils.mkdirhier('%s/%s' % (build_conf_dir, parent_dir))
46 bb.utils.copyfile(fn, '%s/%s' % (build_conf_dir, rel_path)) 47 bb.utils.copyfile(fn, '%s/%s' % (build_conf_dir, rel_path))
47 48
49 # For now, force the riscv multilib view to our own meaning we can always enable multilib
50 bb.utils.copyfile('%s/riscv/t-linux' % src_conf_dir, '%s/riscv/t-linux-multilib' % build_conf_dir)
51
48 pn = d.getVar('PN') 52 pn = d.getVar('PN')
49 multilibs = (d.getVar('MULTILIB_VARIANTS') or '').split() 53 multilibs = (d.getVar('MULTILIB_VARIANTS') or '').split()
50 if not multilibs and pn != "nativesdk-gcc": 54 if not multilibs and pn != "nativesdk-gcc":
@@ -55,7 +59,6 @@ python gcc_multilib_setup() {
55 if ('%sgcc' % mlprefix) != pn and (not pn.startswith('gcc-cross-canadian')) and pn != "nativesdk-gcc": 59 if ('%sgcc' % mlprefix) != pn and (not pn.startswith('gcc-cross-canadian')) and pn != "nativesdk-gcc":
56 return 60 return
57 61
58
59 def write_config(root, files, options, dirnames, osdirnames): 62 def write_config(root, files, options, dirnames, osdirnames):
60 for ml_conf_file in files: 63 for ml_conf_file in files:
61 with open(root + '/' + ml_conf_file, 'r') as f: 64 with open(root + '/' + ml_conf_file, 'r') as f:
@@ -138,13 +141,14 @@ python gcc_multilib_setup() {
138 with open(root + '/' + ml_conf_file, 'w') as f: 141 with open(root + '/' + ml_conf_file, 'w') as f:
139 f.write(''.join(filelines)) 142 f.write(''.join(filelines))
140 143
141
142 gcc_target_config_files = { 144 gcc_target_config_files = {
143 'x86_64' : ['gcc/config/i386/t-linux64'], 145 'x86_64' : ['gcc/config/i386/t-linux64'],
144 'i586' : ['gcc/config/i386/t-linux64'], 146 'i586' : ['gcc/config/i386/t-linux64'],
145 'i686' : ['gcc/config/i386/t-linux64'], 147 'i686' : ['gcc/config/i386/t-linux64'],
146 'mips' : ['gcc/config/mips/t-linux64'], 148 'mips' : ['gcc/config/mips/t-linux64'],
147 'mips64' : ['gcc/config/mips/t-linux64'], 149 'mips64' : ['gcc/config/mips/t-linux64'],
150 'riscv32' : ['gcc/config/riscv/t-linux-multilib'],
151 'riscv64' : ['gcc/config/riscv/t-linux-multilib'],
148 'powerpc' : ['gcc/config/rs6000/t-linux64'], 152 'powerpc' : ['gcc/config/rs6000/t-linux64'],
149 'powerpc64' : ['gcc/config/rs6000/t-linux64'], 153 'powerpc64' : ['gcc/config/rs6000/t-linux64'],
150 'aarch64' : ['gcc/config/aarch64/t-aarch64'], 154 'aarch64' : ['gcc/config/aarch64/t-aarch64'],
@@ -161,6 +165,8 @@ python gcc_multilib_setup() {
161 'powerpc64' : ['gcc/config/linux.h', 'gcc/config/rs6000/linux64.h'], 165 'powerpc64' : ['gcc/config/linux.h', 'gcc/config/rs6000/linux64.h'],
162 'aarch64' : ['gcc/config/linux.h', 'gcc/config/aarch64/aarch64-linux.h', 'gcc/config/arm/linux-eabi.h'], 166 'aarch64' : ['gcc/config/linux.h', 'gcc/config/aarch64/aarch64-linux.h', 'gcc/config/arm/linux-eabi.h'],
163 'arm' : ['gcc/config/linux.h', 'gcc/config/aarch64/aarch64-linux.h', 'gcc/config/arm/linux-eabi.h'], 167 'arm' : ['gcc/config/linux.h', 'gcc/config/aarch64/aarch64-linux.h', 'gcc/config/arm/linux-eabi.h'],
168 'riscv32' : ['gcc/config/linux.h'],
169 'riscv64' : ['gcc/config/linux.h'],
164 } 170 }
165 171
166 libdir32 = 'SYSTEMLIBS_DIR' 172 libdir32 = 'SYSTEMLIBS_DIR'
@@ -168,7 +174,6 @@ python gcc_multilib_setup() {
168 libdirx32 = 'SYSTEMLIBS_DIR' 174 libdirx32 = 'SYSTEMLIBS_DIR'
169 libdirn32 = 'SYSTEMLIBS_DIR' 175 libdirn32 = 'SYSTEMLIBS_DIR'
170 176
171
172 target_arch = (d.getVar('TARGET_ARCH_MULTILIB_ORIGINAL') if mlprefix 177 target_arch = (d.getVar('TARGET_ARCH_MULTILIB_ORIGINAL') if mlprefix
173 else d.getVar('TARGET_ARCH')) 178 else d.getVar('TARGET_ARCH'))
174 if pn == "nativesdk-gcc": 179 if pn == "nativesdk-gcc":
diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
index 89b0bebcfb..c4e1c5b9a5 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -17,6 +17,7 @@ EXTRA_OECONF_PATHS = "\
17EXTRA_OECONF:append:linuxstdbase = " --enable-clocale=gnu" 17EXTRA_OECONF:append:linuxstdbase = " --enable-clocale=gnu"
18EXTRA_OECONF:append = " --cache-file=${B}/config.cache" 18EXTRA_OECONF:append = " --cache-file=${B}/config.cache"
19EXTRA_OECONF:append:libc-newlib = " --with-newlib --with-target-subdir" 19EXTRA_OECONF:append:libc-newlib = " --with-newlib --with-target-subdir"
20EXTRA_OECONF:append:libc-picolibc = " --with-newlib --with-target-subdir"
20EXTRA_OECONF:append:libc-baremetal = " --with-target-subdir" 21EXTRA_OECONF:append:libc-baremetal = " --with-target-subdir"
21 22
22# Disable ifuncs for libatomic on arm conflicts -march/-mcpu 23# Disable ifuncs for libatomic on arm conflicts -march/-mcpu
@@ -27,6 +28,7 @@ DISABLE_STATIC:class-nativesdk ?= ""
27 28
28# Newlib does not support symbol versioning on libsdtcc++ 29# Newlib does not support symbol versioning on libsdtcc++
29SYMVERS_CONF:libc-newlib = "" 30SYMVERS_CONF:libc-newlib = ""
31SYMVERS_CONF:libc-picolibc = ""
30 32
31# Building with thumb enabled on armv6t fails 33# Building with thumb enabled on armv6t fails
32ARM_INSTRUCTION_SET:armv6 = "arm" 34ARM_INSTRUCTION_SET:armv6 = "arm"
@@ -43,10 +45,11 @@ RUNTIMELIBSSP ?= ""
43RUNTIMELIBSSP:mingw32 ?= "libssp" 45RUNTIMELIBSSP:mingw32 ?= "libssp"
44 46
45RUNTIMETARGET = "${RUNTIMELIBSSP} libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \ 47RUNTIMETARGET = "${RUNTIMELIBSSP} libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
46 ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \ 48 ${@bb.utils.contains('FORTRAN', ',fortran', 'libquadmath', '', d)} \
47" 49"
48# Only build libstdc++ for newlib 50# Only build libstdc++ for newlib
49RUNTIMETARGET:libc-newlib = "libstdc++-v3" 51RUNTIMETARGET:libc-newlib = "libstdc++-v3"
52RUNTIMETARGET:libc-picolibc = "libstdc++-v3"
50 53
51# libiberty 54# libiberty
52# libgfortran needs separate recipe due to libquadmath dependency 55# libgfortran needs separate recipe due to libquadmath dependency
@@ -141,6 +144,11 @@ do_install:append:class-target () {
141 ln -sf ../${X86ARCH32}${TARGET_VENDOR}-${TARGET_OS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}/32 144 ln -sf ../${X86ARCH32}${TARGET_VENDOR}-${TARGET_OS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}/32
142 fi 145 fi
143 146
147 if [ "${TARGET_ARCH}" = "riscv32" -o "${TARGET_ARCH}" = "riscv64" ] && [ -z "${MULTILIB_VARIANTS}" ]; then
148 mv ${D}${includedir}/c++/${BINV}/${TARGET_SYS}/bits/* ${D}${includedir}/c++/${BINV}/bits
149 mv ${D}${includedir}/c++/${BINV}/${TARGET_SYS}/ext/* ${D}${includedir}/c++/${BINV}/ext
150 fi
151
144 if [ "${TCLIBC}" != "glibc" ]; then 152 if [ "${TCLIBC}" != "glibc" ]; then
145 case "${TARGET_OS}" in 153 case "${TARGET_OS}" in
146 "linux-musl" | "linux-*spe") extra_target_os="linux";; 154 "linux-musl" | "linux-*spe") extra_target_os="linux";;
@@ -153,8 +161,9 @@ do_install:append:class-target () {
153} 161}
154 162
155INHIBIT_DEFAULT_DEPS = "1" 163INHIBIT_DEFAULT_DEPS = "1"
156DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc virtual/${MLPREFIX}libc" 164DEPENDS = "virtual/cross-cc virtual/cross-c++ ${MLPREFIX}libgcc virtual/${MLPREFIX}libc"
157PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs" 165DEPENDS:class-nativesdk = "virtual/nativesdk-cross-cc virtual/nativesdk-cross-c++ ${MLPREFIX}libgcc virtual/${MLPREFIX}libc"
166PROVIDES = "virtual/${MLPREFIX}compilerlibs"
158 167
159BBCLASSEXTEND = "nativesdk" 168BBCLASSEXTEND = "nativesdk"
160 169
@@ -164,8 +173,6 @@ PACKAGES = "\
164 libstdc++-precompile-dev \ 173 libstdc++-precompile-dev \
165 libstdc++-dev \ 174 libstdc++-dev \
166 libstdc++-staticdev \ 175 libstdc++-staticdev \
167 libg2c \
168 libg2c-dev \
169 libssp \ 176 libssp \
170 libssp-dev \ 177 libssp-dev \
171 libssp-staticdev \ 178 libssp-staticdev \
@@ -196,15 +203,6 @@ FILES:${PN}-dbg += "\
196# So it needs to be added manually to images sadly. 203# So it needs to be added manually to images sadly.
197# RDEPENDS:${PN}-dbg += "python3-datetime" 204# RDEPENDS:${PN}-dbg += "python3-datetime"
198 205
199FILES:libg2c = "${target_libdir}/libg2c.so.*"
200SUMMARY:libg2c = "Companion runtime library for g77"
201FILES:libg2c-dev = "\
202 ${libdir}/libg2c.so \
203 ${libdir}/libg2c.a \
204 ${libdir}/libfrtbegin.a \
205"
206SUMMARY:libg2c-dev = "Companion runtime library for g77 - development files"
207
208FILES:libstdc++ = "${libdir}/libstdc++.so.*" 206FILES:libstdc++ = "${libdir}/libstdc++.so.*"
209SUMMARY:libstdc++ = "GNU standard C++ library" 207SUMMARY:libstdc++ = "GNU standard C++ library"
210FILES:libstdc++-dev = "\ 208FILES:libstdc++-dev = "\
@@ -212,6 +210,7 @@ FILES:libstdc++-dev = "\
212 ${libdir}/libstdc++.so \ 210 ${libdir}/libstdc++.so \
213 ${libdir}/libstdc++*.la \ 211 ${libdir}/libstdc++*.la \
214 ${libdir}/libsupc++.la \ 212 ${libdir}/libsupc++.la \
213 ${libdir}/libstdc++.modules.json \
215" 214"
216SUMMARY:libstdc++-dev = "GNU standard C++ library - development files" 215SUMMARY:libstdc++-dev = "GNU standard C++ library - development files"
217FILES:libstdc++-staticdev = "\ 216FILES:libstdc++-staticdev = "\
@@ -300,6 +299,7 @@ do_check[prefuncs] += "extend_recipe_sysroot"
300do_check[prefuncs] += "check_prepare" 299do_check[prefuncs] += "check_prepare"
301do_check[dirs] = "${WORKDIR}/dejagnu ${B}" 300do_check[dirs] = "${WORKDIR}/dejagnu ${B}"
302do_check[nostamp] = "1" 301do_check[nostamp] = "1"
302do_check[network] = "1"
303do_check() { 303do_check() {
304 export DEJAGNU="${WORKDIR}/dejagnu/site.exp" 304 export DEJAGNU="${WORKDIR}/dejagnu/site.exp"
305 305
diff --git a/meta/recipes-devtools/gcc/gcc-runtime_14.1.bb b/meta/recipes-devtools/gcc/gcc-runtime_15.1.bb
index dd430b57eb..dd430b57eb 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime_14.1.bb
+++ b/meta/recipes-devtools/gcc/gcc-runtime_15.1.bb
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers.inc b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
index 524ebd4ba4..6c81d30243 100644
--- a/meta/recipes-devtools/gcc/gcc-sanitizers.inc
+++ b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
@@ -11,6 +11,10 @@ EXTRA_OECONF_PATHS = "\
11 --with-build-sysroot=${STAGING_DIR_TARGET} \ 11 --with-build-sysroot=${STAGING_DIR_TARGET} \
12" 12"
13 13
14# Workaround for this issue: https://github.com/llvm/llvm-project/issues/65144 on aarch64
15# compiler-rt/sanitizers/aarch64: CHECK failed: sanitizer_allocator_primary64.h:133
16CXXFLAGS:append:aarch64 = " -DSANITIZER_CAN_USE_ALLOCATOR64=0"
17
14do_configure () { 18do_configure () {
15 rm -rf ${B}/${TARGET_SYS}/libsanitizer/ 19 rm -rf ${B}/${TARGET_SYS}/libsanitizer/
16 mkdir -p ${B}/${TARGET_SYS}/libsanitizer/ 20 mkdir -p ${B}/${TARGET_SYS}/libsanitizer/
@@ -48,7 +52,7 @@ do_install () {
48 52
49INHIBIT_DEFAULT_DEPS = "1" 53INHIBIT_DEFAULT_DEPS = "1"
50ALLOW_EMPTY:${PN} = "1" 54ALLOW_EMPTY:${PN} = "1"
51DEPENDS = "virtual/crypt gcc-runtime virtual/${TARGET_PREFIX}gcc" 55DEPENDS = "virtual/crypt gcc-runtime virtual/cross-cc"
52 56
53# used to fix ../../../../../../../../../work-shared/gcc-8.3.0-r0/gcc-8.3.0/libsanitizer/libbacktrace/../../libbacktrace/elf.c:772:21: error: 'st.st_mode' may be used uninitialized in this function [-Werror=maybe-uninitialized] 57# used to fix ../../../../../../../../../work-shared/gcc-8.3.0-r0/gcc-8.3.0/libsanitizer/libbacktrace/../../libbacktrace/elf.c:772:21: error: 'st.st_mode' may be used uninitialized in this function [-Werror=maybe-uninitialized]
54DEBUG_OPTIMIZATION:append = " -Wno-error" 58DEBUG_OPTIMIZATION:append = " -Wno-error"
@@ -73,13 +77,14 @@ RRECOMMENDS:${PN}:append:x86 = " liblsan"
73RRECOMMENDS:${PN}:append:x86-64 = " liblsan libtsan" 77RRECOMMENDS:${PN}:append:x86-64 = " liblsan libtsan"
74RRECOMMENDS:${PN}:append:powerpc64 = " liblsan libtsan" 78RRECOMMENDS:${PN}:append:powerpc64 = " liblsan libtsan"
75RRECOMMENDS:${PN}:append:aarch64 = " liblsan libtsan" 79RRECOMMENDS:${PN}:append:aarch64 = " liblsan libtsan"
80RRECOMMENDS:${PN}:append:riscv64 = " liblsan libtsan"
76 81
77do_package_write_ipk[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" 82do_package_write_ipk[depends] += "virtual/${MLPREFIX}compilerlibs:do_packagedata"
78do_package_write_deb[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" 83do_package_write_deb[depends] += "virtual/${MLPREFIX}compilerlibs:do_packagedata"
79do_package_write_rpm[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata" 84do_package_write_rpm[depends] += "virtual/${MLPREFIX}compilerlibs:do_packagedata"
80 85
81# Only x86, powerpc, sparc, s390, arm, aarch64 and loongarch64 are supported 86# Only x86, powerpc, sparc, s390, arm, aarch64 and loongarch64 are supported
82COMPATIBLE_HOST = '(x86_64|i.86|powerpc|sparc|s390|arm|aarch64|loongarch64).*-linux' 87COMPATIBLE_HOST = '(x86_64|i.86|powerpc|sparc|s390|arm|aarch64|loongarch64|riscv64).*-linux'
83# musl is currently broken entirely 88# musl is currently broken entirely
84COMPATIBLE_HOST:libc-musl = 'null' 89COMPATIBLE_HOST:libc-musl = 'null'
85 90
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers_14.1.bb b/meta/recipes-devtools/gcc/gcc-sanitizers_15.1.bb
index 8bda2ccad6..8bda2ccad6 100644
--- a/meta/recipes-devtools/gcc/gcc-sanitizers_14.1.bb
+++ b/meta/recipes-devtools/gcc/gcc-sanitizers_15.1.bb
diff --git a/meta/recipes-devtools/gcc/gcc-shared-source.inc b/meta/recipes-devtools/gcc/gcc-shared-source.inc
index 03f520b093..c01410b47a 100644
--- a/meta/recipes-devtools/gcc/gcc-shared-source.inc
+++ b/meta/recipes-devtools/gcc/gcc-shared-source.inc
@@ -16,6 +16,6 @@ do_deploy_source_date_epoch () {
16 sde_file=${SDE_FILE} 16 sde_file=${SDE_FILE}
17 sde_file=${sde_file#${WORKDIR}/} 17 sde_file=${sde_file#${WORKDIR}/}
18 mkdir -p ${SDE_DEPLOYDIR} $(dirname ${SDE_FILE}) 18 mkdir -p ${SDE_DEPLOYDIR} $(dirname ${SDE_FILE})
19 cp -p $(dirname ${S})/$sde_file ${SDE_DEPLOYDIR} 19 cp -p $(dirname ${UNPACKDIR})/$sde_file ${SDE_DEPLOYDIR}
20 cp -p $(dirname ${S})/$sde_file ${SDE_FILE} 20 cp -p $(dirname ${UNPACKDIR})/$sde_file ${SDE_FILE}
21} 21}
diff --git a/meta/recipes-devtools/gcc/gcc-source_14.1.bb b/meta/recipes-devtools/gcc/gcc-source_15.1.bb
index b890fa33ea..be11fa2fcc 100644
--- a/meta/recipes-devtools/gcc/gcc-source_14.1.bb
+++ b/meta/recipes-devtools/gcc/gcc-source_15.1.bb
@@ -1,4 +1,5 @@
1require recipes-devtools/gcc/gcc-${PV}.inc 1require recipes-devtools/gcc/gcc-${PV}.inc
2require recipes-devtools/gcc/gcc-source.inc 2require recipes-devtools/gcc/gcc-source.inc
3 3
4BPN = "gcc-source"
4EXCLUDE_FROM_WORLD = "1" 5EXCLUDE_FROM_WORLD = "1"
diff --git a/meta/recipes-devtools/gcc/gcc-target.inc b/meta/recipes-devtools/gcc/gcc-target.inc
index 82da5ef82b..6b47c10413 100644
--- a/meta/recipes-devtools/gcc/gcc-target.inc
+++ b/meta/recipes-devtools/gcc/gcc-target.inc
@@ -33,8 +33,7 @@ PACKAGES = "\
33 ${PN} ${PN}-plugins ${PN}-symlinks \ 33 ${PN} ${PN}-plugins ${PN}-symlinks \
34 g++ g++-symlinks \ 34 g++ g++-symlinks \
35 cpp cpp-symlinks \ 35 cpp cpp-symlinks \
36 g77 g77-symlinks \ 36 ${@bb.utils.contains('FORTRAN', ',fortran', 'gfortran gfortran-symlinks', '', d)} \
37 gfortran gfortran-symlinks \
38 gcov gcov-symlinks \ 37 gcov gcov-symlinks \
39 ${PN}-doc \ 38 ${PN}-doc \
40 ${PN}-dev \ 39 ${PN}-dev \
@@ -61,7 +60,7 @@ RRECOMMENDS:${PN} += "\
61 libssp \ 60 libssp \
62 libssp-dev \ 61 libssp-dev \
63" 62"
64RDEPENDS:${PN} += "cpp" 63RDEPENDS:${PN} += "binutils cpp"
65 64
66FILES:${PN}-dev = "\ 65FILES:${PN}-dev = "\
67 ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \ 66 ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
@@ -81,23 +80,15 @@ FILES:${PN}-plugins = "\
81" 80"
82ALLOW_EMPTY:${PN}-plugins = "1" 81ALLOW_EMPTY:${PN}-plugins = "1"
83 82
84FILES:g77 = "\ 83INSANE_SKIP:${MLPREFIX}gfortran += "dev-deps"
85 ${bindir}/${TARGET_PREFIX}g77 \
86 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f771 \
87"
88FILES:g77-symlinks = "\
89 ${bindir}/g77 \
90 ${bindir}/f77 \
91"
92RRECOMMENDS:g77 = "\
93 libg2c \
94 libg2c-dev \
95"
96
97FILES:gfortran = "\ 84FILES:gfortran = "\
98 ${bindir}/${TARGET_PREFIX}gfortran \ 85 ${bindir}/${TARGET_PREFIX}gfortran \
99 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \ 86 ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \
100" 87"
88RDEPENDS:gfortran = "\
89 gcc \
90 libgfortran-dev \
91"
101RRECOMMENDS:gfortran = "\ 92RRECOMMENDS:gfortran = "\
102 libquadmath \ 93 libquadmath \
103 libquadmath-dev \ 94 libquadmath-dev \
@@ -141,20 +132,8 @@ FILES:${PN}-doc = "\
141" 132"
142 133
143do_compile () { 134do_compile () {
144 # Prevent full target sysroot path from being used in configargs.h header, 135 remove_sysroot_paths_from_configargs '/'
145 # as it will be rewritten when used by other sysroots preventing support 136 remove_sysroot_paths_from_checksum_options '${STAGING_DIR_TARGET}' '/'
146 # for gcc plugins. Additionally the path is embeddeded into the output
147 # binary, this prevents building a reproducible binary.
148 oe_runmake configure-gcc
149 sed -i 's@${STAGING_DIR_TARGET}@/@g' ${B}/gcc/configargs.h
150 sed -i 's@${STAGING_DIR_HOST}@/@g' ${B}/gcc/configargs.h
151
152 # Prevent sysroot/workdir paths from being used in checksum-options.
153 # checksum-options is used to generate a checksum which is embedded into
154 # the output binary.
155 oe_runmake TARGET-gcc=checksum-options all-gcc
156 sed -i 's@${DEBUG_PREFIX_MAP}@@g' ${B}/gcc/checksum-options
157 sed -i 's@${STAGING_DIR_TARGET}@/@g' ${B}/gcc/checksum-options
158 137
159 oe_runmake all-host 138 oe_runmake all-host
160} 139}
@@ -198,11 +177,6 @@ do_install () {
198 # Not sure why we end up with these but we don't want them... 177 # Not sure why we end up with these but we don't want them...
199 rm -f ${TARGET_PREFIX}${TARGET_PREFIX}* 178 rm -f ${TARGET_PREFIX}${TARGET_PREFIX}*
200 179
201 # Symlinks so we can use these trivially on the target
202 if [ -e ${TARGET_PREFIX}g77 ]; then
203 ln -sf ${TARGET_PREFIX}g77 g77 || true
204 ln -sf g77 f77 || true
205 fi
206 if [ -e ${TARGET_PREFIX}gfortran ]; then 180 if [ -e ${TARGET_PREFIX}gfortran ]; then
207 ln -sf ${TARGET_PREFIX}gfortran gfortran || true 181 ln -sf ${TARGET_PREFIX}gfortran gfortran || true
208 ln -sf gfortran f95 || true 182 ln -sf gfortran f95 || true
@@ -219,37 +193,8 @@ do_install () {
219 install -d ${D}${libdir}/bfd-plugins 193 install -d ${D}${libdir}/bfd-plugins
220 ln -sf ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/liblto_plugin.so ${D}${libdir}/bfd-plugins/liblto_plugin.so 194 ln -sf ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/liblto_plugin.so ${D}${libdir}/bfd-plugins/liblto_plugin.so
221 chown -R root:root ${D} 195 chown -R root:root ${D}
222}
223 196
224do_install:append () { 197 cleanup_installed_include_fixed
225 #
226 # Thefixinc.sh script, run on the gcc's compile phase, looks into sysroot header
227 # files and places the modified files into
228 # {D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed folder. This makes the
229 # build not deterministic. The following code prunes all those headers
230 # except those under include-fixed/linux, *limits.h and README, yielding
231 # the same include-fixed folders no matter what sysroot
232
233 include_fixed="${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed"
234 for f in $(find ${include_fixed} -type f); do
235 case $f in
236 */include-fixed/linux/*)
237 continue
238 ;;
239 */include-fixed/*limits.h)
240 continue
241 ;;
242 */include-fixed/README)
243 continue
244 ;;
245 *)
246 # remove file and directory if empty
247 bbdebug 2 "Pruning $f"
248 rm $f
249 find $(dirname $f) -maxdepth 0 -empty -exec rmdir {} \;
250 ;;
251 esac
252 done
253} 198}
254 199
255# Installing /usr/lib/gcc/* means we'd have two copies, one from gcc-cross 200# Installing /usr/lib/gcc/* means we'd have two copies, one from gcc-cross
diff --git a/meta/recipes-devtools/gcc/gcc-testsuite.inc b/meta/recipes-devtools/gcc/gcc-testsuite.inc
index f16d471478..3257f86907 100644
--- a/meta/recipes-devtools/gcc/gcc-testsuite.inc
+++ b/meta/recipes-devtools/gcc/gcc-testsuite.inc
@@ -53,8 +53,8 @@ python check_prepare() {
53 # - valid for x86*, powerpc, arm, arm64 53 # - valid for x86*, powerpc, arm, arm64
54 if qemu_binary.endswith(("x86_64", "i386", "arm", "aarch64")): 54 if qemu_binary.endswith(("x86_64", "i386", "arm", "aarch64")):
55 args += ["-cpu", "max"] 55 args += ["-cpu", "max"]
56 elif qemu_binary.endswith(("ppc", "mips", "mips64")): 56 else:
57 extra = d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('PACKAGE_ARCH')) 57 extra = d.getVar("QEMU_EXTRAOPTIONS:tune-%s" % d.getVar('TUNE_PKGARCH'))
58 if extra: 58 if extra:
59 args += extra.split() 59 args += extra.split()
60 # For mips64 we could set a maximal CPU (e.g. Loongson-3A4000) however they either have MSA 60 # For mips64 we could set a maximal CPU (e.g. Loongson-3A4000) however they either have MSA
@@ -101,7 +101,7 @@ python check_prepare() {
101 f.write(generate_qemu_linux_user_config(d)) 101 f.write(generate_qemu_linux_user_config(d))
102 102
103 # write out target ssh board config 103 # write out target ssh board config
104 with open(os.path.join(dejagnudir, "ssh.exp"), "w") as f: 104 with open(os.path.join(dejagnudir, "linux-ssh.exp"), "w") as f:
105 f.write(generate_remote_ssh_linux_config(d)) 105 f.write(generate_remote_ssh_linux_config(d))
106 106
107 # generate site.exp to provide boards 107 # generate site.exp to provide boards
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 0b7c0af86f..e36b7f7b17 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 76ef337260aadeb475fd380ff9aca31ea1731345 Mon Sep 17 00:00:00 2001 1From 7e8c2b6bd87d221158f43bc1d770e04ddeed4176 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 02b435c1163..85a82fad302 100755 15index ebc44416b6c..af1d1e24b3d 100755
16--- a/configure 16--- a/configure
17+++ b/configure 17+++ b/configure
18@@ -10387,7 +10387,7 @@ fi 18@@ -11509,7 +11509,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 02b435c1163..85a82fad302 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 1a19c07a27b..bc8e1b8c4ef 100644 28index 730db3c1402..6de64a4777c 100644
29--- a/configure.ac 29--- a/configure.ac
30+++ b/configure.ac 30+++ b/configure.ac
31@@ -3509,7 +3509,7 @@ fi 31@@ -3736,7 +3736,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-gcc-poison-system-directories.patch b/meta/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch
index 76aa69c26e..53d2dc63da 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,6 +1,6 @@
1From 05be69910c99d739ce9246a3bb9426fa6d9f19d4 Mon Sep 17 00:00:00 2001 1From f7c26bbbf0496d179f5e71107fe6cf1320b25901 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: Thu, 23 Jan 2025 17:12:51 -0800
4Subject: [PATCH] gcc: poison-system-directories 4Subject: [PATCH] gcc: poison-system-directories
5 5
6Add /sw/include and /opt/include based on the original 6Add /sw/include and /opt/include based on the original
@@ -13,6 +13,7 @@ wants this to be a failure, they can add "-Werror=poison-system-directories".
13 13
14Upstream-Status: Inappropriate [OE configuration] 14Upstream-Status: Inappropriate [OE configuration]
15Signed-off-by: Mark Hatle <mark.hatle@windriver.com> 15Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
16Signed-off-by: sunil dora <sunilkumar.dora@windriver.com>
16Signed-off-by: Khem Raj <raj.khem@gmail.com> 17Signed-off-by: Khem Raj <raj.khem@gmail.com>
17--- 18---
18 gcc/common.opt | 4 ++++ 19 gcc/common.opt | 4 ++++
@@ -20,15 +21,15 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
20 gcc/configure | 19 +++++++++++++++++++ 21 gcc/configure | 19 +++++++++++++++++++
21 gcc/configure.ac | 16 ++++++++++++++++ 22 gcc/configure.ac | 16 ++++++++++++++++
22 gcc/doc/invoke.texi | 9 +++++++++ 23 gcc/doc/invoke.texi | 9 +++++++++
23 gcc/gcc.cc | 9 +++++++-- 24 gcc/gcc.cc | 12 ++++++++++--
24 gcc/incpath.cc | 21 +++++++++++++++++++++ 25 gcc/incpath.cc | 25 +++++++++++++++++++++++++
25 7 files changed, 86 insertions(+), 2 deletions(-) 26 7 files changed, 93 insertions(+), 2 deletions(-)
26 27
27diff --git a/gcc/common.opt b/gcc/common.opt 28diff --git a/gcc/common.opt b/gcc/common.opt
28index ad348844775..df3992b420d 100644 29index e3fa0dacec4..bea1adc0940 100644
29--- a/gcc/common.opt 30--- a/gcc/common.opt
30+++ b/gcc/common.opt 31+++ b/gcc/common.opt
31@@ -715,6 +715,10 @@ Wreturn-local-addr 32@@ -729,6 +729,10 @@ Wreturn-local-addr
32 Common Var(warn_return_local_addr) Init(1) Warning 33 Common Var(warn_return_local_addr) Init(1) Warning
33 Warn about returning a pointer/reference to a local or temporary variable. 34 Warn about returning a pointer/reference to a local or temporary variable.
34 35
@@ -40,7 +41,7 @@ index ad348844775..df3992b420d 100644
40 Common Var(warn_shadow) Warning 41 Common Var(warn_shadow) Warning
41 Warn when one variable shadows another. Same as -Wshadow=global. 42 Warn when one variable shadows another. Same as -Wshadow=global.
42diff --git a/gcc/config.in b/gcc/config.in 43diff --git a/gcc/config.in b/gcc/config.in
43index f3de4ba6776..3ce3113510b 100644 44index a79c51adb2b..8a531ed591c 100644
44--- a/gcc/config.in 45--- a/gcc/config.in
45+++ b/gcc/config.in 46+++ b/gcc/config.in
46@@ -249,6 +249,16 @@ 47@@ -249,6 +249,16 @@
@@ -61,10 +62,10 @@ index f3de4ba6776..3ce3113510b 100644
61 optimizer and back end) to be checked for dynamic type safety at runtime. 62 optimizer and back end) to be checked for dynamic type safety at runtime.
62 This is quite expensive. */ 63 This is quite expensive. */
63diff --git a/gcc/configure b/gcc/configure 64diff --git a/gcc/configure b/gcc/configure
64index 266ab8f84b2..3c346acbce0 100755 65index 16965953f05..0f4a5d52c30 100755
65--- a/gcc/configure 66--- a/gcc/configure
66+++ b/gcc/configure 67+++ b/gcc/configure
67@@ -1050,6 +1050,7 @@ enable_maintainer_mode 68@@ -1051,6 +1051,7 @@ enable_maintainer_mode
68 enable_link_mutex 69 enable_link_mutex
69 enable_link_serialization 70 enable_link_serialization
70 enable_version_specific_runtime_libs 71 enable_version_specific_runtime_libs
@@ -72,7 +73,7 @@ index 266ab8f84b2..3c346acbce0 100755
72 enable_plugin 73 enable_plugin
73 enable_host_shared 74 enable_host_shared
74 enable_host_pie 75 enable_host_pie
75@@ -1823,6 +1824,8 @@ Optional Features: 76@@ -1828,6 +1829,8 @@ Optional Features:
76 --enable-version-specific-runtime-libs 77 --enable-version-specific-runtime-libs
77 specify that runtime libraries should be installed 78 specify that runtime libraries should be installed
78 in a compiler-specific directory 79 in a compiler-specific directory
@@ -81,7 +82,7 @@ index 266ab8f84b2..3c346acbce0 100755
81 --enable-plugin enable plugin support 82 --enable-plugin enable plugin support
82 --enable-host-shared build host code as shared libraries 83 --enable-host-shared build host code as shared libraries
83 --enable-host-pie build host code as PIE 84 --enable-host-pie build host code as PIE
84@@ -34020,6 +34023,22 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : 85@@ -34027,6 +34030,22 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
85 fi 86 fi
86 87
87 88
@@ -105,10 +106,10 @@ index 266ab8f84b2..3c346acbce0 100755
105 106
106 107
107diff --git a/gcc/configure.ac b/gcc/configure.ac 108diff --git a/gcc/configure.ac b/gcc/configure.ac
108index a5aec1bc967..4d8123085b8 100644 109index 9f67e62950a..b0e3615e5aa 100644
109--- a/gcc/configure.ac 110--- a/gcc/configure.ac
110+++ b/gcc/configure.ac 111+++ b/gcc/configure.ac
111@@ -7518,6 +7518,22 @@ AC_ARG_ENABLE(version-specific-runtime-libs, 112@@ -7502,6 +7502,22 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
112 [specify that runtime libraries should be 113 [specify that runtime libraries should be
113 installed in a compiler-specific directory])]) 114 installed in a compiler-specific directory])])
114 115
@@ -132,20 +133,20 @@ index a5aec1bc967..4d8123085b8 100644
132 AC_SUBST(subdirs) 133 AC_SUBST(subdirs)
133 AC_SUBST(srcdir) 134 AC_SUBST(srcdir)
134diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi 135diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
135index 1006510fc6a..389155f8ed5 100644 136index c2e1bf8031b..d33e2042f38 100644
136--- a/gcc/doc/invoke.texi 137--- a/gcc/doc/invoke.texi
137+++ b/gcc/doc/invoke.texi 138+++ b/gcc/doc/invoke.texi
138@@ -391,6 +391,7 @@ Objective-C and Objective-C++ Dialects}. 139@@ -405,6 +405,7 @@ Objective-C and Objective-C++ Dialects}.
139 -Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded 140 -Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded
140 -Wparentheses -Wno-pedantic-ms-format 141 -Wparentheses -Wno-pedantic-ms-format
141 -Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast 142 -Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast
142+-Wno-poison-system-directories 143+-Wno-poison-system-directories
143 -Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls 144 -Wno-pragmas -Wno-pragma-once-outside-header -Wno-prio-ctor-dtor
144 -Wrestrict -Wno-return-local-addr -Wreturn-type 145 -Wno-psabi
145 -Wno-scalar-storage-order -Wsequence-point 146 -Wredundant-decls -Wrestrict
146@@ -8860,6 +8861,14 @@ made up of data only and thus requires no special treatment. But, for 147@@ -10727,6 +10728,14 @@ an error. @option{Wint-to-pointer-cast} is enabled by default.
147 most targets, it is made up of code and thus requires the stack to be 148 Suppress warnings from casts from a pointer to an integer type of a
148 made executable in order for the program to work properly. 149 different size.
149 150
150+@opindex Wno-poison-system-directories 151+@opindex Wno-poison-system-directories
151+@item -Wno-poison-system-directories 152+@item -Wno-poison-system-directories
@@ -155,14 +156,27 @@ index 1006510fc6a..389155f8ed5 100644
155+directories contain the correct headers and libraries for the target 156+directories contain the correct headers and libraries for the target
156+system rather than the host. 157+system rather than the host.
157+ 158+
158 @opindex Wfloat-equal 159 @opindex Winvalid-pch
159 @opindex Wno-float-equal 160 @opindex Wno-invalid-pch
160 @item -Wfloat-equal 161 @item -Winvalid-pch
161diff --git a/gcc/gcc.cc b/gcc/gcc.cc 162diff --git a/gcc/gcc.cc b/gcc/gcc.cc
162index 728332b8153..343e4915097 100644 163index 4fd87f2c4a1..79d4920a047 100644
163--- a/gcc/gcc.cc 164--- a/gcc/gcc.cc
164+++ b/gcc/gcc.cc 165+++ b/gcc/gcc.cc
165@@ -1159,6 +1159,8 @@ proper position among the other output files. */ 166@@ -909,6 +909,12 @@ proper position among the other output files. */
167 #define ASM_MAP ""
168 #endif
169
170+#ifdef POISON_BY_DEFAULT
171+#define POISON_IS_ERROR " -Werror=poison-system-directories"
172+#else
173+#define POISON_IS_ERROR
174+#endif
175+
176 /* Assembler options for compressed debug sections. */
177 #if HAVE_LD_COMPRESS_DEBUG == 0
178 /* Reject if the linker cannot write compressed debug sections. */
179@@ -1166,6 +1172,8 @@ proper position among the other output files. */
166 "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \ 180 "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
167 "%X %{o*} %{e*} %{N} %{n} %{r}\ 181 "%X %{o*} %{e*} %{N} %{n} %{r}\
168 %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \ 182 %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
@@ -171,22 +185,26 @@ index 728332b8153..343e4915097 100644
171 %{static|no-pie|static-pie:} %@{L*} %(link_libgcc) " \ 185 %{static|no-pie|static-pie:} %@{L*} %(link_libgcc) " \
172 VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \ 186 VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \
173 %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\ 187 %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
174@@ -1260,8 +1262,11 @@ static const char *cpp_unique_options = 188@@ -1268,7 +1276,7 @@ static const char *cpp_options =
175 static const char *cpp_options =
176 "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\ 189 "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\
177 %{f*} %{g*:%{%:debug-level-gt(0):%{g*}\ 190 %{f*} %{g*:%{%:debug-level-gt(0):%{g*}\
178- %{!fno-working-directory:-fworking-directory}}} %{O*}\ 191 %{!fno-working-directory:-fworking-directory}}} %{O*}\
179- %{undef} %{save-temps*:-fpch-preprocess}"; 192- %{undef} %{save-temps*:-fpch-preprocess}";
180+ %{!fno-working-directory:-fworking-directory}}} %{O*}" 193+ %{undef} %{save-temps*:-fpch-preprocess}" POISON_IS_ERROR;
181+#ifdef POISON_BY_DEFAULT
182+ " -Werror=poison-system-directories"
183+#endif
184+ " %{undef} %{save-temps*:-fpch-preprocess}";
185 194
186 /* Pass -d* flags, possibly modifying -dumpdir, -dumpbase et al. 195 /* Pass -d* flags, possibly modifying -dumpdir, -dumpbase et al.
187 196
197@@ -1297,7 +1305,7 @@ static const char *cc1_options =
198 %{coverage:-fprofile-arcs -ftest-coverage}\
199 %{fprofile-arcs|fcondition-coverage|fpath-coverage|fprofile-generate*|coverage:\
200 %{!fprofile-update=single:\
201- %{pthread:-fprofile-update=prefer-atomic}}}";
202+ %{pthread:-fprofile-update=prefer-atomic}}}" POISON_IS_ERROR;
203
204 static const char *asm_options =
205 "%{-target-help:%:print-asm-header()} "
188diff --git a/gcc/incpath.cc b/gcc/incpath.cc 206diff --git a/gcc/incpath.cc b/gcc/incpath.cc
189index 64cdd2f4a1b..e572d98ab17 100644 207index c1bbfd3872a..2cdbebc4c50 100644
190--- a/gcc/incpath.cc 208--- a/gcc/incpath.cc
191+++ b/gcc/incpath.cc 209+++ b/gcc/incpath.cc
192@@ -26,6 +26,7 @@ 210@@ -26,6 +26,7 @@
@@ -197,9 +215,20 @@ index 64cdd2f4a1b..e572d98ab17 100644
197 215
198 /* Microsoft Windows does not natively support inodes. 216 /* Microsoft Windows does not natively support inodes.
199 VMS has non-numeric inodes. */ 217 VMS has non-numeric inodes. */
200@@ -399,6 +400,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose) 218@@ -273,6 +274,10 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
219 cur->name, xstrerror (errno));
220 reason = REASON_NOENT;
221 }
222+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
223+ pcur = &cur->next;
224+ continue;
225+#endif
226 }
227 else if (!S_ISDIR (st.st_mode))
228 cpp_error_with_line (pfile, CPP_DL_WARNING, 0, 0,
229@@ -411,6 +416,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
230 fprintf (stderr, _("End of #embed search list.\n"));
201 } 231 }
202 fprintf (stderr, _("End of search list.\n"));
203 } 232 }
204+ 233+
205+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES 234+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
diff --git a/meta/recipes-devtools/gcc/gcc/0003-64-bit-multilib-hack.patch b/meta/recipes-devtools/gcc/gcc/0003-64-bit-multilib-hack.patch
index dfd370aba9..0c9edf189e 100644
--- a/meta/recipes-devtools/gcc/gcc/0003-64-bit-multilib-hack.patch
+++ b/meta/recipes-devtools/gcc/gcc/0003-64-bit-multilib-hack.patch
@@ -1,4 +1,4 @@
1From 25bc008191c9b518f30e3ed87e204e25bdafb854 Mon Sep 17 00:00:00 2001 1From a4f799209882107726f547a4637659068ae07476 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
@@ -38,7 +38,7 @@ Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
38 6 files changed, 15 insertions(+), 42 deletions(-) 38 6 files changed, 15 insertions(+), 42 deletions(-)
39 39
40diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux 40diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux
41index 3f7b786ecbb..a6c1c92fc7f 100644 41index 70e36b3299e..4267c32763c 100644
42--- a/gcc/config/aarch64/t-aarch64-linux 42--- a/gcc/config/aarch64/t-aarch64-linux
43+++ b/gcc/config/aarch64/t-aarch64-linux 43+++ b/gcc/config/aarch64/t-aarch64-linux
44@@ -21,8 +21,8 @@ 44@@ -21,8 +21,8 @@
@@ -55,7 +55,7 @@ index 3f7b786ecbb..a6c1c92fc7f 100644
55-MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32) 55-MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
56+#MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32) 56+#MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
57diff --git a/gcc/config/arc/t-multilib-linux b/gcc/config/arc/t-multilib-linux 57diff --git a/gcc/config/arc/t-multilib-linux b/gcc/config/arc/t-multilib-linux
58index 07bc77ba34a..f7e2e3919cf 100644 58index e72687260eb..f701fa9e201 100644
59--- a/gcc/config/arc/t-multilib-linux 59--- a/gcc/config/arc/t-multilib-linux
60+++ b/gcc/config/arc/t-multilib-linux 60+++ b/gcc/config/arc/t-multilib-linux
61@@ -16,9 +16,9 @@ 61@@ -16,9 +16,9 @@
@@ -71,7 +71,7 @@ index 07bc77ba34a..f7e2e3919cf 100644
71 # Aliases: 71 # Aliases:
72 MULTILIB_MATCHES += mcpu?arc700=mA7 72 MULTILIB_MATCHES += mcpu?arc700=mA7
73diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64 73diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
74index f9edc289e57..047d8e4aff9 100644 74index 64a4a20e64f..2666e731dd6 100644
75--- a/gcc/config/i386/t-linux64 75--- a/gcc/config/i386/t-linux64
76+++ b/gcc/config/i386/t-linux64 76+++ b/gcc/config/i386/t-linux64
77@@ -32,7 +32,5 @@ 77@@ -32,7 +32,5 @@
@@ -85,7 +85,7 @@ index f9edc289e57..047d8e4aff9 100644
85+MULTILIB_DIRNAMES = . . 85+MULTILIB_DIRNAMES = . .
86+MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) 86+MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
87diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64 87diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64
88index e4e2f5eaedb..c503974de37 100644 88index 34a84461ebb..431a6b5183f 100644
89--- a/gcc/config/mips/t-linux64 89--- a/gcc/config/mips/t-linux64
90+++ b/gcc/config/mips/t-linux64 90+++ b/gcc/config/mips/t-linux64
91@@ -17,29 +17,5 @@ 91@@ -17,29 +17,5 @@
@@ -134,7 +134,7 @@ index a6f64f88d25..0e21db58f7d 100644
134-MULTIARCH_DIRNAME := $(call if_multiarch,$(firstword $(subst -, ,$(target)))-linux-gnu) 134-MULTIARCH_DIRNAME := $(call if_multiarch,$(firstword $(subst -, ,$(target)))-linux-gnu)
135+#MULTIARCH_DIRNAME := $(call if_multiarch,$(firstword $(subst -, ,$(target)))-linux-gnu) 135+#MULTIARCH_DIRNAME := $(call if_multiarch,$(firstword $(subst -, ,$(target)))-linux-gnu)
136diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64 136diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
137index 248b5891e36..379689561a7 100644 137index f56b47c268e..c408c32d8f4 100644
138--- a/gcc/config/rs6000/t-linux64 138--- a/gcc/config/rs6000/t-linux64
139+++ b/gcc/config/rs6000/t-linux64 139+++ b/gcc/config/rs6000/t-linux64
140@@ -26,10 +26,9 @@ 140@@ -26,10 +26,9 @@
diff --git a/meta/recipes-devtools/gcc/gcc/0004-Pass-CXXFLAGS_FOR_BUILD-in-a-couple-of-places-to-avo.patch b/meta/recipes-devtools/gcc/gcc/0004-Pass-CXXFLAGS_FOR_BUILD-in-a-couple-of-places-to-avo.patch
index 35e92a6a9e..03139326c9 100644
--- a/meta/recipes-devtools/gcc/gcc/0004-Pass-CXXFLAGS_FOR_BUILD-in-a-couple-of-places-to-avo.patch
+++ b/meta/recipes-devtools/gcc/gcc/0004-Pass-CXXFLAGS_FOR_BUILD-in-a-couple-of-places-to-avo.patch
@@ -1,4 +1,4 @@
1From 5bef09b829ab8042acc045474cf10f4c4fb15dd5 Mon Sep 17 00:00:00 2001 1From bcc97c2c8558cd5d3879a907a216eb0e2008c976 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] Pass CXXFLAGS_FOR_BUILD in a couple of places to avoid these 4Subject: [PATCH] Pass CXXFLAGS_FOR_BUILD in a couple of places to avoid these
@@ -23,7 +23,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
23 2 files changed, 4 insertions(+) 23 2 files changed, 4 insertions(+)
24 24
25diff --git a/Makefile.in b/Makefile.in 25diff --git a/Makefile.in b/Makefile.in
26index db4fa6c6260..dee862be8a5 100644 26index b1ed67d3d4f..4d7f45455a3 100644
27--- a/Makefile.in 27--- a/Makefile.in
28+++ b/Makefile.in 28+++ b/Makefile.in
29@@ -179,6 +179,7 @@ BUILD_EXPORTS = \ 29@@ -179,6 +179,7 @@ BUILD_EXPORTS = \
@@ -34,7 +34,7 @@ index db4fa6c6260..dee862be8a5 100644
34 LDFLAGS="$(LDFLAGS_FOR_BUILD)" 34 LDFLAGS="$(LDFLAGS_FOR_BUILD)"
35 35
36 # 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.
37@@ -211,6 +212,7 @@ HOST_EXPORTS = \ 37@@ -212,6 +213,7 @@ HOST_EXPORTS = \
38 CPP_FOR_BUILD="$(CPP_FOR_BUILD)"; export CPP_FOR_BUILD; \ 38 CPP_FOR_BUILD="$(CPP_FOR_BUILD)"; export CPP_FOR_BUILD; \
39 CPPFLAGS_FOR_BUILD="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS_FOR_BUILD; \ 39 CPPFLAGS_FOR_BUILD="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS_FOR_BUILD; \
40 CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \ 40 CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \
@@ -43,7 +43,7 @@ index db4fa6c6260..dee862be8a5 100644
43 DSYMUTIL="$(DSYMUTIL)"; export DSYMUTIL; \ 43 DSYMUTIL="$(DSYMUTIL)"; export DSYMUTIL; \
44 LD="$(LD)"; export LD; \ 44 LD="$(LD)"; export LD; \
45diff --git a/Makefile.tpl b/Makefile.tpl 45diff --git a/Makefile.tpl b/Makefile.tpl
46index 1d5813cd569..ff0fae53b0c 100644 46index 7dccf91ed8e..7cb61bf63ea 100644
47--- a/Makefile.tpl 47--- a/Makefile.tpl
48+++ b/Makefile.tpl 48+++ b/Makefile.tpl
49@@ -182,6 +182,7 @@ BUILD_EXPORTS = \ 49@@ -182,6 +182,7 @@ BUILD_EXPORTS = \
@@ -54,7 +54,7 @@ index 1d5813cd569..ff0fae53b0c 100644
54 LDFLAGS="$(LDFLAGS_FOR_BUILD)" 54 LDFLAGS="$(LDFLAGS_FOR_BUILD)"
55 55
56 # 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.
57@@ -214,6 +215,7 @@ HOST_EXPORTS = \ 57@@ -215,6 +216,7 @@ HOST_EXPORTS = \
58 CPP_FOR_BUILD="$(CPP_FOR_BUILD)"; export CPP_FOR_BUILD; \ 58 CPP_FOR_BUILD="$(CPP_FOR_BUILD)"; export CPP_FOR_BUILD; \
59 CPPFLAGS_FOR_BUILD="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS_FOR_BUILD; \ 59 CPPFLAGS_FOR_BUILD="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS_FOR_BUILD; \
60 CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \ 60 CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \
diff --git a/meta/recipes-devtools/gcc/gcc/0005-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch b/meta/recipes-devtools/gcc/gcc/0005-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
index 8c6ae38e95..e8e829d9f5 100644
--- a/meta/recipes-devtools/gcc/gcc/0005-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
+++ b/meta/recipes-devtools/gcc/gcc/0005-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
@@ -1,4 +1,4 @@
1From fd3f513fa7e4f63a2b28b31ed5a4ddf8f5c543c0 Mon Sep 17 00:00:00 2001 1From fd6aa3c3ff5361a738b31d6127cb05910cd6b8c0 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,10 +26,10 @@ 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 a74761b7ab3..956437df95b 100644 29index 55b4cd7dbed..5546e259a20 100644
30--- a/gcc/Makefile.in 30--- a/gcc/Makefile.in
31+++ b/gcc/Makefile.in 31+++ b/gcc/Makefile.in
32@@ -590,7 +590,7 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@ 32@@ -596,7 +596,7 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
33 TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@ 33 TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
34 34
35 xmake_file=@xmake_file@ 35 xmake_file=@xmake_file@
@@ -39,10 +39,10 @@ index a74761b7ab3..956437df95b 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 3c346acbce0..3870d6e9b6d 100755 42index 0f4a5d52c30..a2a8761055c 100755
43--- a/gcc/configure 43--- a/gcc/configure
44+++ b/gcc/configure 44+++ b/gcc/configure
45@@ -15155,8 +15155,8 @@ for f in $tm_file; do 45@@ -15106,8 +15106,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 3c346acbce0..3870d6e9b6d 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 4d8123085b8..15670de1706 100644 57index b0e3615e5aa..58ad9dc01fe 100644
58--- a/gcc/configure.ac 58--- a/gcc/configure.ac
59+++ b/gcc/configure.ac 59+++ b/gcc/configure.ac
60@@ -2383,8 +2383,8 @@ for f in $tm_file; do 60@@ -2426,8 +2426,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 )
@@ -69,7 +69,7 @@ index 4d8123085b8..15670de1706 100644
69 * ) 69 * )
70 tm_file_list="${tm_file_list} \$(srcdir)/config/$f" 70 tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
71diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh 71diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
72index 1b015b70b38..145af56745e 100644 72index e02466b4416..0ea1a0c9ca6 100644
73--- a/gcc/mkconfig.sh 73--- a/gcc/mkconfig.sh
74+++ b/gcc/mkconfig.sh 74+++ b/gcc/mkconfig.sh
75@@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then 75@@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then
diff --git a/meta/recipes-devtools/gcc/gcc/0006-cpp-honor-sysroot.patch b/meta/recipes-devtools/gcc/gcc/0006-cpp-honor-sysroot.patch
index e0d6aea46b..26476de33f 100644
--- a/meta/recipes-devtools/gcc/gcc/0006-cpp-honor-sysroot.patch
+++ b/meta/recipes-devtools/gcc/gcc/0006-cpp-honor-sysroot.patch
@@ -1,4 +1,4 @@
1From 970960876045c99011658836f385c6f4d6d78fa6 Mon Sep 17 00:00:00 2001 1From b931ab5282cc11627b6f68a6477b79f41ae80b3a 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:22:00 +0400 3Date: Fri, 29 Mar 2013 09:22:00 +0400
4Subject: [PATCH] cpp: honor sysroot. 4Subject: [PATCH] cpp: honor sysroot.
@@ -26,10 +26,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
26 2 files changed, 2 insertions(+), 2 deletions(-) 26 2 files changed, 2 insertions(+), 2 deletions(-)
27 27
28diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h 28diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h
29index 7a7f5ff0ab5..fb3d88cdb11 100644 29index a67ce4c22a5..ce07a1c4b1d 100644
30--- a/gcc/cp/lang-specs.h 30--- a/gcc/cp/lang-specs.h
31+++ b/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 32@@ -122,7 +122,7 @@ along with GCC; see the file COPYING3. If not see
33 {".ii", "@c++-cpp-output", 0, 0, 0}, 33 {".ii", "@c++-cpp-output", 0, 0, 0},
34 {"@c++-cpp-output", 34 {"@c++-cpp-output",
35 "%{!E:%{!M:%{!MM:" 35 "%{!E:%{!M:%{!MM:"
@@ -39,10 +39,10 @@ index 7a7f5ff0ab5..fb3d88cdb11 100644
39 " %{fmodule-only:%{!S:-o %g.s%V}}" 39 " %{fmodule-only:%{!S:-o %g.s%V}}"
40 " %{!fmodule-only:%{!fmodule-header*:%(invoke_as)}}}" 40 " %{!fmodule-only:%{!fmodule-header*:%(invoke_as)}}}"
41diff --git a/gcc/gcc.cc b/gcc/gcc.cc 41diff --git a/gcc/gcc.cc b/gcc/gcc.cc
42index 343e4915097..e3e9374d1cc 100644 42index 79d4920a047..c1488865b8b 100644
43--- a/gcc/gcc.cc 43--- a/gcc/gcc.cc
44+++ b/gcc/gcc.cc 44+++ b/gcc/gcc.cc
45@@ -1487,7 +1487,7 @@ static const struct compiler default_compilers[] = 45@@ -1497,7 +1497,7 @@ static const struct compiler default_compilers[] =
46 %W{o*:--output-pch %w%*}}%{!S:%V}}}}}}}}", 0, 0, 0}, 46 %W{o*:--output-pch %w%*}}%{!S:%V}}}}}}}}", 0, 0, 0},
47 {".i", "@cpp-output", 0, 0, 0}, 47 {".i", "@cpp-output", 0, 0, 0},
48 {"@cpp-output", 48 {"@cpp-output",
diff --git a/meta/recipes-devtools/gcc/gcc/0007-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch b/meta/recipes-devtools/gcc/gcc/0007-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
index eacdbd1dbe..2b727b09af 100644
--- a/meta/recipes-devtools/gcc/gcc/0007-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
+++ b/meta/recipes-devtools/gcc/gcc/0007-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
@@ -1,4 +1,4 @@
1From bce0b7e2e130a069a93c839b856aa19b64d5ca54 Mon Sep 17 00:00:00 2001 1From d9513f8c3fa3f228358fd4d0716941e84bda413e 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
@@ -25,7 +25,6 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
25 gcc/config/loongarch/gnu-user.h | 4 ++-- 25 gcc/config/loongarch/gnu-user.h | 4 ++--
26 gcc/config/microblaze/linux.h | 4 ++-- 26 gcc/config/microblaze/linux.h | 4 ++--
27 gcc/config/mips/linux.h | 18 +++++++++--------- 27 gcc/config/mips/linux.h | 18 +++++++++---------
28 gcc/config/nios2/linux.h | 4 ++--
29 gcc/config/riscv/linux.h | 4 ++-- 28 gcc/config/riscv/linux.h | 4 ++--
30 gcc/config/rs6000/linux64.h | 15 +++++---------- 29 gcc/config/rs6000/linux64.h | 15 +++++----------
31 gcc/config/rs6000/sysv4.h | 4 ++-- 30 gcc/config/rs6000/sysv4.h | 4 ++--
@@ -33,10 +32,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
33 gcc/config/sh/linux.h | 4 ++-- 32 gcc/config/sh/linux.h | 4 ++--
34 gcc/config/sparc/linux.h | 2 +- 33 gcc/config/sparc/linux.h | 2 +-
35 gcc/config/sparc/linux64.h | 4 ++-- 34 gcc/config/sparc/linux64.h | 4 ++--
36 18 files changed, 53 insertions(+), 58 deletions(-) 35 17 files changed, 51 insertions(+), 56 deletions(-)
37 36
38diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h 37diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
39index 8e51c8202cc..732e4f4a477 100644 38index 116bb4e69f3..c0de4900dc2 100644
40--- a/gcc/config/aarch64/aarch64-linux.h 39--- a/gcc/config/aarch64/aarch64-linux.h
41+++ b/gcc/config/aarch64/aarch64-linux.h 40+++ b/gcc/config/aarch64/aarch64-linux.h
42@@ -21,10 +21,10 @@ 41@@ -21,10 +21,10 @@
@@ -53,7 +52,7 @@ index 8e51c8202cc..732e4f4a477 100644
53 #undef ASAN_CC1_SPEC 52 #undef ASAN_CC1_SPEC
54 #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}" 53 #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
55diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h 54diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
56index 40ccf0bd9b4..ab5c59655fc 100644 55index 3fd3b831166..6471fa32b0b 100644
57--- a/gcc/config/alpha/linux-elf.h 56--- a/gcc/config/alpha/linux-elf.h
58+++ b/gcc/config/alpha/linux-elf.h 57+++ b/gcc/config/alpha/linux-elf.h
59@@ -23,8 +23,8 @@ along with GCC; see the file COPYING3. If not see 58@@ -23,8 +23,8 @@ along with GCC; see the file COPYING3. If not see
@@ -68,10 +67,10 @@ index 40ccf0bd9b4..ab5c59655fc 100644
68 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" 67 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
69 #elif DEFAULT_LIBC == LIBC_GLIBC 68 #elif DEFAULT_LIBC == LIBC_GLIBC
70diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h 69diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
71index eef791f6a02..335cb4c3607 100644 70index 8ef5643b5d6..76893197773 100644
72--- a/gcc/config/arm/linux-eabi.h 71--- a/gcc/config/arm/linux-eabi.h
73+++ b/gcc/config/arm/linux-eabi.h 72+++ b/gcc/config/arm/linux-eabi.h
74@@ -62,8 +62,8 @@ 73@@ -65,8 +65,8 @@
75 GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */ 74 GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */
76 75
77 #undef GLIBC_DYNAMIC_LINKER 76 #undef GLIBC_DYNAMIC_LINKER
@@ -82,7 +81,7 @@ index eef791f6a02..335cb4c3607 100644
82 #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT 81 #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
83 82
84 #define GLIBC_DYNAMIC_LINKER \ 83 #define GLIBC_DYNAMIC_LINKER \
85@@ -86,7 +86,7 @@ 84@@ -89,7 +89,7 @@
86 #define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}" 85 #define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
87 #endif 86 #endif
88 #define MUSL_DYNAMIC_LINKER \ 87 #define MUSL_DYNAMIC_LINKER \
@@ -92,7 +91,7 @@ index eef791f6a02..335cb4c3607 100644
92 /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to 91 /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
93 use the GNU/Linux version, not the generic BPABI version. */ 92 use the GNU/Linux version, not the generic BPABI version. */
94diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h 93diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
95index ccae8abf6f6..ea421d03891 100644 94index d4d389e2aa8..6c4b1e13463 100644
96--- a/gcc/config/arm/linux-elf.h 95--- a/gcc/config/arm/linux-elf.h
97+++ b/gcc/config/arm/linux-elf.h 96+++ b/gcc/config/arm/linux-elf.h
98@@ -60,7 +60,7 @@ 97@@ -60,7 +60,7 @@
@@ -105,7 +104,7 @@ index ccae8abf6f6..ea421d03891 100644
105 #define LINUX_TARGET_LINK_SPEC "%{h*} \ 104 #define LINUX_TARGET_LINK_SPEC "%{h*} \
106 %{static:-Bstatic} \ 105 %{static:-Bstatic} \
107diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h 106diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
108index 20a96d56e65..7a7a4f873e4 100644 107index efbd978c610..9ea0261b0fc 100644
109--- a/gcc/config/i386/linux.h 108--- a/gcc/config/i386/linux.h
110+++ b/gcc/config/i386/linux.h 109+++ b/gcc/config/i386/linux.h
111@@ -20,7 +20,7 @@ along with GCC; see the file COPYING3. If not see 110@@ -20,7 +20,7 @@ along with GCC; see the file COPYING3. If not see
@@ -119,7 +118,7 @@ index 20a96d56e65..7a7a4f873e4 100644
119-#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1" 118-#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
120+#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-i386.so.1" 119+#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-i386.so.1"
121diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h 120diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
122index 3dd23eef5e5..960cd7c0450 100644 121index 24170ee2845..733e3e4945a 100644
123--- a/gcc/config/i386/linux64.h 122--- a/gcc/config/i386/linux64.h
124+++ b/gcc/config/i386/linux64.h 123+++ b/gcc/config/i386/linux64.h
125@@ -27,13 +27,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 124@@ -27,13 +27,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -143,7 +142,7 @@ index 3dd23eef5e5..960cd7c0450 100644
143-#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1" 142-#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
144+#define MUSL_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-musl-x32.so.1" 143+#define MUSL_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-musl-x32.so.1"
145diff --git a/gcc/config/linux.h b/gcc/config/linux.h 144diff --git a/gcc/config/linux.h b/gcc/config/linux.h
146index a7248ac90d0..e36f32bf59e 100644 145index d6280a4d4dd..c79d4902f85 100644
147--- a/gcc/config/linux.h 146--- a/gcc/config/linux.h
148+++ b/gcc/config/linux.h 147+++ b/gcc/config/linux.h
149@@ -86,10 +86,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 148@@ -86,10 +86,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -162,7 +161,7 @@ index a7248ac90d0..e36f32bf59e 100644
162 #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker" 161 #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
163 #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64" 162 #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
164diff --git a/gcc/config/loongarch/gnu-user.h b/gcc/config/loongarch/gnu-user.h 163diff --git a/gcc/config/loongarch/gnu-user.h b/gcc/config/loongarch/gnu-user.h
165index e5d84e180e3..98cb49c189f 100644 164index fbc75a90ad5..38c239940bd 100644
166--- a/gcc/config/loongarch/gnu-user.h 165--- a/gcc/config/loongarch/gnu-user.h
167+++ b/gcc/config/loongarch/gnu-user.h 166+++ b/gcc/config/loongarch/gnu-user.h
168@@ -31,7 +31,7 @@ along with GCC; see the file COPYING3. If not see 167@@ -31,7 +31,7 @@ along with GCC; see the file COPYING3. If not see
@@ -184,7 +183,7 @@ index e5d84e180e3..98cb49c189f 100644
184 #undef GNU_USER_TARGET_LINK_SPEC 183 #undef GNU_USER_TARGET_LINK_SPEC
185 #define GNU_USER_TARGET_LINK_SPEC \ 184 #define GNU_USER_TARGET_LINK_SPEC \
186diff --git a/gcc/config/microblaze/linux.h b/gcc/config/microblaze/linux.h 185diff --git a/gcc/config/microblaze/linux.h b/gcc/config/microblaze/linux.h
187index 5ed8ee518be..5553e7cac21 100644 186index 7b09cde7693..8bfafaf87f7 100644
188--- a/gcc/config/microblaze/linux.h 187--- a/gcc/config/microblaze/linux.h
189+++ b/gcc/config/microblaze/linux.h 188+++ b/gcc/config/microblaze/linux.h
190@@ -28,7 +28,7 @@ 189@@ -28,7 +28,7 @@
@@ -192,7 +191,7 @@ index 5ed8ee518be..5553e7cac21 100644
192 #define TLS_NEEDS_GOT 1 191 #define TLS_NEEDS_GOT 1
193 192
194-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" 193-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
195+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "/ld.so.1" 194+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld.so.1"
196 #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" 195 #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
197 196
198 #if TARGET_BIG_ENDIAN_DEFAULT == 0 /* LE */ 197 #if TARGET_BIG_ENDIAN_DEFAULT == 0 /* LE */
@@ -206,7 +205,7 @@ index 5ed8ee518be..5553e7cac21 100644
206 #undef SUBTARGET_EXTRA_SPECS 205 #undef SUBTARGET_EXTRA_SPECS
207 #define SUBTARGET_EXTRA_SPECS \ 206 #define SUBTARGET_EXTRA_SPECS \
208diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h 207diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
209index 8d098dd2f44..1c5ebbd26d5 100644 208index ae15d490108..0281650009d 100644
210--- a/gcc/config/mips/linux.h 209--- a/gcc/config/mips/linux.h
211+++ b/gcc/config/mips/linux.h 210+++ b/gcc/config/mips/linux.h
212@@ -22,29 +22,29 @@ along with GCC; see the file COPYING3. If not see 211@@ -22,29 +22,29 @@ along with GCC; see the file COPYING3. If not see
@@ -248,25 +247,8 @@ index 8d098dd2f44..1c5ebbd26d5 100644
248 247
249 #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32" 248 #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
250 #define GNU_USER_DYNAMIC_LINKERN32 \ 249 #define GNU_USER_DYNAMIC_LINKERN32 \
251diff --git a/gcc/config/nios2/linux.h b/gcc/config/nios2/linux.h
252index 06c442e85f4..b21a3c076c9 100644
253--- a/gcc/config/nios2/linux.h
254+++ b/gcc/config/nios2/linux.h
255@@ -29,10 +29,10 @@
256 #undef CPP_SPEC
257 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
258
259-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-nios2.so.1"
260+#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-nios2.so.1"
261
262 #undef MUSL_DYNAMIC_LINKER
263-#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-nios2.so.1"
264+#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-nios2.so.1"
265
266 #undef LINK_SPEC
267 #define LINK_SPEC LINK_SPEC_ENDIAN \
268diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h 250diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
269index 15851f653bc..d8aaab9631f 100644 251index 9060c940a44..c7712db194a 100644
270--- a/gcc/config/riscv/linux.h 252--- a/gcc/config/riscv/linux.h
271+++ b/gcc/config/riscv/linux.h 253+++ b/gcc/config/riscv/linux.h
272@@ -22,7 +22,7 @@ along with GCC; see the file COPYING3. If not see 254@@ -22,7 +22,7 @@ along with GCC; see the file COPYING3. If not see
@@ -288,7 +270,7 @@ index 15851f653bc..d8aaab9631f 100644
288 #define ICACHE_FLUSH_FUNC "__riscv_flush_icache" 270 #define ICACHE_FLUSH_FUNC "__riscv_flush_icache"
289 271
290diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h 272diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
291index 655d1054d76..a11ae7643b7 100644 273index 0316d8cb65d..8de5eb8bb49 100644
292--- a/gcc/config/rs6000/linux64.h 274--- a/gcc/config/rs6000/linux64.h
293+++ b/gcc/config/rs6000/linux64.h 275+++ b/gcc/config/rs6000/linux64.h
294@@ -340,24 +340,19 @@ extern int dot_symbols; 276@@ -340,24 +340,19 @@ extern int dot_symbols;
@@ -322,10 +304,10 @@ index 655d1054d76..a11ae7643b7 100644
322 #undef DEFAULT_ASM_ENDIAN 304 #undef DEFAULT_ASM_ENDIAN
323 #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN) 305 #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
324diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h 306diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
325index bcafa9d0cf4..8fda952e69c 100644 307index afb5c6ad867..3eb6c814ced 100644
326--- a/gcc/config/rs6000/sysv4.h 308--- a/gcc/config/rs6000/sysv4.h
327+++ b/gcc/config/rs6000/sysv4.h 309+++ b/gcc/config/rs6000/sysv4.h
328@@ -771,10 +771,10 @@ GNU_USER_TARGET_CC1_SPEC 310@@ -772,10 +772,10 @@ GNU_USER_TARGET_CC1_SPEC
329 311
330 #define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","") 312 #define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","")
331 313
@@ -339,7 +321,7 @@ index bcafa9d0cf4..8fda952e69c 100644
339 #ifndef GNU_USER_DYNAMIC_LINKER 321 #ifndef GNU_USER_DYNAMIC_LINKER
340 #define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER 322 #define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
341diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h 323diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
342index 83ea2f669a0..bc7cffbad3f 100644 324index 2c3bca5dfcb..1332624abad 100644
343--- a/gcc/config/s390/linux.h 325--- a/gcc/config/s390/linux.h
344+++ b/gcc/config/s390/linux.h 326+++ b/gcc/config/s390/linux.h
345@@ -72,13 +72,13 @@ along with GCC; see the file COPYING3. If not see 327@@ -72,13 +72,13 @@ along with GCC; see the file COPYING3. If not see
@@ -361,7 +343,7 @@ index 83ea2f669a0..bc7cffbad3f 100644
361 #undef LINK_SPEC 343 #undef LINK_SPEC
362 #define LINK_SPEC \ 344 #define LINK_SPEC \
363diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h 345diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h
364index 34cbbed633f..14000d3394c 100644 346index 78a7905a919..28493851982 100644
365--- a/gcc/config/sh/linux.h 347--- a/gcc/config/sh/linux.h
366+++ b/gcc/config/sh/linux.h 348+++ b/gcc/config/sh/linux.h
367@@ -61,10 +61,10 @@ along with GCC; see the file COPYING3. If not see 349@@ -61,10 +61,10 @@ along with GCC; see the file COPYING3. If not see
@@ -378,7 +360,7 @@ index 34cbbed633f..14000d3394c 100644
378 #undef SUBTARGET_LINK_EMUL_SUFFIX 360 #undef SUBTARGET_LINK_EMUL_SUFFIX
379 #define SUBTARGET_LINK_EMUL_SUFFIX "%{mfdpic:_fd;:_linux}" 361 #define SUBTARGET_LINK_EMUL_SUFFIX "%{mfdpic:_fd;:_linux}"
380diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h 362diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
381index 9646fa9c41e..396fb047fac 100644 363index 6d928846895..cd35dc8fa30 100644
382--- a/gcc/config/sparc/linux.h 364--- a/gcc/config/sparc/linux.h
383+++ b/gcc/config/sparc/linux.h 365+++ b/gcc/config/sparc/linux.h
384@@ -78,7 +78,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); 366@@ -78,7 +78,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
@@ -391,7 +373,7 @@ index 9646fa9c41e..396fb047fac 100644
391 #undef LINK_SPEC 373 #undef LINK_SPEC
392 #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \ 374 #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
393diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h 375diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
394index 1e2e4aef2ad..25fcc37eca2 100644 376index 97d5012f43f..65162c7c300 100644
395--- a/gcc/config/sparc/linux64.h 377--- a/gcc/config/sparc/linux64.h
396+++ b/gcc/config/sparc/linux64.h 378+++ b/gcc/config/sparc/linux64.h
397@@ -78,8 +78,8 @@ along with GCC; see the file COPYING3. If not see 379@@ -78,8 +78,8 @@ along with GCC; see the file COPYING3. If not see
diff --git a/meta/recipes-devtools/gcc/gcc/0008-libtool.patch b/meta/recipes-devtools/gcc/gcc/0008-libtool.patch
index 9b78377493..f24bb2acf0 100644
--- a/meta/recipes-devtools/gcc/gcc/0008-libtool.patch
+++ b/meta/recipes-devtools/gcc/gcc/0008-libtool.patch
@@ -1,4 +1,4 @@
1From 869295f6f1095b6334c1ea34f8d11a676c67e256 Mon Sep 17 00:00:00 2001 1From 7108016f82a3ce9d275b5d0f37dbde422de6ab15 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
@@ -22,10 +22,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
22 1 file changed, 4 insertions(+) 22 1 file changed, 4 insertions(+)
23 23
24diff --git a/ltmain.sh b/ltmain.sh 24diff --git a/ltmain.sh b/ltmain.sh
25index 70990740b6c..ee938056bef 100644 25index 1a710177fb2..e8474602b0b 100644
26--- a/ltmain.sh 26--- a/ltmain.sh
27+++ b/ltmain.sh 27+++ b/ltmain.sh
28@@ -6359,6 +6359,10 @@ func_mode_link () 28@@ -6381,6 +6381,10 @@ func_mode_link ()
29 func_warning "ignoring multiple \`-rpath's for a libtool library" 29 func_warning "ignoring multiple \`-rpath's for a libtool library"
30 30
31 install_libdir="$1" 31 install_libdir="$1"
diff --git a/meta/recipes-devtools/gcc/gcc/0009-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 3e24e53d7b..215a599cb8 100644
--- a/meta/recipes-devtools/gcc/gcc/0009-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 19279e08417124b4567fafdf9300b779ce1a1e1c Mon Sep 17 00:00:00 2001 1From 135523bfabbd37cc6326da1a7ec3cd8bc7387439 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.
@@ -18,10 +18,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
18 1 file changed, 5 insertions(+), 1 deletion(-) 18 1 file changed, 5 insertions(+), 1 deletion(-)
19 19
20diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h 20diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
21index 335cb4c3607..1d5235075cb 100644 21index 76893197773..12c334463c6 100644
22--- a/gcc/config/arm/linux-eabi.h 22--- a/gcc/config/arm/linux-eabi.h
23+++ b/gcc/config/arm/linux-eabi.h 23+++ b/gcc/config/arm/linux-eabi.h
24@@ -88,10 +88,14 @@ 24@@ -91,10 +91,14 @@
25 #define MUSL_DYNAMIC_LINKER \ 25 #define MUSL_DYNAMIC_LINKER \
26 SYSTEMLIBS_DIR "ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.so.1" 26 SYSTEMLIBS_DIR "ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.so.1"
27 27
diff --git a/meta/recipes-devtools/gcc/gcc/0010-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 c3484360ee..c3c4212115 100644
--- a/meta/recipes-devtools/gcc/gcc/0010-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 7e5706e74643d8bf78b117620849e546a31295c5 Mon Sep 17 00:00:00 2001 1From 2ede6edb029ef3d98f3ead90f7be54b71cb42ae2 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 3870d6e9b6d..07a0b8571d2 100755 21index a2a8761055c..a5a028f39c3 100755
22--- a/gcc/configure 22--- a/gcc/configure
23+++ b/gcc/configure 23+++ b/gcc/configure
24@@ -15135,10 +15135,20 @@ done 24@@ -15086,10 +15086,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 3870d6e9b6d..07a0b8571d2 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@@ -15149,6 +15159,10 @@ tm_file_list="options.h" 49@@ -15100,6 +15110,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 3870d6e9b6d..07a0b8571d2 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 15670de1706..fd96dd7ba49 100644 61index 58ad9dc01fe..36ed7153398 100644
62--- a/gcc/configure.ac 62--- a/gcc/configure.ac
63+++ b/gcc/configure.ac 63+++ b/gcc/configure.ac
64@@ -2363,10 +2363,20 @@ done 64@@ -2406,10 +2406,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 15670de1706..fd96dd7ba49 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@@ -2377,6 +2387,10 @@ tm_file_list="options.h" 89@@ -2420,6 +2430,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/0011-aarch64-Fix-include-paths-when-S-B.patch b/meta/recipes-devtools/gcc/gcc/0011-aarch64-Fix-include-paths-when-S-B.patch
index 8633f7c436..9e05277515 100644
--- a/meta/recipes-devtools/gcc/gcc/0011-aarch64-Fix-include-paths-when-S-B.patch
+++ b/meta/recipes-devtools/gcc/gcc/0011-aarch64-Fix-include-paths-when-S-B.patch
@@ -1,4 +1,4 @@
1From 0671715ae6d411b5d2d4c53fee42a6e9fe2562c2 Mon Sep 17 00:00:00 2001 1From a60798dd091f46dbb5f2fa9cf7655b41e9431a73 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 31 Jan 2023 22:03:38 -0800 3Date: Tue, 31 Jan 2023 22:03:38 -0800
4Subject: [PATCH] aarch64: Fix include paths when S != B 4Subject: [PATCH] aarch64: Fix include paths when S != B
@@ -28,10 +28,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
28 1 file changed, 7 insertions(+), 7 deletions(-) 28 1 file changed, 7 insertions(+), 7 deletions(-)
29 29
30diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h 30diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
31index 45e901cda64..591062d4b39 100644 31index e8bd8c73c12..6ea05b64601 100644
32--- a/gcc/config/aarch64/aarch64.h 32--- a/gcc/config/aarch64/aarch64.h
33+++ b/gcc/config/aarch64/aarch64.h 33+++ b/gcc/config/aarch64/aarch64.h
34@@ -170,9 +170,9 @@ enum class aarch64_feature : unsigned char { 34@@ -163,9 +163,9 @@ enum class aarch64_feature : unsigned char {
35 #define DEF_AARCH64_ISA_MODE(IDENT) IDENT, 35 #define DEF_AARCH64_ISA_MODE(IDENT) IDENT,
36 #define AARCH64_OPT_EXTENSION(A, IDENT, C, D, E, F) IDENT, 36 #define AARCH64_OPT_EXTENSION(A, IDENT, C, D, E, F) IDENT,
37 #define AARCH64_ARCH(A, B, IDENT, D, E) IDENT, 37 #define AARCH64_ARCH(A, B, IDENT, D, E) IDENT,
@@ -44,7 +44,7 @@ index 45e901cda64..591062d4b39 100644
44 }; 44 };
45 45
46 /* Define unique flags for each of the above. */ 46 /* Define unique flags for each of the above. */
47@@ -182,16 +182,16 @@ enum class aarch64_feature : unsigned char { 47@@ -175,16 +175,16 @@ enum class aarch64_feature : unsigned char {
48 #define DEF_AARCH64_ISA_MODE(IDENT) HANDLE (IDENT) 48 #define DEF_AARCH64_ISA_MODE(IDENT) HANDLE (IDENT)
49 #define AARCH64_OPT_EXTENSION(A, IDENT, C, D, E, F) HANDLE (IDENT) 49 #define AARCH64_OPT_EXTENSION(A, IDENT, C, D, E, F) HANDLE (IDENT)
50 #define AARCH64_ARCH(A, B, IDENT, D, E) HANDLE (IDENT) 50 #define AARCH64_ARCH(A, B, IDENT, D, E) HANDLE (IDENT)
@@ -56,12 +56,12 @@ index 45e901cda64..591062d4b39 100644
56+#include "config/aarch64/aarch64-arches.def" 56+#include "config/aarch64/aarch64-arches.def"
57 #undef HANDLE 57 #undef HANDLE
58 58
59 constexpr auto AARCH64_FL_SM_STATE = AARCH64_FL_SM_ON | AARCH64_FL_SM_OFF; 59 /* Define aarch64_isa_mode masks. */
60 60 #define DEF_AARCH64_ISA_MODE(IDENT) \
61 constexpr unsigned int AARCH64_NUM_ISA_MODES = (0 61 constexpr auto AARCH64_ISA_MODE_##IDENT ATTRIBUTE_UNUSED \
62 #define DEF_AARCH64_ISA_MODE(IDENT) + 1 62 = aarch64_isa_mode (1) << int (aarch64_feature::IDENT);
63-#include "aarch64-isa-modes.def" 63-#include "aarch64-isa-modes.def"
64+#include "config/aarch64/aarch64-isa-modes.def" 64+#include "config/aarch64/aarch64-isa-modes.def"
65 ); 65 #undef HANDLE
66 66
67 /* The mask of all ISA modes. */ 67 constexpr auto AARCH64_FL_SM_STATE ATTRIBUTE_UNUSED
diff --git a/meta/recipes-devtools/gcc/gcc/0012-Avoid-using-libdir-from-.la-which-usually-points-to-.patch b/meta/recipes-devtools/gcc/gcc/0012-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
index 2f6ecd53bb..8d0c39f9ce 100644
--- a/meta/recipes-devtools/gcc/gcc/0012-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
+++ b/meta/recipes-devtools/gcc/gcc/0012-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
@@ -1,4 +1,4 @@
1From a40108180f552788bb321a853ed4d5f034866a48 Mon Sep 17 00:00:00 2001 1From 3745be5dece41bc2c633e1702980965e28888f62 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
@@ -13,10 +13,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 1 file changed, 3 insertions(+) 13 1 file changed, 3 insertions(+)
14 14
15diff --git a/ltmain.sh b/ltmain.sh 15diff --git a/ltmain.sh b/ltmain.sh
16index ee938056bef..9ebc7e3d1e0 100644 16index e8474602b0b..ef93f977a52 100644
17--- a/ltmain.sh 17--- a/ltmain.sh
18+++ b/ltmain.sh 18+++ b/ltmain.sh
19@@ -5628,6 +5628,9 @@ func_mode_link () 19@@ -5650,6 +5650,9 @@ func_mode_link ()
20 absdir="$abs_ladir" 20 absdir="$abs_ladir"
21 libdir="$abs_ladir" 21 libdir="$abs_ladir"
22 else 22 else
diff --git a/meta/recipes-devtools/gcc/gcc/0013-Ensure-target-gcc-headers-can-be-included.patch b/meta/recipes-devtools/gcc/gcc/0013-Ensure-target-gcc-headers-can-be-included.patch
index eb4f0b3045..906ef3f74b 100644
--- a/meta/recipes-devtools/gcc/gcc/0013-Ensure-target-gcc-headers-can-be-included.patch
+++ b/meta/recipes-devtools/gcc/gcc/0013-Ensure-target-gcc-headers-can-be-included.patch
@@ -1,4 +1,4 @@
1From 6ad8db533c7d53a85e6280da1ad88ed4077258fb Mon Sep 17 00:00:00 2001 1From 860aae0d1f5dce7a879690d53a6ab54c6a32107e 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,10 +25,10 @@ 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 956437df95b..6a009c696e9 100644 28index 5546e259a20..944d0a6680a 100644
29--- a/gcc/Makefile.in 29--- a/gcc/Makefile.in
30+++ b/gcc/Makefile.in 30+++ b/gcc/Makefile.in
31@@ -671,6 +671,7 @@ libexecdir = @libexecdir@ 31@@ -680,6 +680,7 @@ libexecdir = @libexecdir@
32 32
33 # Directory in which the compiler finds libraries etc. 33 # Directory in which the compiler finds libraries etc.
34 libsubdir = $(libdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix) 34 libsubdir = $(libdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
@@ -36,7 +36,7 @@ index 956437df95b..6a009c696e9 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@@ -3199,6 +3200,7 @@ CFLAGS-intl.o += -DLOCALEDIR=\"$(localedir)\" 39@@ -3397,6 +3398,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\" \
@@ -45,7 +45,7 @@ index 956437df95b..6a009c696e9 100644
45 -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \ 45 -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
46 -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \ 46 -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \
47diff --git a/gcc/config/linux.h b/gcc/config/linux.h 47diff --git a/gcc/config/linux.h b/gcc/config/linux.h
48index e36f32bf59e..c6aada42eb7 100644 48index c79d4902f85..640def63c27 100644
49--- a/gcc/config/linux.h 49--- a/gcc/config/linux.h
50+++ b/gcc/config/linux.h 50+++ b/gcc/config/linux.h
51@@ -157,6 +157,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 51@@ -157,6 +157,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -71,10 +71,10 @@ index e36f32bf59e..c6aada42eb7 100644
71 { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \ 71 { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
72 { 0, 0, 0, 0, 0, 0 } \ 72 { 0, 0, 0, 0, 0, 0 } \
73diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h 73diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
74index 8fda952e69c..247acec9d8e 100644 74index 3eb6c814ced..d534b9d2295 100644
75--- a/gcc/config/rs6000/sysv4.h 75--- a/gcc/config/rs6000/sysv4.h
76+++ b/gcc/config/rs6000/sysv4.h 76+++ b/gcc/config/rs6000/sysv4.h
77@@ -986,6 +986,13 @@ ncrtn.o%s" 77@@ -987,6 +987,13 @@ ncrtn.o%s"
78 #define INCLUDE_DEFAULTS_MUSL_TOOL 78 #define INCLUDE_DEFAULTS_MUSL_TOOL
79 #endif 79 #endif
80 80
@@ -88,7 +88,7 @@ index 8fda952e69c..247acec9d8e 100644
88 #ifdef NATIVE_SYSTEM_HEADER_DIR 88 #ifdef NATIVE_SYSTEM_HEADER_DIR
89 #define INCLUDE_DEFAULTS_MUSL_NATIVE \ 89 #define INCLUDE_DEFAULTS_MUSL_NATIVE \
90 { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ 90 { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
91@@ -1012,6 +1019,7 @@ ncrtn.o%s" 91@@ -1013,6 +1020,7 @@ ncrtn.o%s"
92 INCLUDE_DEFAULTS_MUSL_PREFIX \ 92 INCLUDE_DEFAULTS_MUSL_PREFIX \
93 INCLUDE_DEFAULTS_MUSL_CROSS \ 93 INCLUDE_DEFAULTS_MUSL_CROSS \
94 INCLUDE_DEFAULTS_MUSL_TOOL \ 94 INCLUDE_DEFAULTS_MUSL_TOOL \
@@ -97,7 +97,7 @@ index 8fda952e69c..247acec9d8e 100644
97 { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \ 97 { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
98 { 0, 0, 0, 0, 0, 0 } \ 98 { 0, 0, 0, 0, 0, 0 } \
99diff --git a/gcc/cppdefault.cc b/gcc/cppdefault.cc 99diff --git a/gcc/cppdefault.cc b/gcc/cppdefault.cc
100index f82b4badad7..98bd66f95c6 100644 100index f98c39c53ec..db1e517fadc 100644
101--- a/gcc/cppdefault.cc 101--- a/gcc/cppdefault.cc
102+++ b/gcc/cppdefault.cc 102+++ b/gcc/cppdefault.cc
103@@ -64,6 +64,10 @@ const struct default_include cpp_include_defaults[] 103@@ -64,6 +64,10 @@ const struct default_include cpp_include_defaults[]
diff --git a/meta/recipes-devtools/gcc/gcc/0014-Don-t-search-host-directory-during-relink-if-inst_pr.patch b/meta/recipes-devtools/gcc/gcc/0014-Don-t-search-host-directory-during-relink-if-inst_pr.patch
index a9cbc08f1a..c7bf8d1c8e 100644
--- a/meta/recipes-devtools/gcc/gcc/0014-Don-t-search-host-directory-during-relink-if-inst_pr.patch
+++ b/meta/recipes-devtools/gcc/gcc/0014-Don-t-search-host-directory-during-relink-if-inst_pr.patch
@@ -1,4 +1,4 @@
1From e0d53bf9d59438a1dce0774163fa8c41cf32f306 Mon Sep 17 00:00:00 2001 1From f28f581fbafa76a48cc7e88ab9c6eb63db6342c4 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
@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 1 file changed, 3 insertions(+), 2 deletions(-) 14 1 file changed, 3 insertions(+), 2 deletions(-)
15 15
16diff --git a/ltmain.sh b/ltmain.sh 16diff --git a/ltmain.sh b/ltmain.sh
17index 9ebc7e3d1e0..7ea79fa8be6 100644 17index ef93f977a52..2ae16bf5d63 100644
18--- a/ltmain.sh 18--- a/ltmain.sh
19+++ b/ltmain.sh 19+++ b/ltmain.sh
20@@ -6004,12 +6004,13 @@ func_mode_link () 20@@ -6026,12 +6026,13 @@ func_mode_link ()
21 fi 21 fi
22 else 22 else
23 # We cannot seem to hardcode it, guess we'll fake it. 23 # We cannot seem to hardcode it, guess we'll fake it.
diff --git a/meta/recipes-devtools/gcc/gcc/0015-libcc1-fix-libcc1-s-install-path-and-rpath.patch b/meta/recipes-devtools/gcc/gcc/0015-libcc1-fix-libcc1-s-install-path-and-rpath.patch
index 8eb00287fc..9abf72b8e8 100644
--- a/meta/recipes-devtools/gcc/gcc/0015-libcc1-fix-libcc1-s-install-path-and-rpath.patch
+++ b/meta/recipes-devtools/gcc/gcc/0015-libcc1-fix-libcc1-s-install-path-and-rpath.patch
@@ -1,4 +1,4 @@
1From c2ea8aaa7b00c519c9c269c23ff840138ae491ac Mon Sep 17 00:00:00 2001 1From b54d51c58012f9eac31cf83a8e02c7069bf80a74 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,7 +20,7 @@ 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 b592bc8645f..97e2b615fb7 100644 23index f79e48a9aa2..bd8390946a2 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@@ -40,8 +40,8 @@ libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
@@ -35,7 +35,7 @@ index b592bc8645f..97e2b615fb7 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 f8f590d71e9..56462492045 100644 38index 9d56a8323b0..4deb08d8b34 100644
39--- a/libcc1/Makefile.in 39--- a/libcc1/Makefile.in
40+++ b/libcc1/Makefile.in 40+++ b/libcc1/Makefile.in
41@@ -396,8 +396,8 @@ libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \ 41@@ -396,8 +396,8 @@ libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
diff --git a/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch b/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch
index 82342b0532..682317fee8 100644
--- a/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch
+++ b/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch
@@ -1,4 +1,4 @@
1From 82da570396a6835e7208c8bb508220524b3a07c7 Mon Sep 17 00:00:00 2001 1From ccfe6d014e8cc04b0d3420f82dca8920fb659a07 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, 95 insertions(+), 73 deletions(-) 46 8 files changed, 95 insertions(+), 73 deletions(-)
47 47
48diff --git a/gcc/c-family/c-opts.cc b/gcc/c-family/c-opts.cc 48diff --git a/gcc/c-family/c-opts.cc b/gcc/c-family/c-opts.cc
49index be3058dca63..0be85374760 100644 49index d43b3aef102..b157ad37483 100644
50--- a/gcc/c-family/c-opts.cc 50--- a/gcc/c-family/c-opts.cc
51+++ b/gcc/c-family/c-opts.cc 51+++ b/gcc/c-family/c-opts.cc
52@@ -1542,8 +1542,8 @@ add_prefixed_path (const char *suffix, incpath_kind chain) 52@@ -1610,8 +1610,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);
@@ -61,7 +61,7 @@ index be3058dca63..0be85374760 100644
61 path = (char *) xmalloc (prefix_len + suffix_len + 1); 61 path = (char *) xmalloc (prefix_len + suffix_len + 1);
62 memcpy (path, prefix, prefix_len); 62 memcpy (path, prefix, prefix_len);
63diff --git a/gcc/config/linux.h b/gcc/config/linux.h 63diff --git a/gcc/config/linux.h b/gcc/config/linux.h
64index c6aada42eb7..79ff13184d3 100644 64index 640def63c27..0f937abe729 100644
65--- a/gcc/config/linux.h 65--- a/gcc/config/linux.h
66+++ b/gcc/config/linux.h 66+++ b/gcc/config/linux.h
67@@ -121,53 +121,53 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 67@@ -121,53 +121,53 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -139,10 +139,10 @@ index c6aada42eb7..79ff13184d3 100644
139 } 139 }
140 #endif 140 #endif
141diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h 141diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
142index 247acec9d8e..5526bf050b8 100644 142index d534b9d2295..c5257425705 100644
143--- a/gcc/config/rs6000/sysv4.h 143--- a/gcc/config/rs6000/sysv4.h
144+++ b/gcc/config/rs6000/sysv4.h 144+++ b/gcc/config/rs6000/sysv4.h
145@@ -950,53 +950,53 @@ ncrtn.o%s" 145@@ -951,53 +951,53 @@ ncrtn.o%s"
146 /* Include order changes for musl, same as in generic linux.h. */ 146 /* Include order changes for musl, same as in generic linux.h. */
147 #if DEFAULT_LIBC == LIBC_MUSL 147 #if DEFAULT_LIBC == LIBC_MUSL
148 #define INCLUDE_DEFAULTS_MUSL_GPP \ 148 #define INCLUDE_DEFAULTS_MUSL_GPP \
@@ -207,7 +207,7 @@ index 247acec9d8e..5526bf050b8 100644
207 #else 207 #else
208 #define INCLUDE_DEFAULTS_MUSL_NATIVE 208 #define INCLUDE_DEFAULTS_MUSL_NATIVE
209 #endif 209 #endif
210@@ -1021,7 +1021,7 @@ ncrtn.o%s" 210@@ -1022,7 +1022,7 @@ ncrtn.o%s"
211 INCLUDE_DEFAULTS_MUSL_TOOL \ 211 INCLUDE_DEFAULTS_MUSL_TOOL \
212 INCLUDE_DEFAULTS_MUSL_SUBDIR_TARGET \ 212 INCLUDE_DEFAULTS_MUSL_SUBDIR_TARGET \
213 INCLUDE_DEFAULTS_MUSL_NATIVE \ 213 INCLUDE_DEFAULTS_MUSL_NATIVE \
@@ -217,7 +217,7 @@ index 247acec9d8e..5526bf050b8 100644
217 } 217 }
218 #endif 218 #endif
219diff --git a/gcc/cppdefault.cc b/gcc/cppdefault.cc 219diff --git a/gcc/cppdefault.cc b/gcc/cppdefault.cc
220index 98bd66f95c6..742a4e56d5b 100644 220index db1e517fadc..8867e8bb341 100644
221--- a/gcc/cppdefault.cc 221--- a/gcc/cppdefault.cc
222+++ b/gcc/cppdefault.cc 222+++ b/gcc/cppdefault.cc
223@@ -35,6 +35,30 @@ 223@@ -35,6 +35,30 @@
@@ -347,7 +347,7 @@ index 98bd66f95c6..742a4e56d5b 100644
347 /* This value is set by cpp_relocated at runtime */ 347 /* This value is set by cpp_relocated at runtime */
348 const char *gcc_exec_prefix; 348 const char *gcc_exec_prefix;
349diff --git a/gcc/cppdefault.h b/gcc/cppdefault.h 349diff --git a/gcc/cppdefault.h b/gcc/cppdefault.h
350index e9b9264caff..168144b84b8 100644 350index e033af78280..0af197df7b2 100644
351--- a/gcc/cppdefault.h 351--- a/gcc/cppdefault.h
352+++ b/gcc/cppdefault.h 352+++ b/gcc/cppdefault.h
353@@ -33,7 +33,8 @@ 353@@ -33,7 +33,8 @@
@@ -382,10 +382,10 @@ index e9b9264caff..168144b84b8 100644
382 subdirectory of the actual installation. */ 382 subdirectory of the actual installation. */
383 extern const char *gcc_exec_prefix; 383 extern const char *gcc_exec_prefix;
384diff --git a/gcc/gcc.cc b/gcc/gcc.cc 384diff --git a/gcc/gcc.cc b/gcc/gcc.cc
385index e3e9374d1cc..b080609341b 100644 385index c1488865b8b..007c91780f6 100644
386--- a/gcc/gcc.cc 386--- a/gcc/gcc.cc
387+++ b/gcc/gcc.cc 387+++ b/gcc/gcc.cc
388@@ -259,6 +259,8 @@ FILE *report_times_to_file = NULL; 388@@ -265,6 +265,8 @@ FILE *report_times_to_file = NULL;
389 #endif 389 #endif
390 static const char *target_system_root = DEFAULT_TARGET_SYSTEM_ROOT; 390 static const char *target_system_root = DEFAULT_TARGET_SYSTEM_ROOT;
391 391
@@ -394,7 +394,7 @@ index e3e9374d1cc..b080609341b 100644
394 /* Nonzero means pass the updated target_system_root to the compiler. */ 394 /* Nonzero means pass the updated target_system_root to the compiler. */
395 395
396 static int target_system_root_changed; 396 static int target_system_root_changed;
397@@ -591,6 +593,7 @@ or with constant text in a single argument. 397@@ -598,6 +600,7 @@ or with constant text in a single argument.
398 %G process LIBGCC_SPEC as a spec. 398 %G process LIBGCC_SPEC as a spec.
399 %R Output the concatenation of target_system_root and 399 %R Output the concatenation of target_system_root and
400 target_sysroot_suffix. 400 target_sysroot_suffix.
@@ -402,7 +402,7 @@ index e3e9374d1cc..b080609341b 100644
402 %S process STARTFILE_SPEC as a spec. A capital S is actually used here. 402 %S process STARTFILE_SPEC as a spec. A capital S is actually used here.
403 %E process ENDFILE_SPEC as a spec. A capital E is actually used here. 403 %E process ENDFILE_SPEC as a spec. A capital E is actually used here.
404 %C process CPP_SPEC as a spec. 404 %C process CPP_SPEC as a spec.
405@@ -1638,10 +1641,10 @@ static const char *gcc_libexec_prefix; 405@@ -1648,10 +1651,10 @@ static const char *gcc_libexec_prefix;
406 gcc_exec_prefix is set because, in that case, we know where the 406 gcc_exec_prefix is set because, in that case, we know where the
407 compiler has been installed, and use paths relative to that 407 compiler has been installed, and use paths relative to that
408 location instead. */ 408 location instead. */
@@ -417,7 +417,7 @@ index e3e9374d1cc..b080609341b 100644
417 417
418 /* For native compilers, these are well-known paths containing 418 /* For native compilers, these are well-known paths containing
419 components that may be provided by the system. For cross 419 components that may be provided by the system. For cross
420@@ -1649,9 +1652,9 @@ static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX; 420@@ -1659,9 +1662,9 @@ static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
421 static const char *md_exec_prefix = MD_EXEC_PREFIX; 421 static const char *md_exec_prefix = MD_EXEC_PREFIX;
422 static const char *md_startfile_prefix = MD_STARTFILE_PREFIX; 422 static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
423 static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1; 423 static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
@@ -429,7 +429,7 @@ index e3e9374d1cc..b080609341b 100644
429 = STANDARD_STARTFILE_PREFIX_2; 429 = STANDARD_STARTFILE_PREFIX_2;
430 430
431 /* A relative path to be used in finding the location of tools 431 /* A relative path to be used in finding the location of tools
432@@ -6796,6 +6799,11 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part) 432@@ -6837,6 +6840,11 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
433 } 433 }
434 break; 434 break;
435 435
@@ -442,7 +442,7 @@ index e3e9374d1cc..b080609341b 100644
442 value = do_spec_1 (startfile_spec, 0, NULL); 442 value = do_spec_1 (startfile_spec, 0, NULL);
443 if (value != 0) 443 if (value != 0)
444diff --git a/gcc/incpath.cc b/gcc/incpath.cc 444diff --git a/gcc/incpath.cc b/gcc/incpath.cc
445index e572d98ab17..2cb2b586e4a 100644 445index 2cdbebc4c50..b61a9d1b2fc 100644
446--- a/gcc/incpath.cc 446--- a/gcc/incpath.cc
447+++ b/gcc/incpath.cc 447+++ b/gcc/incpath.cc
448@@ -135,7 +135,7 @@ add_standard_paths (const char *sysroot, const char *iprefix, 448@@ -135,7 +135,7 @@ add_standard_paths (const char *sysroot, const char *iprefix,
@@ -489,7 +489,7 @@ index e572d98ab17..2cb2b586e4a 100644
489 str = update_path (ostr, p->component); 489 str = update_path (ostr, p->component);
490 free (ostr); 490 free (ostr);
491diff --git a/gcc/prefix.cc b/gcc/prefix.cc 491diff --git a/gcc/prefix.cc b/gcc/prefix.cc
492index 6a98e856855..c403b2da7a3 100644 492index 0c79d60a6c8..27c79f09be4 100644
493--- a/gcc/prefix.cc 493--- a/gcc/prefix.cc
494+++ b/gcc/prefix.cc 494+++ b/gcc/prefix.cc
495@@ -73,7 +73,9 @@ License along with GCC; see the file COPYING3. If not see 495@@ -73,7 +73,9 @@ License along with GCC; see the file COPYING3. If not see
diff --git a/meta/recipes-devtools/gcc/gcc/0017-Search-target-sysroot-gcc-version-specific-dirs-with.patch b/meta/recipes-devtools/gcc/gcc/0017-Search-target-sysroot-gcc-version-specific-dirs-with.patch
index f87461bcaf..b3ab4996c3 100644
--- a/meta/recipes-devtools/gcc/gcc/0017-Search-target-sysroot-gcc-version-specific-dirs-with.patch
+++ b/meta/recipes-devtools/gcc/gcc/0017-Search-target-sysroot-gcc-version-specific-dirs-with.patch
@@ -1,4 +1,4 @@
1From cafcdfea0526dda5377a999dd9b1b8c805eafe0a Mon Sep 17 00:00:00 2001 1From 1756ca43dc85ee9d367350d68b908e6681ddd986 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
@@ -52,10 +52,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
52 1 file changed, 28 insertions(+), 1 deletion(-) 52 1 file changed, 28 insertions(+), 1 deletion(-)
53 53
54diff --git a/gcc/gcc.cc b/gcc/gcc.cc 54diff --git a/gcc/gcc.cc b/gcc/gcc.cc
55index b080609341b..1a1ca05064e 100644 55index 007c91780f6..22eb17bc099 100644
56--- a/gcc/gcc.cc 56--- a/gcc/gcc.cc
57+++ b/gcc/gcc.cc 57+++ b/gcc/gcc.cc
58@@ -2823,7 +2823,7 @@ for_each_path (const struct path_prefix *paths, 58@@ -2837,7 +2837,7 @@ for_each_path (const struct path_prefix *paths,
59 if (path == NULL) 59 if (path == NULL)
60 { 60 {
61 len = paths->max_len + extra_space + 1; 61 len = paths->max_len + extra_space + 1;
@@ -64,7 +64,7 @@ index b080609341b..1a1ca05064e 100644
64 path = XNEWVEC (char, len); 64 path = XNEWVEC (char, len);
65 } 65 }
66 66
67@@ -2835,6 +2835,33 @@ for_each_path (const struct path_prefix *paths, 67@@ -2849,6 +2849,33 @@ for_each_path (const struct path_prefix *paths,
68 /* Look first in MACHINE/VERSION subdirectory. */ 68 /* Look first in MACHINE/VERSION subdirectory. */
69 if (!skip_multi_dir) 69 if (!skip_multi_dir)
70 { 70 {
diff --git a/meta/recipes-devtools/gcc/gcc/0018-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch b/meta/recipes-devtools/gcc/gcc/0018-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch
index 71e43e556d..1b2da32a42 100644
--- a/meta/recipes-devtools/gcc/gcc/0018-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch
+++ b/meta/recipes-devtools/gcc/gcc/0018-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch
@@ -1,4 +1,4 @@
1From f2ad66276fd197cc088d7316662b1d792357ef6c Mon Sep 17 00:00:00 2001 1From 777963807e14a091c263d603cebfd7bb02f63b24 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
@@ -23,7 +23,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
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 25diff --git a/gcc/config/linux.h b/gcc/config/linux.h
26index 79ff13184d3..19f552e8c7d 100644 26index 0f937abe729..88e59d1f78c 100644
27--- a/gcc/config/linux.h 27--- a/gcc/config/linux.h
28+++ b/gcc/config/linux.h 28+++ b/gcc/config/linux.h
29@@ -195,6 +195,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 29@@ -195,6 +195,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -41,7 +41,7 @@ index 79ff13184d3..19f552e8c7d 100644
41 41
42 #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 43diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
44index 5f6cede558a..900993b6da4 100644 44index 6c4480b70c4..89ae8267482 100644
45--- a/gcc/config/rs6000/linux.h 45--- a/gcc/config/rs6000/linux.h
46+++ b/gcc/config/rs6000/linux.h 46+++ b/gcc/config/rs6000/linux.h
47@@ -102,6 +102,16 @@ 47@@ -102,6 +102,16 @@
@@ -62,7 +62,7 @@ index 5f6cede558a..900993b6da4 100644
62 #define LINK_OS_LINUX_SPEC LINK_OS_LINUX_EMUL " %{!shared: %{!static: \ 62 #define LINK_OS_LINUX_SPEC LINK_OS_LINUX_EMUL " %{!shared: %{!static: \
63 %{!static-pie: \ 63 %{!static-pie: \
64diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h 64diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
65index a11ae7643b7..2abde270813 100644 65index 8de5eb8bb49..4eb5cc2c7cf 100644
66--- a/gcc/config/rs6000/linux64.h 66--- a/gcc/config/rs6000/linux64.h
67+++ b/gcc/config/rs6000/linux64.h 67+++ b/gcc/config/rs6000/linux64.h
68@@ -373,6 +373,16 @@ extern int dot_symbols; 68@@ -373,6 +373,16 @@ extern int dot_symbols;
diff --git a/meta/recipes-devtools/gcc/gcc/0019-Re-introduce-spe-commandline-options.patch b/meta/recipes-devtools/gcc/gcc/0019-Re-introduce-spe-commandline-options.patch
index 7f92dea0c6..f23876b10a 100644
--- a/meta/recipes-devtools/gcc/gcc/0019-Re-introduce-spe-commandline-options.patch
+++ b/meta/recipes-devtools/gcc/gcc/0019-Re-introduce-spe-commandline-options.patch
@@ -1,4 +1,4 @@
1From 65baa3804819fbcd540be48f4c4611be5cba43c4 Mon Sep 17 00:00:00 2001 1From f2649410d2eb1c3983054020c9238887bd31273f 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,10 +14,10 @@ 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 83197681b66..04bea50b894 100644 17index 88cf16ca581..fc283ccc934 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@@ -344,6 +344,19 @@ mdebug= 20@@ -348,6 +348,19 @@ mdebug=
21 Target RejectNegative Joined 21 Target RejectNegative Joined
22 -mdebug= Enable debug output. 22 -mdebug= Enable debug output.
23 23
diff --git a/meta/recipes-devtools/gcc/gcc/0020-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch b/meta/recipes-devtools/gcc/gcc/0020-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch
index c5f43f5ba4..cd22dba878 100644
--- a/meta/recipes-devtools/gcc/gcc/0020-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch
+++ b/meta/recipes-devtools/gcc/gcc/0020-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch
@@ -1,4 +1,4 @@
1From 18b0057e4e2c5cf6fc6541670418f43f0381db3e Mon Sep 17 00:00:00 2001 1From be81ee850cdf720f87733046cfa8f3fa43704a7d 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.cc b/gcc/config/i386/i386-expand.cc 41diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
42index 8bb8f21e686..bcf976aa1b9 100644 42index cdfd94d3c73..de6fa7cc5ce 100644
43--- a/gcc/config/i386/i386-expand.cc 43--- a/gcc/config/i386/i386-expand.cc
44+++ b/gcc/config/i386/i386-expand.cc 44+++ b/gcc/config/i386/i386-expand.cc
45@@ -13087,10 +13087,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, 45@@ -13643,10 +13643,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 {
@@ -56,7 +56,7 @@ index 8bb8f21e686..bcf976aa1b9 100644
56 return expand_expr (call_expr, target, mode, EXPAND_NORMAL); 56 return expand_expr (call_expr, target, mode, EXPAND_NORMAL);
57 } 57 }
58diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c 58diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
59index 0bd6dffe17e..ef4acb175a4 100644 59index 2484dc839bf..e980030ef23 100644
60--- a/libgcc/config/i386/cpuinfo.c 60--- a/libgcc/config/i386/cpuinfo.c
61+++ b/libgcc/config/i386/cpuinfo.c 61+++ b/libgcc/config/i386/cpuinfo.c
62@@ -63,7 +63,7 @@ __cpu_indicator_init (void) 62@@ -63,7 +63,7 @@ __cpu_indicator_init (void)
diff --git a/meta/recipes-devtools/gcc/gcc/0021-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch b/meta/recipes-devtools/gcc/gcc/0021-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch
index dce2c047d0..5b67c194df 100644
--- a/meta/recipes-devtools/gcc/gcc/0021-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch
+++ b/meta/recipes-devtools/gcc/gcc/0021-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch
@@ -1,4 +1,4 @@
1From a9bb04b7cf02b2f2d16f68733488f9e48fc7e7a9 Mon Sep 17 00:00:00 2001 1From 734760138d07236289c5e548efc6083ddcfda650 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.cc b/gcc/gengtype.cc 19diff --git a/gcc/gengtype.cc b/gcc/gengtype.cc
20index c0ecbe8558b..9f8ab7146c0 100644 20index 6a3621c96cd..3f6c36dcff5 100644
21--- a/gcc/gengtype.cc 21--- a/gcc/gengtype.cc
22+++ b/gcc/gengtype.cc 22+++ b/gcc/gengtype.cc
23@@ -1005,7 +1005,7 @@ create_field_at (pair_p next, type_p type, const char *name, options_p opt, 23@@ -1005,7 +1005,7 @@ create_field_at (pair_p next, type_p type, const char *name, options_p opt,
@@ -38,7 +38,7 @@ index c0ecbe8558b..9f8ab7146c0 100644
38 38
39 /* Reverse a linked list of 'struct pair's in place. */ 39 /* Reverse a linked list of 'struct pair's in place. */
40 pair_p 40 pair_p
41@@ -5232,7 +5232,7 @@ main (int argc, char **argv) 41@@ -5238,7 +5238,7 @@ main (int argc, char **argv)
42 /* These types are set up with #define or else outside of where 42 /* These types are set up with #define or else outside of where
43 we can see them. We should initialize them before calling 43 we can see them. We should initialize them before calling
44 read_input_list. */ 44 read_input_list. */
@@ -48,7 +48,7 @@ index c0ecbe8558b..9f8ab7146c0 100644
48 POS_HERE (do_scalar_typedef ("CUMULATIVE_ARGS", &pos)); 48 POS_HERE (do_scalar_typedef ("CUMULATIVE_ARGS", &pos));
49 POS_HERE (do_scalar_typedef ("REAL_VALUE_TYPE", &pos)); 49 POS_HERE (do_scalar_typedef ("REAL_VALUE_TYPE", &pos));
50diff --git a/gcc/genmodes.cc b/gcc/genmodes.cc 50diff --git a/gcc/genmodes.cc b/gcc/genmodes.cc
51index eb3f9e2f0c1..5425635cb22 100644 51index 7af79720189..3bdb82ef8bf 100644
52--- a/gcc/genmodes.cc 52--- a/gcc/genmodes.cc
53+++ b/gcc/genmodes.cc 53+++ b/gcc/genmodes.cc
54@@ -441,7 +441,7 @@ complete_all_modes (void) 54@@ -441,7 +441,7 @@ complete_all_modes (void)
diff --git a/meta/recipes-devtools/gcc/gcc/0022-libatomic-Do-not-enforce-march-on-aarch64.patch b/meta/recipes-devtools/gcc/gcc/0022-libatomic-Do-not-enforce-march-on-aarch64.patch
index d710b50594..9292767037 100644
--- a/meta/recipes-devtools/gcc/gcc/0022-libatomic-Do-not-enforce-march-on-aarch64.patch
+++ b/meta/recipes-devtools/gcc/gcc/0022-libatomic-Do-not-enforce-march-on-aarch64.patch
@@ -1,4 +1,4 @@
1From db4380eac3cd9baa2f31bcd2fb936ed51f27b415 Mon Sep 17 00:00:00 2001 1From 95ee2cf97c5c2a4bd66c54d078b960a1d541d35e 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,10 +17,10 @@ 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 980677f3533..26188917946 100644 20index 0f1a7156084..255fe448e63 100644
21--- a/libatomic/Makefile.am 21--- a/libatomic/Makefile.am
22+++ b/libatomic/Makefile.am 22+++ b/libatomic/Makefile.am
23@@ -130,7 +130,6 @@ libatomic_la_LIBADD = $(foreach s,$(SIZES),$(addsuffix _$(s)_.lo,$(SIZEOBJS))) 23@@ -128,7 +128,6 @@ libatomic_la_LIBADD = $(foreach s,$(SIZES),$(addsuffix _$(s)_.lo,$(SIZEOBJS)))
24 ## On a target-specific basis, include alternates to be selected by IFUNC. 24 ## On a target-specific basis, include alternates to be selected by IFUNC.
25 if HAVE_IFUNC 25 if HAVE_IFUNC
26 if ARCH_AARCH64_LINUX 26 if ARCH_AARCH64_LINUX
@@ -29,7 +29,7 @@ index 980677f3533..26188917946 100644
29 29
30 endif 30 endif
31diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in 31diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in
32index d9d529bc502..47dacef9e01 100644 32index 9798e7c09e9..3b3027eb77d 100644
33--- a/libatomic/Makefile.in 33--- a/libatomic/Makefile.in
34+++ b/libatomic/Makefile.in 34+++ b/libatomic/Makefile.in
35@@ -452,7 +452,6 @@ M_SRC = $(firstword $(filter %/$(M_FILE), $(all_c_files))) 35@@ -452,7 +452,6 @@ M_SRC = $(firstword $(filter %/$(M_FILE), $(all_c_files)))
diff --git a/meta/recipes-devtools/gcc/gcc/0023-Fix-install-path-of-linux64.h.patch b/meta/recipes-devtools/gcc/gcc/0023-Fix-install-path-of-linux64.h.patch
index 7f1cd0b3d8..da91d85eb9 100644
--- a/meta/recipes-devtools/gcc/gcc/0023-Fix-install-path-of-linux64.h.patch
+++ b/meta/recipes-devtools/gcc/gcc/0023-Fix-install-path-of-linux64.h.patch
@@ -1,4 +1,4 @@
1From 92a77026cc64f5eab4cb6b35e4a7c59e6ab8aa20 Mon Sep 17 00:00:00 2001 1From cd7353f45bc2af9a9ea9694544d40ea03a1310d1 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
@@ -17,10 +17,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
17 1 file changed, 2 insertions(+) 17 1 file changed, 2 insertions(+)
18 18
19diff --git a/gcc/Makefile.in b/gcc/Makefile.in 19diff --git a/gcc/Makefile.in b/gcc/Makefile.in
20index 6a009c696e9..da54dd42adf 100644 20index 944d0a6680a..4cea9b20af5 100644
21--- a/gcc/Makefile.in 21--- a/gcc/Makefile.in
22+++ b/gcc/Makefile.in 22+++ b/gcc/Makefile.in
23@@ -3900,6 +3900,8 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype 23@@ -4115,6 +4115,8 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
24 | "$(srcdir)"/config/* | "$(srcdir)"/common/config/* \ 24 | "$(srcdir)"/config/* | "$(srcdir)"/common/config/* \
25 | "$(srcdir)"/c-family/* | "$(srcdir)"/*.def ) \ 25 | "$(srcdir)"/c-family/* | "$(srcdir)"/*.def ) \
26 base=`echo "$$path" | sed -e "s|$$srcdirstrip/||"`;; \ 26 base=`echo "$$path" | sed -e "s|$$srcdirstrip/||"`;; \
diff --git a/meta/recipes-devtools/gcc/gcc/0024-Avoid-hardcoded-build-paths-into-ppc-libgcc.patch b/meta/recipes-devtools/gcc/gcc/0024-Avoid-hardcoded-build-paths-into-ppc-libgcc.patch
index a34e6afdb4..b7edeef6eb 100644
--- a/meta/recipes-devtools/gcc/gcc/0024-Avoid-hardcoded-build-paths-into-ppc-libgcc.patch
+++ b/meta/recipes-devtools/gcc/gcc/0024-Avoid-hardcoded-build-paths-into-ppc-libgcc.patch
@@ -1,4 +1,4 @@
1From c6fc577e9e89dc16d3e971aa165602746232de4c Mon Sep 17 00:00:00 2001 1From 159545123cfe05136037e302409cf82ec5c0263c Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org> 2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Sat, 20 Aug 2022 09:04:14 -0700 3Date: Sat, 20 Aug 2022 09:04:14 -0700
4Subject: [PATCH] Avoid hardcoded build paths into ppc libgcc 4Subject: [PATCH] Avoid hardcoded build paths into ppc libgcc
diff --git a/meta/recipes-devtools/gcc/gcc/0025-gcc-testsuite-tweaks-for-mips-OE.patch b/meta/recipes-devtools/gcc/gcc/0025-gcc-testsuite-tweaks-for-mips-OE.patch
index 454d05d473..0a61862332 100644
--- a/meta/recipes-devtools/gcc/gcc/0025-gcc-testsuite-tweaks-for-mips-OE.patch
+++ b/meta/recipes-devtools/gcc/gcc/0025-gcc-testsuite-tweaks-for-mips-OE.patch
@@ -1,4 +1,4 @@
1From 8845248c81c0695ccc65311017deef824fa538fa Mon Sep 17 00:00:00 2001 1From 62e25edd60d45eaec331a3273880f6ff3248ef62 Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org> 2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Thu, 17 Aug 2023 09:01:40 -0700 3Date: Thu, 17 Aug 2023 09:01:40 -0700
4Subject: [PATCH] gcc testsuite tweaks for mips/OE 4Subject: [PATCH] gcc testsuite tweaks for mips/OE
@@ -33,13 +33,13 @@ discussion. Need to investigate why qemu-user passes the 'bad' instructions']
33Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> 33Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
34Signed-off-by: Khem Raj <raj.khem@gmail.com> 34Signed-off-by: Khem Raj <raj.khem@gmail.com>
35--- 35---
36 gcc/testsuite/gcc.target/mips/mips.exp | 16 +++++++++ 36 gcc/testsuite/gcc.target/mips/mips.exp | 16 ++++++++++
37 gcc/testsuite/lib/gcc-dg.exp | 11 +++++++ 37 gcc/testsuite/lib/gcc-dg.exp | 11 +++++++
38 gcc/testsuite/lib/target-supports.exp | 45 ++++++++------------------ 38 gcc/testsuite/lib/target-supports.exp | 44 ++++++++------------------
39 3 files changed, 41 insertions(+), 31 deletions(-) 39 3 files changed, 40 insertions(+), 31 deletions(-)
40 40
41diff --git a/gcc/testsuite/gcc.target/mips/mips.exp b/gcc/testsuite/gcc.target/mips/mips.exp 41diff --git a/gcc/testsuite/gcc.target/mips/mips.exp b/gcc/testsuite/gcc.target/mips/mips.exp
42index e028bc93b40..b54a40d6509 100644 42index 82d418a7cd4..46f7bf4ef92 100644
43--- a/gcc/testsuite/gcc.target/mips/mips.exp 43--- a/gcc/testsuite/gcc.target/mips/mips.exp
44+++ b/gcc/testsuite/gcc.target/mips/mips.exp 44+++ b/gcc/testsuite/gcc.target/mips/mips.exp
45@@ -711,7 +711,23 @@ proc mips_first_unsupported_option { upstatus } { 45@@ -711,7 +711,23 @@ proc mips_first_unsupported_option { upstatus } {
@@ -67,10 +67,10 @@ index e028bc93b40..b54a40d6509 100644
67 regsub -all "\n" $code "\\n\\\n" asm 67 regsub -all "\n" $code "\\n\\\n" asm
68 # Use check_runtime from target-supports.exp, which caches 68 # Use check_runtime from target-supports.exp, which caches
69diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp 69diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
70index 228c21d1207..d3b88e0419e 100644 70index 6dd8fa3fce9..95672008219 100644
71--- a/gcc/testsuite/lib/gcc-dg.exp 71--- a/gcc/testsuite/lib/gcc-dg.exp
72+++ b/gcc/testsuite/lib/gcc-dg.exp 72+++ b/gcc/testsuite/lib/gcc-dg.exp
73@@ -232,9 +232,20 @@ proc schedule-cleanups { opts } { 73@@ -233,9 +233,20 @@ proc schedule-cleanups { opts } {
74 74
75 proc gcc-dg-test-1 { target_compile prog do_what extra_tool_flags } { 75 proc gcc-dg-test-1 { target_compile prog do_what extra_tool_flags } {
76 # Set up the compiler flags, based on what we're going to do. 76 # Set up the compiler flags, based on what we're going to do.
@@ -92,10 +92,10 @@ index 228c21d1207..d3b88e0419e 100644
92 "preprocess" { 92 "preprocess" {
93 set compile_type "preprocess" 93 set compile_type "preprocess"
94diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp 94diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
95index 45435586de2..04942540d8b 100644 95index a62f459ad7e..6886cfeee49 100644
96--- a/gcc/testsuite/lib/target-supports.exp 96--- a/gcc/testsuite/lib/target-supports.exp
97+++ b/gcc/testsuite/lib/target-supports.exp 97+++ b/gcc/testsuite/lib/target-supports.exp
98@@ -2483,14 +2483,7 @@ proc check_mips_loongson_mmi_hw_available { } { 98@@ -2949,14 +2949,7 @@ proc check_mips_loongson_mmi_hw_available { } {
99 if { !([istarget mips*-*-*]) } { 99 if { !([istarget mips*-*-*]) } {
100 expr 0 100 expr 0
101 } else { 101 } else {
@@ -111,7 +111,7 @@ index 45435586de2..04942540d8b 100644
111 } 111 }
112 }] 112 }]
113 } 113 }
114@@ -2504,29 +2497,7 @@ proc check_mips_msa_hw_available { } { 114@@ -2970,29 +2963,7 @@ proc check_mips_msa_hw_available { } {
115 if { !([istarget mips*-*-*]) } { 115 if { !([istarget mips*-*-*]) } {
116 expr 0 116 expr 0
117 } else { 117 } else {
@@ -142,7 +142,7 @@ index 45435586de2..04942540d8b 100644
142 } 142 }
143 }] 143 }]
144 } 144 }
145@@ -9897,6 +9868,7 @@ proc is-effective-target-keyword { arg } { 145@@ -10354,6 +10325,7 @@ proc is-effective-target-keyword { arg } {
146 146
147 proc et-dg-runtest { runtest testcases flags default-extra-flags } { 147 proc et-dg-runtest { runtest testcases flags default-extra-flags } {
148 global dg-do-what-default 148 global dg-do-what-default
@@ -150,7 +150,7 @@ index 45435586de2..04942540d8b 100644
150 global EFFECTIVE_TARGETS 150 global EFFECTIVE_TARGETS
151 global et_index 151 global et_index
152 152
153@@ -9904,6 +9876,7 @@ proc et-dg-runtest { runtest testcases flags default-extra-flags } { 153@@ -10361,6 +10333,7 @@ proc et-dg-runtest { runtest testcases flags default-extra-flags } {
154 foreach target $EFFECTIVE_TARGETS { 154 foreach target $EFFECTIVE_TARGETS {
155 set target_flags $flags 155 set target_flags $flags
156 set dg-do-what-default compile 156 set dg-do-what-default compile
@@ -158,7 +158,7 @@ index 45435586de2..04942540d8b 100644
158 set et_index [lsearch -exact $EFFECTIVE_TARGETS $target] 158 set et_index [lsearch -exact $EFFECTIVE_TARGETS $target]
159 if { [info procs add_options_for_${target}] != [list] } { 159 if { [info procs add_options_for_${target}] != [list] } {
160 set target_flags [add_options_for_${target} "$flags"] 160 set target_flags [add_options_for_${target} "$flags"]
161@@ -9911,8 +9884,10 @@ proc et-dg-runtest { runtest testcases flags default-extra-flags } { 161@@ -10368,8 +10341,10 @@ proc et-dg-runtest { runtest testcases flags default-extra-flags } {
162 if { [info procs check_effective_target_${target}_runtime] 162 if { [info procs check_effective_target_${target}_runtime]
163 != [list] && [check_effective_target_${target}_runtime] } { 163 != [list] && [check_effective_target_${target}_runtime] } {
164 set dg-do-what-default run 164 set dg-do-what-default run
@@ -169,67 +169,59 @@ index 45435586de2..04942540d8b 100644
169 } 169 }
170 } else { 170 } else {
171 set et_index 0 171 set et_index 0
172@@ -11606,6 +11581,7 @@ proc check_effective_target_sigsetjmp {} { 172@@ -12155,6 +12130,7 @@ proc check_effective_target_sigsetjmp {} {
173 proc check_vect_support_and_set_flags { } { 173 proc check_vect_support_and_set_flags { } {
174 global DEFAULT_VECTCFLAGS 174 global DEFAULT_VECTCFLAGS
175 global dg-do-what-default 175 global dg-do-what-default
176+ global do-what-limit 176+ global do-what-limit
177 global EFFECTIVE_TARGETS 177 global EFFECTIVE_TARGETS
178 178
179 if [istarget powerpc-*paired*] { 179 if [istarget powerpc*-*-*] {
180@@ -11614,6 +11590,7 @@ proc check_vect_support_and_set_flags { } { 180@@ -12186,6 +12162,7 @@ proc check_vect_support_and_set_flags { } {
181 set dg-do-what-default run
182 } else {
183 set dg-do-what-default compile
184+ set do-what-limit link
185 }
186 } elseif [istarget powerpc*-*-*] {
187 # Skip targets not supporting -maltivec.
188@@ -11644,6 +11621,7 @@ proc check_vect_support_and_set_flags { } {
189 set DEFAULT_VECTCFLAGS [linsert $DEFAULT_VECTCFLAGS 0 "-mcpu=970"] 181 set DEFAULT_VECTCFLAGS [linsert $DEFAULT_VECTCFLAGS 0 "-mcpu=970"]
190 } 182 }
191 set dg-do-what-default compile 183 set dg-do-what-default compile
192+ set do-what-limit link 184+ set do-what-limit link
193 } 185 }
194 } elseif { [istarget i?86-*-*] || [istarget x86_64-*-*] } { 186 } elseif { [check_effective_target_x86] } {
195 lappend DEFAULT_VECTCFLAGS "-msse2" 187 lappend DEFAULT_VECTCFLAGS "-msse2"
196@@ -11651,6 +11629,7 @@ proc check_vect_support_and_set_flags { } { 188@@ -12193,6 +12170,7 @@ proc check_vect_support_and_set_flags { } {
197 set dg-do-what-default run 189 set dg-do-what-default run
198 } else { 190 } else {
199 set dg-do-what-default compile 191 set dg-do-what-default compile
200+ set do-what-limit link 192+ set do-what-limit link
201 } 193 }
202 } elseif { [istarget mips*-*-*] 194 } elseif { [istarget mips*-*-*]
203 && [check_effective_target_nomips16] } { 195 && [check_effective_target_nomips16] } {
204@@ -11670,6 +11649,7 @@ proc check_vect_support_and_set_flags { } { 196@@ -12212,6 +12190,7 @@ proc check_vect_support_and_set_flags { } {
205 set dg-do-what-default run 197 set dg-do-what-default run
206 } else { 198 } else {
207 set dg-do-what-default compile 199 set dg-do-what-default compile
208+ set do-what-limit link 200+ set do-what-limit link
209 } 201 }
210 } elseif [istarget alpha*-*-*] { 202 } elseif [istarget alpha*-*-*] {
211 # Alpha's vectorization capabilities are extremely limited. 203 # Alpha's vectorization capabilities are extremely limited.
212@@ -11683,6 +11663,7 @@ proc check_vect_support_and_set_flags { } { 204@@ -12225,6 +12204,7 @@ proc check_vect_support_and_set_flags { } {
213 set dg-do-what-default run 205 set dg-do-what-default run
214 } else { 206 } else {
215 set dg-do-what-default compile 207 set dg-do-what-default compile
216+ set do-what-limit link 208+ set do-what-limit link
217 } 209 }
218 } elseif [istarget ia64-*-*] { 210 } elseif [istarget ia64-*-*] {
219 set dg-do-what-default run 211 set dg-do-what-default run
220@@ -11696,6 +11677,7 @@ proc check_vect_support_and_set_flags { } { 212@@ -12238,6 +12218,7 @@ proc check_vect_support_and_set_flags { } {
221 set dg-do-what-default run 213 set dg-do-what-default run
222 } else { 214 } else {
223 set dg-do-what-default compile 215 set dg-do-what-default compile
224+ set do-what-limit link 216+ set do-what-limit link
225 } 217 }
226 } elseif [istarget aarch64*-*-*] { 218 } elseif [istarget aarch64*-*-*] {
227 set dg-do-what-default run 219 set dg-do-what-default run
228@@ -11720,6 +11702,7 @@ proc check_vect_support_and_set_flags { } { 220@@ -12262,6 +12243,7 @@ proc check_vect_support_and_set_flags { } {
229 } else { 221 } else {
230 lappend DEFAULT_VECTCFLAGS "-march=z14" "-mzarch" 222 lappend DEFAULT_VECTCFLAGS "-march=z14" "-mzarch"
231 set dg-do-what-default compile 223 set dg-do-what-default compile
232+ set do-what-limit link 224+ set do-what-limit link
233 } 225 }
234 } elseif [istarget amdgcn-*-*] { 226 } elseif [istarget amdgcn-*-*] {
235 set dg-do-what-default run 227 set dg-do-what-default run
diff --git a/meta/recipes-devtools/gcc/gcc/0026-arm-fully-validate-mem_noofs_operand-PR120351.patch b/meta/recipes-devtools/gcc/gcc/0026-arm-fully-validate-mem_noofs_operand-PR120351.patch
new file mode 100644
index 0000000000..3f324fdc22
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/0026-arm-fully-validate-mem_noofs_operand-PR120351.patch
@@ -0,0 +1,95 @@
1From bb7adc5dab8bcee2ef1c0d2af370ea77c49bb5c5 Mon Sep 17 00:00:00 2001
2From: Richard Earnshaw <rearnsha@arm.com>
3Date: Mon, 19 May 2025 16:19:39 +0100
4Subject: [PATCH] arm: fully validate mem_noofs_operand [PR120351]
5
6It's not enough to just check that a memory operand is of the form
7mem(reg); after RA we also need to validate the register being used.
8The safest way to do this is to call memory_operand.
9
10 PR target/120351
11
12gcc/ChangeLog:
13
14 * config/arm/predicates.md (mem_noofs_operand): Also check the op
15 is a valid memory_operand.
16
17gcc/testsuite/ChangeLog:
18
19 * gcc.target/arm/pr120351.c: New test.
20
21Upstream-Status: Backport [https://gcc.gnu.org/cgit/gcc/commit/?id=e5bb7a328eb71daa02d15b48d3a6c6b8cd24abc5]
22Signed-off-by: Khem Raj <raj.khem@gmail.com>
23---
24 gcc/config/arm/predicates.md | 3 +-
25 gcc/testsuite/gcc.target/arm/pr120351.c | 47 +++++++++++++++++++++++++
26 2 files changed, 49 insertions(+), 1 deletion(-)
27 create mode 100644 gcc/testsuite/gcc.target/arm/pr120351.c
28
29diff --git a/gcc/config/arm/predicates.md b/gcc/config/arm/predicates.md
30index 75c06d9be25..655f60312de 100644
31--- a/gcc/config/arm/predicates.md
32+++ b/gcc/config/arm/predicates.md
33@@ -907,7 +907,8 @@
34
35 (define_predicate "mem_noofs_operand"
36 (and (match_code "mem")
37- (match_code "reg" "0")))
38+ (match_code "reg" "0")
39+ (match_operand 0 "memory_operand")))
40
41 (define_predicate "call_insn_operand"
42 (ior (and (match_code "symbol_ref")
43diff --git a/gcc/testsuite/gcc.target/arm/pr120351.c b/gcc/testsuite/gcc.target/arm/pr120351.c
44new file mode 100644
45index 00000000000..d8e9d73275c
46--- /dev/null
47+++ b/gcc/testsuite/gcc.target/arm/pr120351.c
48@@ -0,0 +1,47 @@
49+/* { dg-do assemble } */
50+/* { dg-require-effective-target arm_neon_ok } */
51+/* { dg-add-options arm_neon } */
52+/* { dg-additional-options "-O2" } */
53+
54+
55+typedef struct A
56+{
57+ int f1;
58+} A;
59+
60+__inline void ref (A* x)
61+{
62+ __atomic_fetch_add(&x->f1, 1, 0);
63+}
64+
65+typedef struct B
66+{
67+ A *d;
68+ int *ptr;
69+} B;
70+
71+void insertOne (B*, B*);
72+
73+void init (B *);
74+__inline void copy (B *p, B *q)
75+{
76+ p->d = q->d;
77+ p->ptr = q->ptr;
78+ ref (p->d);
79+}
80+
81+__inline void emplace(B* x)
82+{
83+ B dummy;
84+ B _tmp;
85+ init (&dummy);
86+ copy (&_tmp, &dummy);
87+ insertOne(x, &_tmp);
88+}
89+
90+void testing ()
91+{
92+ B test;
93+ init (&test);
94+ emplace(&test);
95+}
diff --git a/meta/recipes-devtools/gcc/gcc/0026-fix-incorrect-preprocessor-line-numbers.patch b/meta/recipes-devtools/gcc/gcc/0026-fix-incorrect-preprocessor-line-numbers.patch
new file mode 100644
index 0000000000..f799085662
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/0026-fix-incorrect-preprocessor-line-numbers.patch
@@ -0,0 +1,475 @@
1From edf745dc519ddbfef127e2789bf11bfbacd300b7 Mon Sep 17 00:00:00 2001
2From: Jakub Jelinek <jakub@redhat.com>
3Date: Wed, 7 May 2025 17:25:42 +0200
4Subject: libcpp: Further fixes for incorrect line numbers in large files
5 [PR120061]
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10The backport of the PR108900 fix to 14 branch broke building chromium
11because static_assert (__LINE__ == expected_line_number, ""); now triggers
12as the __LINE__ values are off by one.
13This isn't the case on the trunk and 15 branch because we've switched
14to 64-bit location_t and so one actually needs far longer header files
15to trigger it.
16https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120061#c11
17https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120061#c12
18contain (large) testcases in patch form which show on the 14 branch
19that the first one used to fail before the PR108900 backport and now
20works correctly, while the second one attempts to match the chromium
21behavior and it used to pass before the PR108900 backport and now it
22FAILs.
23The two testcases show rare problematic cases, because
24do_include_common -> parse_include -> check_eol -> check_eol_1 ->
25cpp_get_token_1 -> _cpp_lex_token -> _cpp_lex_direct -> linemap_line_start
26triggers there
27 /* Allocate the new line_map. However, if the current map only has a
28 single line we can sometimes just increase its column_bits instead. */
29 if (line_delta < 0
30 || last_line != ORDINARY_MAP_STARTING_LINE_NUMBER (map)
31 || SOURCE_COLUMN (map, highest) >= (1U << (column_bits - range_bits))
32 || ( /* We can't reuse the map if the line offset is sufficiently
33 large to cause overflow when computing location_t values. */
34 (to_line - ORDINARY_MAP_STARTING_LINE_NUMBER (map))
35 >= (((uint64_t) 1)
36 << (CHAR_BIT * sizeof (linenum_type) - column_bits)))
37 || range_bits < map->m_range_bits)
38 map = linemap_check_ordinary
39 (const_cast <line_map *>
40 (linemap_add (set, LC_RENAME,
41 ORDINARY_MAP_IN_SYSTEM_HEADER_P (map),
42 ORDINARY_MAP_FILE_NAME (map),
43 to_line)));
44and so creates a new ordinary map on the line right after the
45(problematic) #include line.
46Now, in the spot that r14-11679-g8a884140c2bcb7 patched,
47pfile->line_table->highest_location in all 3 tests (also
48https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120061#c13
49) is before the decrement the start of the line after the #include line and so
50the decrement is really desirable in that case to put highest_location
51somewhere on the line where the #include actually is.
52But at the same time it is also undesirable, because if we do decrement it,
53then linemap_add LC_ENTER called from _cpp_do_file_change will then
54 /* Generate a start_location above the current highest_location.
55 If possible, make the low range bits be zero. */
56 location_t start_location = set->highest_location + 1;
57 unsigned range_bits = 0;
58 if (start_location < LINE_MAP_MAX_LOCATION_WITH_COLS)
59 range_bits = set->default_range_bits;
60 start_location += (1 << range_bits) - 1;
61 start_location &= ~((1 << range_bits) - 1);
62
63 linemap_assert (!LINEMAPS_ORDINARY_USED (set)
64 || (start_location
65 >= MAP_START_LOCATION (LINEMAPS_LAST_ORDINARY_MAP (set))));
66and we can end up with the new LC_ENTER ordinary map having the same
67start_location as the preceding LC_RENAME one.
68Next thing that happens is computation of included_from:
69 if (reason == LC_ENTER)
70 {
71 if (set->depth == 0)
72 map->included_from = 0;
73 else
74 /* The location of the end of the just-closed map. */
75 map->included_from
76 = (((map[0].start_location - 1 - map[-1].start_location)
77 & ~((1 << map[-1].m_column_and_range_bits) - 1))
78 + map[-1].start_location);
79The normal case (e.g. with the testcase included at the start of this comment) is
80that map[-1] starts somewhere earlier and so map->included_from computation above
81nicely computes location_t which expands to the start of the #include line.
82With r14-11679 reverted, for #c11 as well as #c12
83map[0].start_location == map[-1].start_location above, and so it is
84((location_t) -1 & ~((1 << map[-1].m_column_and_range_bits) - 1)))
85+ map[-1].start_location,
86which happens to be start of the #include line.
87For #c11 map[0].start_location is 0x500003a0 and map[-1] has
88m_column_and_range_bits 7 and map[-2] has m_column_and_range_bits 12 and
89map[0].included_from is set to 0x50000320.
90For #c12 map[0].start_location is 0x606c0402 and map[-2].start_location is
910x606c0400 and m_column_and_range_bits is 0 for all 3 maps.
92map[0].included_from is set to 0x606c0401.
93The last important part is again in linemap_add when doing LC_LEAVE:
94 /* (MAP - 1) points to the map we are leaving. The
95 map from which (MAP - 1) got included should be the map
96 that comes right before MAP in the same file. */
97 from = linemap_included_from_linemap (set, map - 1);
98
99 /* A TO_FILE of NULL is special - we use the natural values. */
100 if (to_file == NULL)
101 {
102 to_file = ORDINARY_MAP_FILE_NAME (from);
103 to_line = SOURCE_LINE (from, from[1].start_location);
104 sysp = ORDINARY_MAP_IN_SYSTEM_HEADER_P (from);
105 }
106Here it wants to compute the right to_line which ought to be the line after
107the #include directive.
108On the #c11 testcase that doesn't work correctly though, because
109map[-1].included_from is 0x50000320, from[0] for that is LC_ENTER with
110start_location 0x4080 and m_column_and_range_bits 12 but note that we've
111earlier computed map[-1].start_location + (-1 & 0xffffff80) and so only
112decreased by 7 bits, so to_line is still on the line with #include and not
113after it. In the #c12 that doesn't happen, all the ordinary maps involved
114there had 0 m_column_and_range_bits and so this computes correct line.
115
116Below is a fix for the trunk including testcases using the
117location_overflow_plugin hack to simulate the bugs without needing huge
118files (in the 14 case it is just 330KB and almost 10MB, but in the 15
119case it would need to be far bigger).
120The pre- r15-9018 trunk has
121FAIL: gcc.dg/plugin/location-overflow-test-pr116047.c -fplugin=./location_overflow_plugin.so scan-file static_assert[^\n\r]*6[^\n\r]*== 6
122and current trunk
123FAIL: gcc.dg/plugin/location-overflow-test-pr116047.c -fplugin=./location_overflow_plugin.so scan-file static_assert[^\n\r]*6[^\n\r]*== 6
124FAIL: gcc.dg/plugin/location-overflow-test-pr120061.c -fplugin=./location_overflow_plugin.so scan-file static_assert[^\n\r]*5[^\n\r]*== 5
125and with the patch everything PASSes.
126I'll post afterwards a 14 version of the patch.
127
128The patch reverts the r15-9018 change, because it is incorrect,
129we really need to decrement it even when crossing ordinary map
130boundaries, so that the location is not on the line after the #include
131line but somewhere on the #include line. It also patches two spots
132in linemap_add mentioned above to make sure we get correct locations
133both in the included_from location_t when doing LC_ENTER (second
134line-map.cc hunk) and when doing LC_LEAVE to compute the right to_line
135(first line-map.cc hunk), both in presence of an added LC_RENAME
136with the same start_location as the following LC_ENTER (i.e. the
137problematic cases).
138The LC_ENTER hunk is mostly to ensure included_form location_t is
139at the start of the #include line (column 0), without it we can
140decrease include_from not enough and end up at some random column
141in the middle of the line, because it is masking away
142map[-1].m_column_and_range_bits bits even when in the end the resulting
143include_from location_t will be found in map[-2] map with perhaps
144different m_column_and_range_bits. That alone doesn't fix the bug
145though.
146The more important is the LC_LEAVE hunk and the problem there is
147caused by linemap_line_start not actually doing
148 r = set->highest_line + (line_delta << map->m_column_and_range_bits);
149when adding a new map (the LC_RENAME one because we need to switch to
150different number of directly encoded ranges, or columns, etc.).
151So, in the original PR108900 case that
152 to_line = SOURCE_LINE (from, from[1].start_location);
153doesn't do the right thing, from there is the last < 0x50000000 map
154with m_column_and_range_bits 12, from[1] is the first one above it
155and map[-1].included_from is the correct location of column 0 on
156the #include line, but as the new LC_RENAME map has been created without
157actually increasing highest_location to be on the new line (we've just
158set to_line of the new LC_RENAME map to the correct line),
159 to_line = SOURCE_LINE (from, from[1].start_location);
160stays on the same source line. I've tried to just replace that with
161 to_line = SOURCE_LINE (from, linemap_included_from (map - 1)) + 1;
162i.e. just find out the #include line from map[-1].included_from and
163add 1 to it, unfortunately that breaks the
164c-c++-common/cpp/line-4.c
165test where we expect to stay on the same 0 line for LC_LEAVE from
166<command line> and gcc.dg/cpp/trad/Wunused.c, gcc.dg/cpp/trad/builtins.c
167and c-c++-common/analyzer/named-constants-via-macros-traditional.c tests
168all with -traditional-cpp preprocessing where to_line is also off-by-one
169from the expected one.
170So, this patch instead conditionalizes it, uses the
171 to_line = SOURCE_LINE (from, linemap_included_from (map - 1)) + 1;
172way only if from[1] is a LC_RENAME map (rather than the usual
173LC_ENTER one), that should limit it to the problematic cases of when
174parse_include peeked after EOL and had to create LC_RENAME map with
175the same start_location as the LC_ENTER after it.
176
177Some further justification for the LC_ENTER hunk, using the
178https://gcc.gnu.org/pipermail/gcc-patches/2025-May/682774.html testcase
179(old is 14 before r14-11679, vanilla current 14 and new with the 14 patch)
180I get
181$ /usr/src/gcc-14/obj/gcc/cc1.old -quiet -std=c23 pr116047.c -nostdinc
182In file included from pr116047-1.h:327677:21,
183 from pr116047.c:4:
184pr116047-2.h:1:1: error: unknown type name ‘a’
185 1 | a b c;
186 | ^
187pr116047-2.h:1:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘c’
188 1 | a b c;
189 | ^
190pr116047-1.h:327677:1: error: static assertion failed: ""
191327677 | #include "pr116047-2.h"
192 | ^~~~~~~~~~~~~
193$ /usr/src/gcc-14/obj/gcc/cc1.vanilla -quiet -std=c23 pr116047.c -nostdinc
194In file included from pr116047-1.h:327678,
195 from pr116047.c:4:
196pr116047-2.h:1:1: error: unknown type name ‘a’
197 1 | a b c;
198 | ^
199pr116047-2.h:1:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘c’
200 1 | a b c;
201 | ^
202$ /usr/src/gcc-14/obj/gcc/cc1.new -quiet -std=c23 pr116047.c -nostdinc
203In file included from pr116047-1.h:327677,
204 from pr116047.c:4:
205pr116047-2.h:1:1: error: unknown type name ‘a’
206 1 | a b c;
207 | ^
208pr116047-2.h:1:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘c’
209 1 | a b c;
210 | ^
211
212pr116047-1.h has on lines 327677+327678:
213 #include "pr116047-2.h"
214 static_assert (__LINE__ == 327678, "");
215so the static_assert failure is something that was dealt mainly in the
216LC_LEAVE hunk and files.cc reversion, but please have a look at the
217In file included from lines.
21814.2 emits correct line (#include "pr116047-2.h" is indeed on line
219327677) but some random column in there (which is not normally printed
220for smaller headers; 21 is the . before extension in the filename).
221Current trunk emits incorrect line (327678 instead of 327677, clearly
222it didn't decrement).
223And the patched compiler emits the right line with no column, as would
224be printed if I remove e.g. 300000 newlines from the file.
225
2262025-05-07 Jakub Jelinek <jakub@redhat.com>
227
228 PR preprocessor/108900
229 PR preprocessor/116047
230 PR preprocessor/120061
231 * files.cc (_cpp_stack_file): Revert 2025-03-28 change.
232 * line-map.cc (linemap_add): Use
233 SOURCE_LINE (from, linemap_included_from (map - 1)) + 1; instead of
234 SOURCE_LINE (from, from[1].start_location); to compute to_line
235 for LC_LEAVE. For LC_ENTER included_from computation, look at
236 map[-2] or even lower if map[-1] has the same start_location as
237 map[0].
238
239 * gcc.dg/plugin/plugin.exp: Add location-overflow-test-pr116047.c
240 and location-overflow-test-pr120061.c.
241 * gcc.dg/plugin/location_overflow_plugin.cc (plugin_init): Don't error
242 on unknown values, instead just break. Handle 0x4fHHHHHH arguments
243 differently.
244 * gcc.dg/plugin/location-overflow-test-pr116047.c: New test.
245 * gcc.dg/plugin/location-overflow-test-pr116047-1.h: New test.
246 * gcc.dg/plugin/location-overflow-test-pr116047-2.h: New test.
247 * gcc.dg/plugin/location-overflow-test-pr120061.c: New test.
248 * gcc.dg/plugin/location-overflow-test-pr120061-1.h: New test.
249 * gcc.dg/plugin/location-overflow-test-pr120061-2.h: New test.
250
251Upstream-Status: Backport [https://gcc.gnu.org/cgit/gcc/commit/?id=edf745dc519ddbfef127e2789bf11bfbacd300b7]
252Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
253---
254 .../plugin/location-overflow-test-pr116047-1.h | 6 +++
255 .../plugin/location-overflow-test-pr116047-2.h | 1 +
256 .../plugin/location-overflow-test-pr116047.c | 5 +++
257 .../plugin/location-overflow-test-pr120061-1.h | 6 +++
258 .../plugin/location-overflow-test-pr120061-2.h | 1 +
259 .../plugin/location-overflow-test-pr120061.c | 6 +++
260 .../gcc.dg/plugin/location_overflow_plugin.cc | 15 +++++--
261 gcc/testsuite/gcc.dg/plugin/plugin.exp | 4 +-
262 libcpp/files.cc | 8 ----
263 libcpp/line-map.cc | 48 ++++++++++++++++++----
264 10 files changed, 80 insertions(+), 20 deletions(-)
265 create mode 100644 gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr116047-1.h
266 create mode 100644 gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr116047-2.h
267 create mode 100644 gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr116047.c
268 create mode 100644 gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr120061-1.h
269 create mode 100644 gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr120061-2.h
270 create mode 100644 gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr120061.c
271
272diff --git a/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr116047-1.h b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr116047-1.h
273new file mode 100644
274index 000000000000..3dd6434a938b
275--- /dev/null
276+++ b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr116047-1.h
277@@ -0,0 +1,6 @@
278+
279+
280+
281+
282+#include "location-overflow-test-pr116047-2.h"
283+static_assert (__LINE__ == 6, "");
284diff --git a/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr116047-2.h b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr116047-2.h
285new file mode 100644
286index 000000000000..048f715b4656
287--- /dev/null
288+++ b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr116047-2.h
289@@ -0,0 +1 @@
290+int i;
291diff --git a/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr116047.c b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr116047.c
292new file mode 100644
293index 000000000000..75161fa5f055
294--- /dev/null
295+++ b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr116047.c
296@@ -0,0 +1,5 @@
297+/* PR preprocessor/116047 */
298+/* { dg-do preprocess } */
299+/* { dg-options "-nostdinc -std=c23 -fplugin-arg-location_overflow_plugin-value=0x4ffe0180" } */
300+#include "location-overflow-test-pr116047-1.h"
301+/* { dg-final { scan-file location-overflow-test-pr116047.i "static_assert\[^\n\r]\*6\[^\n\r]\*== 6" } } */
302diff --git a/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr120061-1.h b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr120061-1.h
303new file mode 100644
304index 000000000000..ebf7704f568e
305--- /dev/null
306+++ b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr120061-1.h
307@@ -0,0 +1,6 @@
308+
309+
310+
311+
312+#include "location-overflow-test-pr120061-2.h"
313+
314diff --git a/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr120061-2.h b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr120061-2.h
315new file mode 100644
316index 000000000000..048f715b4656
317--- /dev/null
318+++ b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr120061-2.h
319@@ -0,0 +1 @@
320+int i;
321diff --git a/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr120061.c b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr120061.c
322new file mode 100644
323index 000000000000..e8e803898da3
324--- /dev/null
325+++ b/gcc/testsuite/gcc.dg/plugin/location-overflow-test-pr120061.c
326@@ -0,0 +1,6 @@
327+/* PR preprocessor/120061 */
328+/* { dg-do preprocess } */
329+/* { dg-options "-nostdinc -std=c23 -fplugin-arg-location_overflow_plugin-value=0x61000000" } */
330+#include "location-overflow-test-pr120061-1.h"
331+static_assert (__LINE__ == 5, "");
332+/* { dg-final { scan-file location-overflow-test-pr120061.i "static_assert\[^\n\r]\*5\[^\n\r]\*== 5" } } */
333diff --git a/gcc/testsuite/gcc.dg/plugin/location_overflow_plugin.cc b/gcc/testsuite/gcc.dg/plugin/location_overflow_plugin.cc
334index f731b1421b0f..f770d35ea518 100644
335--- a/gcc/testsuite/gcc.dg/plugin/location_overflow_plugin.cc
336+++ b/gcc/testsuite/gcc.dg/plugin/location_overflow_plugin.cc
337@@ -85,9 +85,18 @@ plugin_init (struct plugin_name_args *plugin_info,
338 error_at (UNKNOWN_LOCATION, "missing plugin argument");
339
340 /* With 64-bit locations, the thresholds are larger, so shift the base
341- location argument accordingly. */
342+ location argument accordingly, basically remap the GCC 14 32-bit
343+ location_t argument values to 64-bit location_t counterparts. There
344+ is one exception for values slightly before the 32-bit location_t
345+ LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES (0x50000000). In that case
346+ remap them to the same amount before the 64-bit location_t
347+ LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES -
348+ ((location_t) 0x50000000) << 31. */
349 gcc_assert (sizeof (location_t) == sizeof (uint64_t));
350- base_location = 1 + ((base_location - 1) << 31);
351+ if (base_location >= 0x4f000000 && base_location <= 0x4fffffff)
352+ base_location += (((location_t) 0x50000000) << 31) - 0x50000000;
353+ else
354+ base_location = 1 + ((base_location - 1) << 31);
355
356 register_callback (plugin_info->base_name,
357 PLUGIN_PRAGMAS,
358@@ -107,7 +116,7 @@ plugin_init (struct plugin_name_args *plugin_info,
359 break;
360
361 default:
362- error_at (UNKNOWN_LOCATION, "unrecognized value for plugin argument");
363+ break;
364 }
365
366 return 0;
367diff --git a/gcc/testsuite/gcc.dg/plugin/plugin.exp b/gcc/testsuite/gcc.dg/plugin/plugin.exp
368index 90c91621d0aa..96e76d2e0c36 100644
369--- a/gcc/testsuite/gcc.dg/plugin/plugin.exp
370+++ b/gcc/testsuite/gcc.dg/plugin/plugin.exp
371@@ -138,7 +138,9 @@ set plugin_test_list [list \
372 { location_overflow_plugin.cc \
373 location-overflow-test-1.c \
374 location-overflow-test-2.c \
375- location-overflow-test-pr83173.c } \
376+ location-overflow-test-pr83173.c \
377+ location-overflow-test-pr116047.c \
378+ location-overflow-test-pr120061.c } \
379 { must_tail_call_plugin.cc \
380 must-tail-call-1.c \
381 must-tail-call-2.c } \
382diff --git a/libcpp/files.cc b/libcpp/files.cc
383index c1abde6639fe..d80c4bfd9077 100644
384--- a/libcpp/files.cc
385+++ b/libcpp/files.cc
386@@ -1047,14 +1047,6 @@ _cpp_stack_file (cpp_reader *pfile, _cpp_file *file, include_type type,
387 && (pfile->line_table->highest_location
388 != LINE_MAP_MAX_LOCATION - 1));
389
390- if (decrement && LINEMAPS_ORDINARY_USED (pfile->line_table))
391- {
392- const line_map_ordinary *map
393- = LINEMAPS_LAST_ORDINARY_MAP (pfile->line_table);
394- if (map && map->start_location == pfile->line_table->highest_location)
395- decrement = false;
396- }
397-
398 if (decrement)
399 pfile->line_table->highest_location--;
400
401diff --git a/libcpp/line-map.cc b/libcpp/line-map.cc
402index 17e7f12551c0..cf6557117c81 100644
403--- a/libcpp/line-map.cc
404+++ b/libcpp/line-map.cc
405@@ -621,8 +621,8 @@ linemap_add (line_maps *set, enum lc_reason reason,
406 #include "included", inside the same "includer" file. */
407
408 linemap_assert (!MAIN_FILE_P (map - 1));
409- /* (MAP - 1) points to the map we are leaving. The
410- map from which (MAP - 1) got included should be the map
411+ /* (MAP - 1) points to the map we are leaving. The
412+ map from which (MAP - 1) got included should be usually the map
413 that comes right before MAP in the same file. */
414 from = linemap_included_from_linemap (set, map - 1);
415
416@@ -630,7 +630,24 @@ linemap_add (line_maps *set, enum lc_reason reason,
417 if (to_file == NULL)
418 {
419 to_file = ORDINARY_MAP_FILE_NAME (from);
420- to_line = SOURCE_LINE (from, from[1].start_location);
421+ /* Compute the line on which the map resumes, for #include this
422+ should be the line after the #include line. Usually FROM is
423+ the map right before LC_ENTER map - the first map of the included
424+ file, and in that case SOURCE_LINE (from, from[1].start_location);
425+ computes the right line (and does handle even some special cases
426+ (e.g. where for returning from <command line> we still want to
427+ be at line 0 or some -traditional-cpp cases). In rare cases
428+ FROM can be followed by LC_RENAME created by linemap_line_start
429+ for line right after #include line. If that happens,
430+ start_location of the FROM[1] map will be the same as
431+ start_location of FROM[2] LC_ENTER, but FROM[1] start_location
432+ might not have advance enough for moving to a full next line.
433+ In that case compute the line of #include line and add 1 to it
434+ to advance to the next line. See PR120061. */
435+ if (from[1].reason == LC_RENAME)
436+ to_line = SOURCE_LINE (from, linemap_included_from (map - 1)) + 1;
437+ else
438+ to_line = SOURCE_LINE (from, from[1].start_location);
439 sysp = ORDINARY_MAP_IN_SYSTEM_HEADER_P (from);
440 }
441 else
442@@ -660,11 +677,26 @@ linemap_add (line_maps *set, enum lc_reason reason,
443 if (set->depth == 0)
444 map->included_from = 0;
445 else
446- /* The location of the end of the just-closed map. */
447- map->included_from
448- = (((map[0].start_location - 1 - map[-1].start_location)
449- & ~((loc_one << map[-1].m_column_and_range_bits) - 1))
450- + map[-1].start_location);
451+ {
452+ /* Compute location from whence this line map was included.
453+ For #include this should be preferrably column 0 of the
454+ line on which #include directive appears.
455+ map[-1] is the just closed map and usually included_from
456+ falls within that map. In rare cases linemap_line_start
457+ can insert a new LC_RENAME map for the line immediately
458+ after #include line, in that case map[-1] will have the
459+ same start_location as the new one and so included_from
460+ would not be from map[-1] but likely map[-2]. If that
461+ happens, mask off map[-2] m_column_and_range_bits bits
462+ instead of map[-1]. See PR120061. */
463+ int i = -1;
464+ while (map[i].start_location == map[0].start_location)
465+ --i;
466+ map->included_from
467+ = (((map[0].start_location - 1 - map[i].start_location)
468+ & ~((loc_one << map[i].m_column_and_range_bits) - 1))
469+ + map[i].start_location);
470+ }
471 set->depth++;
472 if (set->trace_includes)
473 trace_include (set, map);
474--
475
diff --git a/meta/recipes-devtools/gcc/gcc_14.1.bb b/meta/recipes-devtools/gcc/gcc_15.1.bb
index 255fe552bd..255fe552bd 100644
--- a/meta/recipes-devtools/gcc/gcc_14.1.bb
+++ b/meta/recipes-devtools/gcc/gcc_15.1.bb
diff --git a/meta/recipes-devtools/gcc/libgcc-common.inc b/meta/recipes-devtools/gcc/libgcc-common.inc
index d9084af51a..65bcd24bc7 100644
--- a/meta/recipes-devtools/gcc/libgcc-common.inc
+++ b/meta/recipes-devtools/gcc/libgcc-common.inc
@@ -53,6 +53,11 @@ do_install:append:libc-newlib () {
53 rmdir ${D}${base_libdir} 53 rmdir ${D}${base_libdir}
54 fi 54 fi
55} 55}
56do_install:append:libc-picolibc () {
57 if [ "${base_libdir}" != "${libdir}" ]; then
58 rmdir ${D}${base_libdir}
59 fi
60}
56 61
57# No rpm package is actually created but -dev depends on it, avoid dnf error 62# No rpm package is actually created but -dev depends on it, avoid dnf error
58DEV_PKG_DEPENDENCY:libc-baremetal = "" 63DEV_PKG_DEPENDENCY:libc-baremetal = ""
@@ -99,7 +104,6 @@ fakeroot python do_multilib_install() {
99 os.symlink(src, dest) 104 os.symlink(src, dest)
100 return 105 return
101 106
102
103 for ml in multilibs.split(): 107 for ml in multilibs.split():
104 tune = d.getVar('DEFAULTTUNE:virtclass-multilib-' + ml) 108 tune = d.getVar('DEFAULTTUNE:virtclass-multilib-' + ml)
105 if not tune: 109 if not tune:
diff --git a/meta/recipes-devtools/gcc/libgcc-initial.inc b/meta/recipes-devtools/gcc/libgcc-initial.inc
index 8251e3c286..ce100d7ddc 100644
--- a/meta/recipes-devtools/gcc/libgcc-initial.inc
+++ b/meta/recipes-devtools/gcc/libgcc-initial.inc
@@ -29,7 +29,7 @@
29 29
30require libgcc-common.inc 30require libgcc-common.inc
31 31
32DEPENDS = "virtual/${TARGET_PREFIX}gcc" 32DEPENDS = "virtual/cross-cc"
33 33
34LICENSE = "GPL-3.0-with-GCC-exception" 34LICENSE = "GPL-3.0-with-GCC-exception"
35 35
diff --git a/meta/recipes-devtools/gcc/libgcc-initial_14.1.bb b/meta/recipes-devtools/gcc/libgcc-initial_15.1.bb
index a259082b47..a259082b47 100644
--- a/meta/recipes-devtools/gcc/libgcc-initial_14.1.bb
+++ b/meta/recipes-devtools/gcc/libgcc-initial_15.1.bb
diff --git a/meta/recipes-devtools/gcc/libgcc.inc b/meta/recipes-devtools/gcc/libgcc.inc
index 84a2d930df..a3f0f947f7 100644
--- a/meta/recipes-devtools/gcc/libgcc.inc
+++ b/meta/recipes-devtools/gcc/libgcc.inc
@@ -1,6 +1,6 @@
1require libgcc-common.inc 1require libgcc-common.inc
2 2
3DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ virtual/${MLPREFIX}libc" 3DEPENDS = "virtual/cross-cc virtual/cross-c++ virtual/${MLPREFIX}libc"
4 4
5do_install:append:class-target () { 5do_install:append:class-target () {
6 if [ "${TCLIBC}" != "glibc" ]; then 6 if [ "${TCLIBC}" != "glibc" ]; then
@@ -36,7 +36,6 @@ LICENSE:${PN} = "GPL-3.0-with-GCC-exception"
36LICENSE:${PN}-dev = "GPL-3.0-with-GCC-exception" 36LICENSE:${PN}-dev = "GPL-3.0-with-GCC-exception"
37LICENSE:${PN}-dbg = "GPL-3.0-with-GCC-exception" 37LICENSE:${PN}-dbg = "GPL-3.0-with-GCC-exception"
38 38
39
40FILES:${PN}-dev = "\ 39FILES:${PN}-dev = "\
41 ${base_libdir}/libgcc*.so \ 40 ${base_libdir}/libgcc*.so \
42 ${@oe.utils.conditional('BASETARGET_SYS', '${TARGET_SYS}', '', '${libdir}/${BASETARGET_SYS}', d)} \ 41 ${@oe.utils.conditional('BASETARGET_SYS', '${TARGET_SYS}', '', '${libdir}/${BASETARGET_SYS}', d)} \
diff --git a/meta/recipes-devtools/gcc/libgcc_14.1.bb b/meta/recipes-devtools/gcc/libgcc_15.1.bb
index fdcd6cc0da..fdcd6cc0da 100644
--- a/meta/recipes-devtools/gcc/libgcc_14.1.bb
+++ b/meta/recipes-devtools/gcc/libgcc_15.1.bb
diff --git a/meta/recipes-devtools/gcc/libgfortran.inc b/meta/recipes-devtools/gcc/libgfortran.inc
index e810146d4d..fa6aecaaa3 100644
--- a/meta/recipes-devtools/gcc/libgfortran.inc
+++ b/meta/recipes-devtools/gcc/libgfortran.inc
@@ -8,7 +8,7 @@ EXTRA_OECONF_PATHS = "\
8# An arm hard float target like raspberrypi4 won't build 8# An arm hard float target like raspberrypi4 won't build
9# as CFLAGS don't make it to the fortran compiler otherwise 9# as CFLAGS don't make it to the fortran compiler otherwise
10# (the configure script sets FC to $GFORTRAN unconditionally) 10# (the configure script sets FC to $GFORTRAN unconditionally)
11export GFORTRAN = "${FC}" 11export GFORTRAN = "${FC} -ffile-prefix-map=${S}=${TARGET_DBGSRC_DIR} -ffile-prefix-map=${B}=${TARGET_DBGSRC_DIR} -gno-record-gcc-switches"
12 12
13do_configure () { 13do_configure () {
14 for target in libbacktrace libgfortran 14 for target in libbacktrace libgfortran
@@ -47,8 +47,9 @@ do_install () {
47 chown -R root:root ${D} 47 chown -R root:root ${D}
48} 48}
49 49
50# avoid virtual/libc
50INHIBIT_DEFAULT_DEPS = "1" 51INHIBIT_DEFAULT_DEPS = "1"
51DEPENDS = "gcc-runtime gcc-cross-${TARGET_ARCH}" 52DEPENDS = "virtual/cross-cc virtual/compilerlibs"
52 53
53BBCLASSEXTEND = "nativesdk" 54BBCLASSEXTEND = "nativesdk"
54 55
diff --git a/meta/recipes-devtools/gcc/libgfortran_14.1.bb b/meta/recipes-devtools/gcc/libgfortran_15.1.bb
index 71dd8b4bdc..71dd8b4bdc 100644
--- a/meta/recipes-devtools/gcc/libgfortran_14.1.bb
+++ b/meta/recipes-devtools/gcc/libgfortran_15.1.bb