[JSC] Bundle non-native libs in run-jsc-stress-tests
Created attachment 415289 [details] Patch
Comment on attachment 415289 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=415289&action=review > Tools/Scripts/run-jsc-stress-tests:1886 > + "--ldd=#{$ldd}", I guess we should only pass the "-ldd" parameter here if we were called with it
Created attachment 415301 [details] Patch
(In reply to Carlos Alberto Lopez Perez from comment #2) > Comment on attachment 415289 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=415289&action=review > > > Tools/Scripts/run-jsc-stress-tests:1886 > > + "--ldd=#{$ldd}", > > I guess we should only pass the "-ldd" parameter here if we were called with > it Makes sense. Fixed.
Created attachment 415396 [details] Patch
Created attachment 415409 [details] Patch
Committed r270497: <https://trac.webkit.org/changeset/270497> All reviewed patches have been landed. Closing bug and clearing flags on attachment 415409 [details].
<rdar://problem/72039953>
Comment on attachment 415409 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=415409&action=review > Tools/Scripts/generate-bundle:122 > + def __init__(self, configuration, platform, bundle_type, syslibs, ldd, should_strip_objects, compression_type, destination = None, revision = None, builder_name = None): We could avoid needing to pass by hand some alternative “ldd” tool by always using ”readelf”, which works for any ELF file (no matter the target architecture) and does not try to run any code. That would make this “ldd” parameter to the BundleCreator unnecessary. Something like this gets you the list of shared objects needed: readelf -Wd <file> | \ awk '$2 == "(NEEDED)" { print substr($5, 2, length($5)-2) }' The output will only include direct dependencies of “<file>”, so one needs to run the same command recursively on each listed object, until no more objects are added to the set. I have some shell script around that does just that and also takes into account the DT_RUNPATH entries from the ELF dynamic section—let me know if you are interested and I can share it.
(In reply to Adrian Perez from comment #9) > Comment on attachment 415409 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=415409&action=review > > > Tools/Scripts/generate-bundle:122 > > + def __init__(self, configuration, platform, bundle_type, syslibs, ldd, should_strip_objects, compression_type, destination = None, revision = None, builder_name = None): > > We could avoid needing to pass by hand some alternative “ldd” tool > by always using ”readelf”, which works for any ELF file (no matter > the target architecture) and does not try to run any code. That > would make this “ldd” parameter to the BundleCreator unnecessary. That would make a number of things simpler, yah. Was not aware readelf had this functionality :/
Created attachment 415562 [details] Shell script to find dependencies using readelf Here's a standalone version of the script I mentioned :)
The commit mentions "xldd from crosstool-NG", but this one outputs unprefixed paths (no CT_XLDD_ROOT or sysroot), so it doesn't work. It seems the intended script was https://trac.webkit.org/attachment/wiki/JSCOnly/CrossBuildAndRemoteTestJSCLinux/cross-ldd.
(In reply to Loïc Yhuel from comment #12) > The commit mentions "xldd from crosstool-NG", but this one outputs > unprefixed paths (no CT_XLDD_ROOT or sysroot), so it doesn't work. > > It seems the intended script was > https://trac.webkit.org/attachment/wiki/JSCOnly/ > CrossBuildAndRemoteTestJSCLinux/cross-ldd. That is correct; AFAIU the script on trac is based on the crosstool-NG one, so was just trying to give credit where credit was due. Sorry for the mixup, hope that didn't take long to track down. If any other similar issue comes up, please feel free to ask for more details.