-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Respect runtime paths when loading shared libraries #23872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (2) test expectation files were updated by running the tests with `--rebaseline`: ``` other/codesize/test_codesize_hello_dylink.gzsize: 5892 => 11266 [+5374 bytes / +91.21%] other/codesize/test_codesize_hello_dylink.jssize: 12932 => 26423 [+13491 bytes / +104.32%] Average change: +97.77% (+91.21% - +104.32%) ```
This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (2) test expectation files were updated by running the tests with `--rebaseline`: ``` other/codesize/test_codesize_hello_dylink.gzsize: 11266 => 11204 [-62 bytes / -0.55%] other/codesize/test_codesize_hello_dylink.jssize: 26423 => 26287 [-136 bytes / -0.51%] Average change: -0.53% (-0.55% - -0.51%) ```
This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (2) test expectation files were updated by running the tests with `--rebaseline`: ``` other/codesize/test_codesize_hello_dylink.gzsize: 11204 => 6148 [-5056 bytes / -45.13%] other/codesize/test_codesize_hello_dylink.jssize: 26287 => 13509 [-12778 bytes / -48.61%] Average change: -46.87% (-48.61% - -45.13%) ```
This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (2) test expectation files were updated by running the tests with `--rebaseline`: ``` other/codesize/test_codesize_hello_dylink.gzsize: 6148 => 11089 [+4941 bytes / +80.37%] other/codesize/test_codesize_hello_dylink.jssize: 13509 => 25945 [+12436 bytes / +92.06%] Average change: +86.21% (+80.37% - +92.06%) ```
The CI is green now, but two issues are remaining:
|
There is existing logic in system/lib/libc/dynlink.c which searches |
Yes, but that only happens in top-level libraries, I guess? Here is the code flow I understand:
|
This comment was marked as outdated.
This comment was marked as outdated.
Yes, I think something like that would be good idea. If we do go that route I might suggest that we implement |
Okay I addressed all comments and tests seem to be passing locally for me. So this is back to being ready for review. |
|
Hmm.. yes maybe use |
But the arguments to/return value of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with some final comments.
Thanks for bearing with me on this one.. i know it was a lot of back and forth.
Oh I see.. so we cannot proxy it :( Maybe just skip the test for now? And we can try to fix it as a followup? My understanding was that all this loading should happen on the main thread anyway since he original dlopen is always proxied back, but maybe I'm misremembering. |
Yes, IIRC all the initial loading should happen on the main thread and then background threads should should be able mirror all the same loads but hopfully we can avoid re-resolving all the pathnames on the background threads since them main thread already resolved them. |
Shouldn't the side threads hit the |
Okay I skipped |
This updates
loadDynamicLibrary
to locate shared libraries from the file system if possible.When locating a shared library with a relative path, first attempt to find it in the
LD_LIBRARY_PATH
directories. If it is not found there, search for it in the runtime path directories. If it is not found, fall back to the originalModule['locateFile']
.Followup to #23805.