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

Suppport soname for cdylibs #5045

Open
kornelski opened this Issue Feb 15, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@kornelski
Contributor

kornelski commented Feb 15, 2018

rustc supports setting soname via -C link-arg. However, it can't be used from Cargo, since RUSTFLAGS affects all invocations of the compiler, and it could potentially set soname on dependencies.

Some previous discussions about soname support were dismissed based on the fact that Rust's native ABI is not stable. That is not relevant for cdylibs, because the C ABI exposed by cdylibs is stable.

I'm interested in using this feature in cargo-deb. soname is required to build first-class Linux libraries (e.g. for Debian) with Rust.

I think it'd be wonderful if Cargo automatically set soname of cdylib to semver-major when version is >= 1.0.0 (i.e. don't set any for 0.x.x), since soname and semver-major promise basically the same thing. However, a separate Cargo.toml field, command line flag, or env var would work as well.

@gibix

This comment has been minimized.

Contributor

gibix commented May 23, 2018

I'm interested for the same reason of @kornelski to be able to cross-compile rust libs on gentoo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment