-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Enable -rpath flag #23805
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
Enable -rpath flag #23805
Conversation
sbc100
left a comment
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.. I guess we should add a test though? Perhaps we need a test that adds and -rpath to the link comment?
|
We also need to drop the code that filters out |
|
And to teach the runtime function |
| # wasm-ld doesn't support soname or other dynamic linking flags (yet). Ignore them | ||
| # in order to aid build systems that want to pass these flags. | ||
| '-allow-shlib-undefined': False, | ||
| '-rpath': True, |
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.
I wonder if we should also add this to SUPPORTED_LINKER_FLAGS above?
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.
Maybe not? @sbc100 it's not entirely clear to me from reading the code.
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.
Thanks. I added -rpath there.
|
Okay, I teached rpath to linker and libdylink.js, and added some tests that check the RUNTIME_PATH subsection. The follow-up work would be actually utilizing this runtime path when locating the libraries. |
|
Can I ask for you help to understand the Among the three sibling tests, the one using wasm-eh fails (I guess), while other one passes. I am not sure how they are related to the flag. |
If you look at the test output you see: I guess you are missing a |
src/lib/libdylink.js
Outdated
| } else if (subsectionType === WASM_DYLINK_RUNTIME_PATH) { | ||
| var runtimePathsCount = getLEB(); | ||
| for (var i = 0; i < runtimePathsCount; ++i) { | ||
| path = getString(); |
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.
Missing var here.
Also how about just while (runtimePathsCount--) here?
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.
Oh, thanks for the catch. I missed the error message in the log.
Also how about just while (runtimePathsCount--) here?
Sounds good. I also updated the similar codes in this file.
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: 5926 => 5911 [-15 bytes / -0.25%] other/codesize/test_codesize_hello_dylink.jssize: 13112 => 13085 [-27 bytes / -0.21%] Average change: -0.23% (-0.25% - -0.21%) ```
hoodmane
left a comment
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.
Thanks @ryanking13!
|
Thanks for working on this! I wonder if we should add this to the ChangeLog. |
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 original `Module['locateFile']`. Followup to #23805. --------- Co-authored-by: Hood Chatham <[email protected]>
Updates
webassembly.pyto parse and storeWASM_DYLINK_RUNTIME_PATHthat were suggested in: WebAssembly/tool-conventions#246