When we stashed the gcc build directory for use in generating the various runtimes
we were being lazy and just used the staging directory. With recipe specific
sysroots this means we're copying a large chunk of data around with the cross
compiler which we don't really need in most cases.
Separate out the data into its own task and inject this into the configure
step. We have to do that here since autotools will wipe out ${B} if it thinks
we're rebuilding and we therefore have to time its recreation after that.
This also takes the opportunity to remove some pointless (as far as I can tell)
conditionals from the do_install code.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
inherit autotools gettext texinfo
BPN = "gcc"
+COMPILERINITIAL = ""
+COMPILERDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}gcc${COMPILERINITIAL}:do_gcc_stash_builddir"
+COMPILERDEP_class-nativesdk = "virtual/${TARGET_PREFIX}gcc${COMPILERINITIAL}-crosssdk:do_gcc_stash_builddir"
+
+python extract_stashed_builddir () {
+ src = d.expand("${STAGING_DIR}-components/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}")
+ dest = d.getVar("B")
+ oe.path.copyhardlinktree(src, dest)
+ staging_processfixme([src + "/fixmepath"], dest, dest, dest, d)
+}
def get_gcc_float_setting(bb, d):
if d.getVar('ARMPKGSFX_EABI') == "hf" and d.getVar('TRANSLATED_TARGET_ARCH') == "arm":
# so we overwirte the generated include-fixed/limits.h for gcc-cross-initial
# to get rid references to real limits.h
cp gcc/include-fixed/limits.h ${D}${gcclibdir}/${TARGET_SYS}/${BINV}/include/limits.h
-
- # gcc-runtime installs libgcc into a special location in staging since it breaks doing a standalone build
- case ${PN} in
- *gcc-cross-initial-${TARGET_ARCH}|*gcc-crosssdk-initial-${SDK_SYS})
- dest=${D}/${includedir}/gcc-build-internal-initial-${TARGET_SYS}
- hardlinkdir . $dest
- ;;
- esac
}
#
# Override the default sysroot staging copy since this won't look like a target system
do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR}-components/${PACKAGE_ARCH}/${PN}"
inherit nopackages
+
+COMPILERINITIAL = "-initial"
# We use libiberty from binutils
find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
-
- # gcc-runtime installs libgcc into a special location in staging since it breaks doing a standalone build
- case ${PN} in
- *gcc-cross-${TARGET_ARCH}|*gcc-crosssdk-${SDK_SYS})
- dest=${D}/${includedir}/gcc-build-internal-${TARGET_SYS}
- hardlinkdir . $dest
- ;;
- esac
}
-# This is reflected in the recipe name and target gcc shouldn't depend
-# on SDK settings either
-do_install[vardepsexclude] += "SDK_SYS"
do_package[noexec] = "1"
do_packagedata[noexec] = "1"
do_package_write_ipk[noexec] = "1"
do_package_write_rpm[noexec] = "1"
do_package_write_deb[noexec] = "1"
+
+BUILDDIRSTASH = "${WORKDIR}/stashed-builddir"
+do_gcc_stash_builddir[dirs] = "${B}"
+do_gcc_stash_builddir[cleandirs] = "${BUILDDIRSTASH}"
+do_gcc_stash_builddir () {
+ dest=${BUILDDIRSTASH}
+ hardlinkdir . $dest
+}
+addtask do_gcc_stash_builddir after do_compile
+SSTATETASKS += "do_gcc_stash_builddir"
+do_gcc_stash_builddir[sstate-inputdirs] = "${BUILDDIRSTASH}"
+do_gcc_stash_builddir[sstate-outputdirs] = "${STAGING_DIR}-components/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}"
+do_gcc_stash_builddir[sstate-fixmedir] = "${STAGING_DIR}-components/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}"
+
+python do_gcc_stash_builddir_setscene () {
+ sstate_setscene(d)
+}
+addtask do_gcc_stash_builddir_setscene
do_configure () {
export CXX="${CXX} -nostdinc++ -nostdlib++"
- mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
- target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
- hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B}
+ target=${TARGET_SYS}
+
for d in libgcc ${RUNTIMETARGET}; do
echo "Configuring $d"
rm -rf ${B}/$target/$d/
$relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
done
}
+EXTRACONFFUNCS += "extract_stashed_builddir"
+do_configure[depends] += "${COMPILERDEP}"
do_compile () {
target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
"
do_configure () {
- mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
- if [ -d ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ]; then
- hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B}
- fi
echo "Configuring libsanitizer"
rm -rf ${B}/$target/libsanitizer/
# Link to the sysroot's libstdc++ instead of one gcc thinks it just built
sed -i -e '/LIBSTDCXX_RAW_CXX_\(CXXFLAGS\|LDFLAGS\)\s*=/d' ${B}/$target/libsanitizer/*/Makefile
}
+EXTRACONFFUNCS += "extract_stashed_builddir"
+do_configure[depends] += "${COMPILERDEP}"
do_compile () {
target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
do_configure () {
target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
install -d ${D}${base_libdir} ${D}${libdir}
- hardlinkdir ${STAGING_INCDIR_NATIVE}/${LIBGCCBUILDTREENAME}$target/ ${B}
mkdir -p ${B}/${BPN}
mkdir -p ${B}/$target/${BPN}/
cd ${B}/${BPN}
relpath=${@os.path.relpath("${S}/${BPN}", "${B}/${BPN}")}
$relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
}
+EXTRACONFFUNCS += "extract_stashed_builddir"
+do_configure[depends] += "${COMPILERDEP}"
do_compile () {
target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
EXTRA_OECONF += "--disable-shared"
-LIBGCCBUILDTREENAME = "gcc-build-internal-initial-"
+COMPILERINITIAL = "-initial"
inherit nopackages
${libdir}/${TARGET_ARCH}${TARGET_VENDOR}* \
"
-LIBGCCBUILDTREENAME = "gcc-build-internal-"
-
do_package[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
"
do_configure () {
- mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
- hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B}
echo "Configuring libgfortran"
rm -rf ${B}/$target/libgfortran/
# broken libtool here
sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libgfortran/libtool
}
+EXTRACONFFUNCS += "extract_stashed_builddir"
+do_configure[depends] += "${COMPILERDEP}"
do_compile () {
target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`