This allows FFI modules to be specified in the same manner as you would when linking to them (-lGL --> GL, instead of /usr/lib/x86_64-linux-gnu/libGL.so as was required before this change, unless you manually placed /usr/lib/x86_64-linux-gnu in your LD_LIBRARY_PATH). I don't know whether this will have unintended consequences for some use cases, since a lot of different systems end up calling this function. I tested the change for a while on Ubuntu 20.04 with no odd behavior occurring (but instead finally being able to load FFI modules without providing an absolute path or changing my LD_LIBRARY_PATH manually). Some more insights on why this was necessary: You can view, comment on, or merge this pull request online at:https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/497 Commit Summary
File ChangesPatch Links:
— |
This might be helpful to consider usable paths and might get around the problem of mismatching libraries on the search path: https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/plugins/SqueakSSL/openssl_overlay.h#L471 — |
In reply to this post by David T Lewis
As well as this: https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/plugins/SqueakSSL/openssl_overlay.h#L577 — |
In reply to this post by David T Lewis
@krono Hm interesting. I'm quite surprised how complex that code appears. What corner cases is it intended to catch? Is this code also invoked when linking to OpenSSL at compile time or only at runtime? My understanding of dlopen() was that if you provide the minimal amount of information (i.e. just the library name, no paths, no .so versions), it would just go head and figure out "the right thing" for you based on the user's system configuration. But the way this looks I'd assume that my guess is quite off here :D — |
In reply to this post by David T Lewis
Unless you're unlucky and it finds a library of the name you gave it but it has the wrong architecture, for example, whereas it whould have been found given the right paths. :) — |
In reply to this post by David T Lewis
I was under the impression that dlopen would be smart enough to figure out what libraries are compatible with its caller process. Do we happen to have setups where odd behavior can be reproduced so we could try and give this code a spin in place of the more complex one that's currently in squeakssl (and also to make sure this code will keep working for FFI under such circumstances)? — |
In reply to this post by David T Lewis
Paging @eliotmiranda; he might eludicate the problems, he put all the — |
In reply to this post by David T Lewis
We should lookt at this one more time — |
In reply to this post by David T Lewis
@eliotmiranda approved this pull request. — |
In reply to this post by David T Lewis
Merged #497 into Cog. — |
Free forum by Nabble | Edit this page |