From dcf15ccf3cc9d55e77228ba8d526f967fc9791b4 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 24 Jan 2017 13:18:12 +0000 Subject: gcc: Split builddir saving into its own sstate task 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 --- meta/recipes-devtools/gcc/gcc-cross.inc | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'meta/recipes-devtools/gcc/gcc-cross.inc') diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc index c4f7084ba0..f3ae4fe6b1 100644 --- a/meta/recipes-devtools/gcc/gcc-cross.inc +++ b/meta/recipes-devtools/gcc/gcc-cross.inc @@ -185,21 +185,28 @@ do_install () { # 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 -- cgit 1.2.3-korg