-
Notifications
You must be signed in to change notification settings - Fork 2
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
Use dlopen for dynamic libraries #3
Comments
Yes I see how this might be useful. I'm not sure it's worth the effort though, we would have to load a lot of libraries and functions on some backends (think of all the different xcb libs, for instance). Will probably not find time to implement it myself (don't have a usecase for it myself) but would not be opposed to a PR. |
Into which functions dlopen and dlclose must be inserted? |
Well, when creating a display (e.g. swa_display_x11_create) you would have to dlopen all needed libraries by that backend and build an internal symbol table using dlsym (depending on the way you define it you likely also have to change every place any of the library functions are called to use the internal function pointers instead). It's quite some work. |
Maybe you can find a way to tell the linker to "not link against the library directly, let the symbols be resolved when dlopen is called" and then just call dlopen on display creation. But this is highly compiler and platform specific, I don't think everything supports it. Btw, I'm assuming you working on unix/linux, on windows this whole thing does not really make sense (except maybe for libGL). |
Currently it doesn't run without some library, even if it is unused. Recompilation required to avoid that, but it takes time.
The text was updated successfully, but these errors were encountered: