Skip to content
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

x/mobile: portable package interface for dynamically loading C libraries #9977

Closed
rakyll opened this issue Feb 24, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@rakyll
Copy link
Member

commented Feb 24, 2015

We should pack the external libraries located in the PACKAGE_ROOT/libs into the output APK, and provide an API compatible with System.loadLibrary to dynamically load them.

@rakyll rakyll added the repo-mobile label Feb 24, 2015

@crawshaw

This comment has been minimized.

Copy link
Contributor

commented Feb 24, 2015

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.

@crawshaw crawshaw changed the title mobile: allow external libraries to be loaded dynamically mobile: portable package interface for dynamically loading C libraries Feb 24, 2015

@rakyll

This comment has been minimized.

Copy link
Member Author

commented Feb 24, 2015

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.)

@rakyll rakyll closed this Feb 24, 2015

@mikioh mikioh changed the title mobile: portable package interface for dynamically loading C libraries x/mobile: portable package interface for dynamically loading C libraries Aug 5, 2015

@golang golang locked and limited conversation to collaborators Aug 5, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.