-
Notifications
You must be signed in to change notification settings - Fork 5
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
Wrong SONAME if dependending on another dylib crate #9
Comments
What would be your expectation ? Can you please share the example repository so I can have a look? |
what happens if you do not use the build.rs at all? |
Demo: https://gitlab.com/phgsng/buggy-soname
The objects lack |
I doublechecked and a single rustc-cdylib-link-arg is produced per crate name, looks like it is cargo doing something strange itself, you can try by emitting manually rustc-cdylib-link-arg to confirm. |
Yeah, I realized that as well. If you wish, you could https://users.rust-lang.org/t/suppress-link-arg-in-dependency/89245 FWIW I’m investigating adding a |
It is better to report the issue on the cargo tracker, I'm afraid I won't have enough time to look into it if not in the weekend. |
Probably a good idea; I reported my case on the cargo issue. |
You might have better luck with https://crates.io/crates/cargo-c. It is aware of workspaces and provides additional niceties. |
2023-02-14 (Tuesday), ***@***.*** (Luca Barbato):
You might have better luck with https://crates.io/crates/cargo-c. It is aware of workspaces and provides additional niceties.
Thanks, I’m aware of ``cargo-c`` but haven’t found time to
evaluate it yet.
|
Wrong SONAME if dependending on another dylib crate
When building a shared library that itself depends on another
dylib
type library, both libraries’ SONAMEs are passed to thelinker of the depending (main) library, causing the SONAME of the
dependency (which comes last) to be embedded in the resulting object.
In this example workspace:
both members are libraries with
crate_type = [ "lib", "cdylib" ]
and this
build.rs
:Building with cargo results in this rustc invocation for
libmain.so
:– that last line obviously being misplaced. (The line for
libdependency.so
is fine.) As a result:The text was updated successfully, but these errors were encountered: