-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
ELF soname is missing #37529
Comments
From the perspective of something like the dynamic loader ( Now, it should be possible to have a Rust Even when you do want the soname set, its actual value is a choice too, which may not have any relation at all to the raw version of your library. For instance, When you do want it, you can probably use something like |
Judging by what @cuviper says, it seems that we don't want to set the soname by default (and as far as I know, we don't today); Since |
So I'm seeing several issues obliquely referencing unstable ABIs, soname's, and dynamically linked libraries, but it's not really clear at all to me:
In several of these threads the point is made that rust doesn't need to set the soname because rust's ABI is unstable. Unless I'm misunderstanding something, this argument isn't valid.
Unless I'm deeply mistaken, rust has (or had better) have a stable C ABI. I can expose unmangled symbols which have a C calling convention.
Hence I can distribute a dynamically linked library (DSO) with, for example, the following C API:
If Rust's C ABI/FFI implementation is stable (i.e., doesn't have major bugs, etc.) (and I should hope so), then this will never change from an external consumer viewpoint (unless I change the unmangled function definitions).
Now, if Rust's internal ABI for regular rust functions changes from compiler to compiler is irrelevant, assuming the semantics of the rust code is the same, as the C ABI acts as a stable portal into the binary.
Hence from an external consumer, the binary's ABI is stable, unless of course I change the C function names/api/semantics, then this is the same old problem from 1903 about what to do when C binaries change their function's semantics problem (in which case, whatever guidelines your distro has in place, or what have you, for DSO versioning should be adhered to, which is typically many guidelines, none of which are ever obeyed ;)
Consequently, not setting the soname on the grounds that rust's internal ABI is unstable is not valid.
A tertiary concern here is that Rust will seem much much more mature in my opinion if we start dotting our I's and crossing our T's w.r.t. this kind of stuff, as it will make, for example, a Rust-based system DSO much more appealing from a distro standpoint if the binaries artifacts we produce are in tip top condition, imho.
The text was updated successfully, but these errors were encountered: