summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denys@konsulko.com>2025-03-20 17:21:07 +0100
committerSteve Sakoman <steve@sakoman.com>2025-03-26 08:48:51 -0700
commit25a23bd2d5d6b7753e6a7fa3201256338c25203d (patch)
treebcb270099348bd136f4e348ed24cb0940e83a21c /meta/recipes-devtools/gcc
parent157b779e7672c10aa8690a776d8d698a2efa85f5 (diff)
downloadpoky-25a23bd2d5d6b7753e6a7fa3201256338c25203d.tar.gz
gcc: unify cleanup of include-fixed, apply to cross-canadian
Since target and cross variants were already doing similar cleanup of include-fixed headers, as those aren't used, unify the code and also apply the same to cross-canadian variant. Some of those header files get processed with a tool that leaves absolute buildpaths inside the file's commented section, causing QA errors. Since those aren't used, let's remove them. This may be a temporary solution until the tool itself gets fixed to not embed absolute buildpaths in the header files: https://lists.openembedded.org/g/openembedded-core/topic/107268307 (From OE-Core rev: 621e0ac9308cc163fb767a27d63fff6570896b92) Signed-off-by: Denys Dmytriyenko <denys@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-devtools/gcc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-common.inc4
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-canadian.inc2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross.inc2
-rw-r--r--meta/recipes-devtools/gcc/gcc-target.inc31
4 files changed, 8 insertions, 31 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc
index 7f5cc109e6..01de93cc3c 100644
--- a/meta/recipes-devtools/gcc/gcc-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-common.inc
@@ -138,3 +138,7 @@ remove_sysroot_paths_from_checksum_options () {
138 sed -i "s@${DEBUG_PREFIX_MAP}@@g" ${B}/gcc/checksum-options 138 sed -i "s@${DEBUG_PREFIX_MAP}@@g" ${B}/gcc/checksum-options
139 sed -i "s@$stagingdir@$replacement@g" ${B}/gcc/checksum-options 139 sed -i "s@$stagingdir@$replacement@g" ${B}/gcc/checksum-options
140} 140}
141
142cleanup_installed_include_fixed () {
143 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
144}
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
index adcaef2b0f..69ca18bf6e 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
@@ -174,6 +174,8 @@ do_install () {
174 done 174 done
175 done 175 done
176 done 176 done
177
178 cleanup_installed_include_fixed
177} 179}
178 180
179ELFUTILS = "nativesdk-elfutils" 181ELFUTILS = "nativesdk-elfutils"
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index 1dbb6dc42b..9c8cc94c3a 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -108,7 +108,7 @@ do_install () {
108 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/
109 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/
110 110
111 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
112 112
113 # install LTO linker plugins where binutils tools can find it 113 # install LTO linker plugins where binutils tools can find it
114 install -d ${D}${libdir}/bfd-plugins 114 install -d ${D}${libdir}/bfd-plugins
diff --git a/meta/recipes-devtools/gcc/gcc-target.inc b/meta/recipes-devtools/gcc/gcc-target.inc
index f51d94cd65..08141f32e6 100644
--- a/meta/recipes-devtools/gcc/gcc-target.inc
+++ b/meta/recipes-devtools/gcc/gcc-target.inc
@@ -206,37 +206,8 @@ do_install () {
206 install -d ${D}${libdir}/bfd-plugins 206 install -d ${D}${libdir}/bfd-plugins
207 ln -sf ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/liblto_plugin.so ${D}${libdir}/bfd-plugins/liblto_plugin.so 207 ln -sf ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/liblto_plugin.so ${D}${libdir}/bfd-plugins/liblto_plugin.so
208 chown -R root:root ${D} 208 chown -R root:root ${D}
209}
210 209
211do_install:append () { 210 cleanup_installed_include_fixed
212 #
213 # Thefixinc.sh script, run on the gcc's compile phase, looks into sysroot header
214 # files and places the modified files into
215 # {D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed folder. This makes the
216 # build not deterministic. The following code prunes all those headers
217 # except those under include-fixed/linux, *limits.h and README, yielding
218 # the same include-fixed folders no matter what sysroot
219
220 include_fixed="${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed"
221 for f in $(find ${include_fixed} -type f); do
222 case $f in
223 */include-fixed/linux/*)
224 continue
225 ;;
226 */include-fixed/*limits.h)
227 continue
228 ;;
229 */include-fixed/README)
230 continue
231 ;;
232 *)
233 # remove file and directory if empty
234 bbdebug 2 "Pruning $f"
235 rm $f
236 find $(dirname $f) -maxdepth 0 -empty -exec rmdir {} \;
237 ;;
238 esac
239 done
240} 211}
241 212
242# Installing /usr/lib/gcc/* means we'd have two copies, one from gcc-cross 213# Installing /usr/lib/gcc/* means we'd have two copies, one from gcc-cross