summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-cross.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-cross.inc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross.inc25
1 files changed, 7 insertions, 18 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index a540fb2434..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,16 +33,17 @@ 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} \
40 --with-gxx-libcxx-include-dir=/not/exist${target_includedir}/c++/v1 \
40 --with-sysroot=/not/exist \ 41 --with-sysroot=/not/exist \
41 --with-build-sysroot=${STAGING_DIR_TARGET} \ 42 --with-build-sysroot=${STAGING_DIR_TARGET} \
42" 43"
43 44
44ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}" 45ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
45 46
46
47do_configure:prepend () { 47do_configure:prepend () {
48 install -d ${RECIPE_SYSROOT}${target_includedir} 48 install -d ${RECIPE_SYSROOT}${target_includedir}
49 touch ${RECIPE_SYSROOT}${target_includedir}/limits.h 49 touch ${RECIPE_SYSROOT}${target_includedir}/limits.h
@@ -61,19 +61,8 @@ do_compile () {
61 export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" 61 export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
62 export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" 62 export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
63 63
64 # Prevent native/host sysroot path from being used in configargs.h header, 64 remove_sysroot_paths_from_configargs '/host'
65 # as it will be rewritten when used by other sysroots preventing support 65 remove_sysroot_paths_from_checksum_options '${STAGING_DIR_HOST}' '/host'
66 # for gcc plugins
67 oe_runmake configure-gcc
68 sed -i 's@${STAGING_DIR_TARGET}@/host@g' ${B}/gcc/configargs.h
69 sed -i 's@${STAGING_DIR_HOST}@/host@g' ${B}/gcc/configargs.h
70
71 # Prevent sysroot/workdir paths from being used in checksum-options.
72 # checksum-options is used to generate a checksum which is embedded into
73 # the output binary.
74 oe_runmake TARGET-gcc=checksum-options all-gcc
75 sed -i 's@${DEBUG_PREFIX_MAP}@@g' ${B}/gcc/checksum-options
76 sed -i 's@${STAGING_DIR_HOST}@/host@g' ${B}/gcc/checksum-options
77 66
78 oe_runmake all-host configure-target-libgcc 67 oe_runmake all-host configure-target-libgcc
79 (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)
@@ -104,7 +93,7 @@ do_install () {
104 # 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.
105 dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/ 94 dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
106 install -d $dest 95 install -d $dest
107 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
108 ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t 97 ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
109 ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t ${dest}${TARGET_PREFIX}$t 98 ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t ${dest}${TARGET_PREFIX}$t
110 done 99 done
@@ -119,7 +108,7 @@ do_install () {
119 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/
120 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/
121 110
122 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
123 112
124 # install LTO linker plugins where binutils tools can find it 113 # install LTO linker plugins where binutils tools can find it
125 install -d ${D}${libdir}/bfd-plugins 114 install -d ${D}${libdir}/bfd-plugins