-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Allow taking address of EM_JS functions with dynamic linking #18391
Conversation
Still working on a test... |
e6bef97
to
9b47510
Compare
9b47510
to
c1d7d03
Compare
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.
Nice it's relatively simple to do!
c1d7d03
to
2d9178b
Compare
This PR seems to cause a regression in the wasm-vips project during the final link stage:
(those This might be related to this line: Let me know if I should provide more information. |
Ah... I guess we don't have tests for EM_JS functions that call other EM_JS functions. This change make EM_JS functions appear on the JS side with and underscore prefix, just like other native functions. Presumably changing the callsite to I wonder how common this case is? It would be a shame to have to declare them with both naming styles. |
I see. Building with
(so that probably(?) means that it should reference For reference, I'm testing this in combination with commit kleisauke/wasm-vips@941de51.
Let me investigate that as possible fix.
AFAIK, it only affects Pyodide/Python ctypes and the wasm-vips project. |
On the native side the symbols don't need the underscore prefix no. For example the native toolchain (i.e. C/C++ code) sees The reason for this is mostly historical. What is |
Ah, sorry I should clarify that. The |
Sorry, this issue is unrelated to this. I just reproduced the exact same issue on Emscripten 3.1.28 (during the investigation of #18388). Anyway, I asked in issue hoodmane/libffi-emscripten#16 if there are any other projects that depend on that implementation.
FWIW, this is still on my TODO-list. |
As part of #18391 (as yet unreleased) I changed the behaviour of EM_JS functions such that ther were underscore mangled like native functions. However this change in naming can break existing code and is not needed for the fix after all.
I decided it would be better not to change this behaviour so I'm planning on reverting the mangling change: #18438 |
As part of #18391 (as yet unreleased) I changed the behaviour of EM_JS functions such that they were underscore mangled like native functions. However this change in naming can break existing code and is not needed for the fix after all.
Fixes: #18370