From patchwork Thu Jun 15 19:09:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denys Dmytriyenko X-Patchwork-Id: 105686 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp952212qgd; Thu, 15 Jun 2017 12:10:08 -0700 (PDT) X-Received: by 10.98.137.217 with SMTP id n86mr6552041pfk.85.1497553807909; Thu, 15 Jun 2017 12:10:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497553807; cv=none; d=google.com; s=arc-20160816; b=wrVDkHrAGaLd6b9KfSsWH0EBJmp9j4QskycOxKaZLtalaWOneVoLAQXuupWmwHlWBi ttZkhXDh8xzljR8Ll4MKvYURAqKqB9DHiumUp9wEqEg7yu9HuA/bBA0DPe51JjXc/Of5 FS2Jv6bUvjztCIwiqOrqFpkgkk/WeAmarSToqgWpumTC9VOXaLBAyfqOXzxivD/RSyMv tluXwHbaRGsx2avbTX1uuXTLZ6k3dLRHoW9SxQLrFGx9Arqhx7PkSMlANwl5Wuwm9EeS Zx4LwIO6uz5Y4uC/l9s3e//dGqF7Y4Kfen2zpjI3SpMUsiU4RfGbaJvzQ+e4e9uK35QU EFKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from:delivered-to :arc-authentication-results; bh=b66IdUloU5vJo1h/C+GbMOujVVZSoOwyEixGoVNgBik=; b=y42lfzwNMGUU7sTQdKne5s7Ury7ZBoE1zmkMWBNDbsPyW1g0v7Na1P/PWkavzwMyMb r3iDw6gKNMtTJ2wKk8QTxlnrmLhjKLnRgc5C3o1iorWrE2N1Xl6cynC6VVxUObXQHYel RZ5CILQ/WtgJJ/mGq5Ais6EUsAw6sgqcwNYY/sjlk61sX8/oo6/sHAN56Jb8wZqMwy+l oLJXhj4Q3qFTD8KELruon7cywUAK9ggbPrxbMw4VywtkVKBBXLtzR2HT3I+OI9RvjK5c XeNoIcfupr+ncWvaY6/NajyiwpnZ+j6SLimnWV4orWvuqyMftoCa8VtCZwEoDTLxKkhl HDlQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id s89si32737pfk.417.2017.06.15.12.10.07; Thu, 15 Jun 2017 12:10:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Received: from review.yoctoproject.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id EE12C783F8; Thu, 15 Jun 2017 19:09:55 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mailout4.zoneedit.com (mailout4.zoneedit.com [64.68.198.17]) by mail.openembedded.org (Postfix) with ESMTP id 159E9783EA for ; Thu, 15 Jun 2017 19:09:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mailout4.zoneedit.com (Postfix) with ESMTP id 959F120B86; Thu, 15 Jun 2017 19:09:53 +0000 (UTC) Received: from mailout4.zoneedit.com ([127.0.0.1]) by localhost (zmo03-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xwYvUHoTS-nH; Thu, 15 Jun 2017 19:09:53 +0000 (UTC) Received: from mail.denix.org (pool-100-15-85-143.washdc.fios.verizon.net [100.15.85.143]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout4.zoneedit.com (Postfix) with ESMTPSA id 739A5207AF; Thu, 15 Jun 2017 19:09:52 +0000 (UTC) Received: from gimli.denix (gimli [192.168.0.6]) by mail.denix.org (Postfix) with ESMTP id EF60B1624E1; Thu, 15 Jun 2017 15:09:51 -0400 (EDT) From: Denys Dmytriyenko To: openembedded-core@lists.openembedded.org Date: Thu, 15 Jun 2017 15:09:49 -0400 Message-Id: <1497553789-126570-1-git-send-email-denis@denix.org> X-Mailer: git-send-email 2.7.4 Cc: Denys Dmytriyenko Subject: [OE-core] [PATCH] toolchain-scripts: add check for LD_LIBRARY_PATH in the SDK env setup script X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org From: Denys Dmytriyenko 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 --- meta/classes/toolchain-scripts.bbclass | 15 +++++++++++++++ 1 file changed, 15 insertions(+) -- 2.7.4 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass index 260ece9..ef7b26f 100644 --- a/meta/classes/toolchain-scripts.bbclass +++ b/meta/classes/toolchain-scripts.bbclass @@ -25,6 +25,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