RESOLVED FIXED 219485
[JSC] Bundle non-native libs in run-jsc-stress-tests
https://bugs.webkit.org/show_bug.cgi?id=219485
Summary [JSC] Bundle non-native libs in run-jsc-stress-tests
Angelos Oikonomopoulos
Reported 2020-12-03 02:49:10 PST
[JSC] Bundle non-native libs in run-jsc-stress-tests
Attachments
Patch (16.25 KB, patch)
2020-12-03 02:57 PST, Angelos Oikonomopoulos
no flags
Patch (16.36 KB, patch)
2020-12-03 06:36 PST, Angelos Oikonomopoulos
no flags
Patch (16.32 KB, patch)
2020-12-04 01:56 PST, Angelos Oikonomopoulos
no flags
Patch (16.32 KB, patch)
2020-12-04 05:19 PST, Angelos Oikonomopoulos
no flags
Shell script to find dependencies using readelf (1.86 KB, application/x-shellscript)
2020-12-07 10:15 PST, Adrian Perez
no flags
Angelos Oikonomopoulos
Comment 1 2020-12-03 02:57:18 PST
Carlos Alberto Lopez Perez
Comment 2 2020-12-03 06:11:06 PST
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
Angelos Oikonomopoulos
Comment 3 2020-12-03 06:36:02 PST
Angelos Oikonomopoulos
Comment 4 2020-12-03 06:36:39 PST
(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.
Angelos Oikonomopoulos
Comment 5 2020-12-04 01:56:14 PST
Angelos Oikonomopoulos
Comment 6 2020-12-04 05:19:52 PST
EWS
Comment 7 2020-12-07 01:38:44 PST
Committed r270497: <https://trac.webkit.org/changeset/270497> All reviewed patches have been landed. Closing bug and clearing flags on attachment 415409 [details].
Radar WebKit Bug Importer
Comment 8 2020-12-07 01:39:16 PST
Adrian Perez
Comment 9 2020-12-07 04:19:12 PST
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.
Angelos Oikonomopoulos
Comment 10 2020-12-07 04:22:11 PST
(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 :/
Adrian Perez
Comment 11 2020-12-07 10:15:50 PST
Created attachment 415562 [details] Shell script to find dependencies using readelf Here's a standalone version of the script I mentioned :)
Loïc Yhuel
Comment 12 2023-08-07 05:30:48 PDT
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.
Angelos Oikonomopoulos
Comment 13 2023-09-07 13:48:44 PDT
(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.
Note You need to log in before you can comment on or make changes to this bug.