-
-
Notifications
You must be signed in to change notification settings - Fork 58
Closed
Description
Related to rustls/rustls-ffi#345 and rustls/rustls-ffi#274.
I've tried to use cargo-c together with Arch Linux packaging tools, which is able to automatically detect and embed the SONAME into package metadata, but noticed I get this:
provides = librustls.so=0-64
After looking into how this works I noticed it's using a string embedded in the .so file:
% readelf -d /usr/lib/librustls.so | rg Lib
0x000000000000000e (SONAME) Library soname: [librustls.so.0]
I found the relevant part in the cargo-c codebase:
Lines 81 to 85 in 0819def
if capi_config.library.versioning { | |
lines.push(format!("-Wl,-soname,lib{lib_name}.so.{major}")); | |
} else { | |
lines.push(format!("-Wl,-soname,lib{lib_name}.so")); | |
} |
There are two things about this:
- if the version string is
0.11.0
, I think the soname should belibrustls.so.0.11
- even if the version string is
>= 1.0.0
, I think it should be possible to configure a major.minor (or even major.minor.patch) SOVER
Specifically with librustls I would like to be able to build it with -Wl,-soname,librustls.so.0.11.0
until the developers are comfortable making ABI commitments. :)
Metadata
Metadata
Assignees
Labels
No labels