From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by mail.openembedded.org (Postfix) with ESMTP id 4AF3165E39 for ; Thu, 12 Jun 2014 10:14:49 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.14.5/8.14.5) with ESMTP id s5CAEkUc003951 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Thu, 12 Jun 2014 03:14:48 -0700 (PDT) Received: from [128.224.162.201] (128.224.162.201) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.169.1; Thu, 12 Jun 2014 03:14:46 -0700 Message-ID: <53997D96.5040906@windriver.com> Date: Thu, 12 Jun 2014 18:14:46 +0800 From: yzhu1 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Khem Raj , "rongqing.li@windriver.com" References: <1402039028-17192-1-git-send-email-rongqing.li@windriver.com> In-Reply-To: X-Originating-IP: [128.224.162.201] Cc: "openembedded-core@lists.openembedded.org" Subject: Re: [PATCH] relocate_sdk.py: fix lib path error 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: , X-List-Received-Date: Thu, 12 Jun 2014 10:14:52 -0000 Content-Type: multipart/alternative; boundary="------------030205010909040408050500" --------------030205010909040408050500 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit On 06/06/2014 08:22 PM, Khem Raj wrote: > > > On Friday, June 6, 2014, > wrote: > > From: yzhu1 > > > In centos 5.9 32bit, ld lib does not contain some flags, so ld > lib is not parsed. So correct lib path is not got from ld lib. > > > Can you explain with examples what's going on here ? Hi, Before relocate_sdk.sh is executed, it needs the parameters: path/ld-linux-x86-64.so.2 path/dmesg.util-linux path/kill.util-linux path/reset.util-linux ..... The file list (path/dmesg.util-linux path/kill.util-linux path/reset.util-linux .....) is collected by "grep '\(executable\|dynamically linked\)'". So "dynamically linked" is very import to the file ld-linux-x86-64.so.2. But in redhat 5.9(32 bit) This file is as below: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped In Ubuntu 12.04 (64bit) This file is as below: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=0xbb8c5184d8d41f31093193a2ec8d3f6f10964cd2, stripped In this case, we can find in Ubuntu 12.04(64 bit), the flag "dynamically linked" is present, so ld-linux-x86-64.so.2 can be included in the file list. relocate_sdk.py can work according to the information from ld-linux-x86-64.so.2. But in redhat 5.9(32bit), the flag does not exist. relocate_sdk.py can not get the information from ld-linux-x86-64.so.2 since this file is not included in the file list. The same error occurs on redhat6.0(32 bit). So the direct solution to this defect is to force this file ld-linux-x86-64.so.2 exist in file list. If any problem, please feel free to let me know. Best Regards! Zhu Yanjun > > Signed-off-by: yzhu1 > > --- > scripts/relocate_sdk.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py > index 05d9fd6..a05a7fa 100755 > --- a/scripts/relocate_sdk.py > +++ b/scripts/relocate_sdk.py > @@ -201,7 +201,7 @@ else: > new_prefix = sys.argv[1].encode() > new_dl_path = sys.argv[2].encode() > > -executables_list = sys.argv[3:] > +executables_list = sys.argv[2:] > > for e in executables_list: > perms = os.stat(e)[stat.ST_MODE] > -- > 1.7.10.4 > > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core > --------------030205010909040408050500 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: 8bit
On 06/06/2014 08:22 PM, Khem Raj wrote:


On Friday, June 6, 2014, <rongqing.li@windriver.com> wrote:
From: yzhu1 <yanjun.zhu@windriver.com>

In centos 5.9 32bit, ld lib does not contain some flags, so ld
lib is not parsed. So correct lib path is not got from ld lib.

Can you explain with examples what's going on here ?
Hi,

Before relocate_sdk.sh is executed, it needs the parameters: path/ld-linux-x86-64.so.2 path/dmesg.util-linux path/kill.util-linux path/reset.util-linux .....
The file list (path/dmesg.util-linux path/kill.util-linux path/reset.util-linux .....) is collected by "grep '\(executable\|dynamically linked\)'".

So "dynamically linked" is very import to the file ld-linux-x86-64.so.2. But in redhat 5.9(32 bit)

This file is as below:

ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped

In Ubuntu 12.04 (64bit)

This file is as below:

ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=0xbb8c5184d8d41f31093193a2ec8d3f6f10964cd2, stripped

In this case, we can find in Ubuntu 12.04(64 bit), the flag "dynamically linked" is present, so ld-linux-x86-64.so.2 can be included in the file list. relocate_sdk.py can work according to the information from ld-linux-x86-64.so.2. But in redhat 5.9(32bit), the flag does not exist. relocate_sdk.py can not get the information from ld-linux-x86-64.so.2 since this file is not included in the file list.

The same error occurs on redhat6.0(32 bit).

So the direct solution to this defect is to force this file ld-linux-x86-64.so.2 exist in file list.

If any problem, please feel free to let me know.

Best Regards!
Zhu Yanjun


Signed-off-by: yzhu1 <yanjun.zhu@windriver.com>
---
 scripts/relocate_sdk.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py
index 05d9fd6..a05a7fa 100755
--- a/scripts/relocate_sdk.py
+++ b/scripts/relocate_sdk.py
@@ -201,7 +201,7 @@ else:
     new_prefix = sys.argv[1].encode()
     new_dl_path = sys.argv[2].encode()

-executables_list = sys.argv[3:]
+executables_list = sys.argv[2:]

 for e in executables_list:
     perms = os.stat(e)[stat.ST_MODE]
--
1.7.10.4

--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--------------030205010909040408050500--