summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denys@ti.com>2017-06-15 15:09:49 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-28 15:51:55 +0100
commit2ad6c563828e70728eb48095b2326b52342df37c (patch)
treecc51338acc8d6187c0fe45223d7790c7ce8df4d0
parent5d8f4c46329fbd38ebd034c1e32aa49dfec5f529 (diff)
downloadopenembedded-core-contrib-2ad6c563828e70728eb48095b2326b52342df37c.tar.gz
toolchain-scripts: add check for LD_LIBRARY_PATH in the SDK env setup script
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>
-rw-r--r--meta/classes/toolchain-scripts.bbclass15
1 files changed, 15 insertions, 0 deletions
diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
index 0ee0ec53f5..9bcfe708c7 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -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