package.bbclass: fix path for relative links on elf files, when moved to debugdir

Submitted by Henning Heinold on Nov. 20, 2011, 9:32 p.m.

Details

Message ID 1321824774-23819-1-git-send-email-heinold@inf.fu-berlin.de
State Accepted
Commit 27cf695f1cf259f8c79214e95a0c4bc2c0779b81
Headers show

Commit Message

Henning Heinold Nov. 20, 2011, 9:32 p.m.
* relative links for elf files like ../foo.so ends up in the
  debugdir with ../.debug/foo.so, this causes infinite fileaccessloops
  fix it by adding an extra "../" to the link path

Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de>
---
 meta/classes/package.bbclass |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 6775fda..c351f26 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -778,6 +778,8 @@  python split_and_strip_files () {
 				if lpath and lpath != ".":
 					ftarget += lpath + debugdir + "/"
 				ftarget += lbase + debugappend
+				if lpath.startswith(".."):
+					ftarget = os.path.join("..", ftarget)
 				bb.mkdirhier(os.path.dirname(fpath))
 				#bb.note("Symlink %s -> %s" % (fpath, ftarget))
 				os.symlink(ftarget, fpath)

Comments

Richard Purdie Nov. 21, 2011, 4:53 p.m.
On Sun, 2011-11-20 at 22:32 +0100, Henning Heinold wrote:
> * relative links for elf files like ../foo.so ends up in the
>   debugdir with ../.debug/foo.so, this causes infinite fileaccessloops
>   fix it by adding an extra "../" to the link path
> 
> Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de>

Merged to master, thanks.

Richard