Bug 3989

Summary: chrpath fails with short build prefix
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Andreas Oberritter <obi>
Component: devtools / tool chainAssignee: Richard Purdie <richard.purdie>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: corneliux.stoicescu, jessica.zhang, meta.mr.watcher, meta.watcher, richard.purdie, sgw
Version: unspecified   
Target Milestone: 1.6   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Attachments:
Description Flags
patch implementing workaround 2 none

Description Andreas Oberritter 2013-03-05 22:11:22 UTC
This is an error observed with TMPDIR set to /ab/cde/tmp:

ERROR: libxml-parser-perl-native: chrpath command failed with exit code 7:
/ab/cde/tmp/work/x86_64-linux/libxml-parser-perl-native/libxml-parser-perl-native-2.41-r3/sysroot-destdir/ab/cde/tmp/sysroots/x86_64-linux/usr/lib/perl-native/perl/5.14.3/auto/XML/Parser/Expat/Expat.so: RPATH=/ab/cde/tmp/sysroots/x86_64-linux/usr/lib
new rpath '$ORIGIN/../../../../../../../../../usr/lib' too large; maximum length 41

Possible workarounds:
1.) Set TMPDIR to /ab/cdef/tmp to gain an extra byte.
2.) Remove the trailing /usr/lib from the new rpath, because the object in question also resides under /usr/lib.
Comment 1 Richard Purdie 2013-03-07 15:40:29 UTC
We should add a check to sanity.bbclass for paths which are too short and report these cases to the user.
Comment 2 Andreas Oberritter 2013-03-07 22:27:39 UTC
Created attachment 1106 [details]
patch implementing workaround 2

With this patch I could build a working image without changing the path.
Comment 3 Andreas Oberritter 2013-03-07 22:38:43 UTC
I agree that a sanity check would be a good thing, but I don't think it's easy to guess the right value, without doing many world builds.

With my patch the problem should be gone for many or possibly all cases below /usr/lib, as they can use 14 extra bytes.
Comment 4 Saul Wold 2013-06-28 19:31:48 UTC
Andreas, can you please submit your RFC patch to the communinty and see where 
it goes, I am going to assign you the owner of this bug, I think your pathc 
makes sense, and if you can add a sanity check that would be great also.  
Please mark the but ACCPETED or IN PROGRESS as you see fit.
Comment 6 Stoicescu Cornel 2014-01-14 15:47:24 UTC
Verified in poky master:1b636173ca88e5ccca1992f9a12367a1189fa674