Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
x/mobile: portable package interface for dynamically loading C libraries #9977
Does dynamic loading work on darwin? What will portability look like?
Without solving the portability story, I consider the actual packaging and loading of a dynamic package to be the easy part. The hard part is linking, and right now we have nothing better (and maybe cannot?) than dlsym.
I also don't know the use case. I understand audio, but it is a one-off we want to build into the standard mobile packages (and only needs a library loaded on android), so it would not use such an interface. Without seeing how it would be used I don't want to build it.
Closing this issue, since dynamic loading doesn't work on iOS if the library is not by Apple. We may have a hard requirement for external libraries to be linked statically only.
Dynamic linking is useful if you want to fallback to another library depending on some condition you can evaluate only during runtime.
(For the audio package's use-case, the implementation details doesn't have to be known. I haven't filed the issue because of my experience with the audio package.)