]> code.ossystems Code Review - openembedded-core.git/commitdiff
toolchain-scripts: preserve host path in environment setup script
authorChin Huat Ang <chin.huat.ang@intel.com>
Wed, 25 Apr 2018 08:00:13 +0000 (16:00 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 5 Nov 2018 16:02:08 +0000 (16:02 +0000)
The environment setup script generated in the build directory sets the PATH
variable by expanding ${PATH} which would have host paths filtered. Sourcing
this script to run runqemu will not work as it complains host stty (/bin/stty)
cannot be found.

To resolve this, the script no longer expands ${PATH} during generation time,
instead it will now source oe-init-build-env to initialize the build
environment so that all host paths will be preserved. Also be sure to prepend
STAGING_BINDIR_TOOLCHAIN to the PATH variable so that the toolchain from the
build directory can be found.

[YOCTO #12695]

(From OE-Core rev: a64a144096c0637387244b89ed22f4b5352b2522)

Signed-off-by: Chin Huat Ang <chin.huat.ang@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/classes/toolchain-scripts.bbclass

index 9bcfe708c7c62a3dbf1d7fff81f4e8b0ee99c71a..c9a04dd1d998c648dabd2bfb18651f26c2fb6e7b 100644 (file)
@@ -62,7 +62,8 @@ toolchain_create_tree_env_script () {
        script=${TMPDIR}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}
        rm -f $script
        touch $script
-       echo 'export PATH=${STAGING_DIR_NATIVE}/usr/bin:${PATH}' >> $script
+       echo ". ${COREBASE}/oe-init-build-env ${TOPDIR}" >> $script
+       echo 'export PATH=${STAGING_DIR_NATIVE}/usr/bin:${STAGING_BINDIR_TOOLCHAIN}:$PATH' >> $script
        echo 'export PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR}' >> $script
        echo 'export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}' >> $script
        echo 'export CONFIG_SITE="${@siteinfo_get_files(d)}"' >> $script