-
Notifications
You must be signed in to change notification settings - Fork 45
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
macOS dynamic shared module extension probably shouldn't default to .dylib or allow both .dylib and .so #79
Comments
Hello @saxbophone If i'm not wrong, CMake is holding
from https://gitlab.kitware.com/cmake/cmake/-/issues/21189
I think It could lead to security issues, A strict behavior must be defined, on witch precise shared objects will be looked for by |
Such as my program loading a maliciously-placed alternative plugin rather than the one I intended? Fair enough, what about providing an override instead? |
Yes, currently the constructor of the class is not permissive enough for this type of customization. There is the same issue for a shared library build using If you have any suggestions on how the |
@martin-olivier What if we could have an #ifdef with some option to choose either dylib or so? This can also be wrapped in a cmake option |
IMO making it a compile-time option is an inflexible option, I think this should be an option that can be selected independently of the build-system. Probably as a constructor argument. |
In the README, you specify that the file extension dylib looks for to load macOS shared modules is
.dylib
.Unfortunately, there seems to be a mixture of uses of both
.dylib
and.so
for these kinds of shared objects in macOS.Interestingly, CMake uses
.dylib
for shared libraries, and.so
for shared modules (the kind that are only intended for loading at runtime, and cannot be linked to).Sample output from building one of my projects with CMake where I have two duplicate libraries, one
SHARED
and oneMODULE
:See also this CMake issue: https://gitlab.kitware.com/cmake/cmake/-/issues/21189
I feel like the best solution may be to check for both extensions on macOS. What do you think?
The text was updated successfully, but these errors were encountered: