diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-24 13:18:12 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-26 10:44:27 +0000 |
commit | 42ed1d8ac9799e41544c2da93069ecc6f86cbded (patch) | |
tree | 0a67a6c18c1964c048c8a821fddf7da7de506c95 /meta/recipes-devtools/gcc/gcc-cross.inc | |
parent | 1cec0f3bf4fa784e91ee4cdb66376361ecbff18e (diff) | |
download | poky-42ed1d8ac9799e41544c2da93069ecc6f86cbded.tar.gz |
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.
(From OE-Core rev: dcf15ccf3cc9d55e77228ba8d526f967fc9791b4)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-cross.inc')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-cross.inc | 29 |
1 files changed, 18 insertions, 11 deletions
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 () { | |||
185 | # We use libiberty from binutils | 185 | # We use libiberty from binutils |
186 | find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f | 186 | find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f |
187 | find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f | 187 | find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f |
188 | |||
189 | # gcc-runtime installs libgcc into a special location in staging since it breaks doing a standalone build | ||
190 | case ${PN} in | ||
191 | *gcc-cross-${TARGET_ARCH}|*gcc-crosssdk-${SDK_SYS}) | ||
192 | dest=${D}/${includedir}/gcc-build-internal-${TARGET_SYS} | ||
193 | hardlinkdir . $dest | ||
194 | ;; | ||
195 | esac | ||
196 | } | 188 | } |
197 | # This is reflected in the recipe name and target gcc shouldn't depend | ||
198 | # on SDK settings either | ||
199 | do_install[vardepsexclude] += "SDK_SYS" | ||
200 | 189 | ||
201 | do_package[noexec] = "1" | 190 | do_package[noexec] = "1" |
202 | do_packagedata[noexec] = "1" | 191 | do_packagedata[noexec] = "1" |
203 | do_package_write_ipk[noexec] = "1" | 192 | do_package_write_ipk[noexec] = "1" |
204 | do_package_write_rpm[noexec] = "1" | 193 | do_package_write_rpm[noexec] = "1" |
205 | do_package_write_deb[noexec] = "1" | 194 | do_package_write_deb[noexec] = "1" |
195 | |||
196 | BUILDDIRSTASH = "${WORKDIR}/stashed-builddir" | ||
197 | do_gcc_stash_builddir[dirs] = "${B}" | ||
198 | do_gcc_stash_builddir[cleandirs] = "${BUILDDIRSTASH}" | ||
199 | do_gcc_stash_builddir () { | ||
200 | dest=${BUILDDIRSTASH} | ||
201 | hardlinkdir . $dest | ||
202 | } | ||
203 | addtask do_gcc_stash_builddir after do_compile | ||
204 | SSTATETASKS += "do_gcc_stash_builddir" | ||
205 | do_gcc_stash_builddir[sstate-inputdirs] = "${BUILDDIRSTASH}" | ||
206 | do_gcc_stash_builddir[sstate-outputdirs] = "${STAGING_DIR}-components/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}" | ||
207 | do_gcc_stash_builddir[sstate-fixmedir] = "${STAGING_DIR}-components/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}" | ||
208 | |||
209 | python do_gcc_stash_builddir_setscene () { | ||
210 | sstate_setscene(d) | ||
211 | } | ||
212 | addtask do_gcc_stash_builddir_setscene | ||