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

Change crate type to cdylib #40

Closed
baby-bell opened this issue Aug 25, 2016 · 4 comments
Closed

Change crate type to cdylib #40

baby-bell opened this issue Aug 25, 2016 · 4 comments

Comments

@baby-bell
Copy link

Cdylib was added to Cargo in 1.11, and since it strips the rust metadata, is the preferred way of doing FFI.

@ustulation
Copy link

@baby-bell 👍 Yes - it caused a ~25% reduction in size of .so in my project. Do you know if there is any reason why/when we should use dylib or is that going to be deprecated ?

@shepmaster
Copy link
Owner

Yes, this is something I was hoping to get around to, thank you for the reminder!

More than just switching it, I'd like to add a section containing the why and the differences (touching on some of what @ustulation is asking).

@baby-bell
Copy link
Author

@ustulation I don't think dylib is going to be deprecated any time soon, but its use case is limited (it's really only useful for internal Rust stuff). For almost all purposes, cdylib is the way to go, especially since it allows LTO among other nice things.

shepmaster added a commit that referenced this issue Nov 5, 2016
@shepmaster
Copy link
Owner

Indeed, there was one tricky aspect to cdylibs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants