Commit Graph

8 Commits

Author SHA1 Message Date
Richard Purdie 9f67e31ab2 chrpath: Add support for relocating darwin binaries
On darwin, install_name_tool can be used to relocate binaries/libraries. This
adds support for adjusting them with relative paths rather than hardcoded ones.
The Linux code is factored out into a function but is otherwise unchanged.

(From OE-Core rev: ed5ace3437eb0f751172e6b93399639c94b89e59)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-23 16:20:14 +01:00
Andrei Gherzan 0231336247 chrpath.bbclass: Normalize rpath only of it doesn't contain ORIGIN variable
If we normalize a rpath which contains ORIGIN variable, the binary will end
up without those rpaths at all. So check first if rpath contains ORIGIN variable
and if not, move on and normalize it.

(From OE-Core rev: 46dc514ff5a3d2693546cf95c5481e0539c43580)

Signed-off-by: Andrei Gherzan <andrei.gherzan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-14 08:53:41 +00:00
Saul Wold 8669fec353 chrpath: normalize the paths
By normalizing the paths the path comparing code works correct
to generate the right RPATH even when there is a A/../A in TMPDIR

[YOCTO #3408]

(From OE-Core rev: 50327f2bba9f479dd209cdc54646b9d551e84c59)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-13 16:54:31 +00:00
Khem Raj 650227eea3 chrpath.bbclass: Account for case when ORIGIN is in RPATH
This fixes a case when RPATH embedded in program have one of
its path already relative to ORIGIN. We were losing that path
if such a path existed. This patch appends it to the new edited
rpath being created when we see it.

so RPATH like below

(RPATH)              Library rpath:
[$ORIGIN/../lib/amd64/jli:$ORIGIN/../jre/lib/amd64/jli]

would end up being empty

but after this patch its kept intact

(From OE-Core rev: 43600df0d4efc976a9451163dd334b4763937932)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-17 17:45:12 +01:00
Richard Purdie b0b92d7916 chrpath.bbclass: Ensure we only process tmpdir in paths which actually contain that path
Without this change, a path to "/lib/xxx" or "/usr/lib/xxx" would also
attempt to be remapped to be relative to $ORIGIN which makes no sense.

(From OE-Core rev: 73e2c12534856f14c1a94fb51874e9ba1655f07b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-17 17:45:12 +01:00
Paul Eggleton 62f1ccbbbd classes/chrpath: improve chrpath failure handling
When chrpath fails, prefix the error message with the name of the recipe
that is being processed, and include the the output from chrpath, as
well as making the calling task actually fail.

(From OE-Core rev: 99815eddd4e1eb5d939831704231537dd5a995ad)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-17 15:25:13 +01:00
Paul Eggleton 70b874019c classes/chrpath: trigger an error if chrpath fails
If chrpath failed here we were just silently ignoring it.

(From OE-Core rev: 24babf9316da50c8a4d2f328c4336cb8cd6cf667)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-15 17:51:10 +01:00
Laurentiu Palcu 476ced15c2 relocatable.bbclass: split it up, to reuse code
Most of the code in relocatable.bbclass will be used for relocating the
SDK binaries. So, create another class chrpath.bbclass that will contain
the core of the relocatable.bbclass, so we can reuse it.

(From OE-Core rev: b50677b1641b201fd69942fd82a360907338234d)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-02 15:28:39 +01:00