]> code.ossystems Code Review - openembedded-core.git/commitdiff
toolchain-scripts: add check for LD_LIBRARY_PATH in the SDK env setup script
authorDenys Dmytriyenko <denys@ti.com>
Thu, 15 Jun 2017 19:09:49 +0000 (15:09 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 28 Jun 2017 14:51:55 +0000 (15:51 +0100)
Provide a descriptive error message and exit the environment-setup script,
when LD_LIBRARY_PATH is set on the host system.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/toolchain-scripts.bbclass

index 0ee0ec53f59ccadb8bd2e6e2a387e1809b014159..9bcfe708c7c62a3dbf1d7fff81f4e8b0ee99c71a 100644 (file)
@@ -24,6 +24,21 @@ toolchain_create_sdk_env_script () {
        script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-$multimach_target_sys}
        rm -f $script
        touch $script
+
+       echo '# Check for LD_LIBRARY_PATH being set, which can break SDK and generally is a bad practice' >> $script
+       echo '# http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html#AEN80' >> $script
+       echo '# http://xahlee.info/UnixResource_dir/_/ldpath.html' >> $script
+       echo '# Only disable this check if you are absolutely know what you are doing!' >> $script
+       echo 'if [ ! -z "$LD_LIBRARY_PATH" ]; then' >> $script
+       echo "    echo \"Your environment is misconfigured, you probably need to 'unset LD_LIBRARY_PATH'\"" >> $script
+       echo "    echo \"but please check why this was set in the first place and that it's safe to unset.\"" >> $script
+       echo '    echo "The SDK will not operate correctly in most cases when LD_LIBRARY_PATH is set."' >> $script
+       echo '    echo "For more references see:"' >> $script
+       echo '    echo "  http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html#AEN80"' >> $script
+       echo '    echo "  http://xahlee.info/UnixResource_dir/_/ldpath.html"' >> $script
+       echo '    return 1' >> $script
+       echo 'fi' >> $script
+
        echo 'export SDKTARGETSYSROOT='"$sysroot" >> $script
        EXTRAPATH=""
        for i in ${CANADIANEXTRAOS}; do