You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In use cases where rust code is used to build a static library
[lib]
crate-type = ["staticlib"]
which is then integrated into a bigger shared library that includes some C/C++ code as well, and both the rust and the C/C++ parts depend on a common static library, the only possible way to make the build process work without the linker complaining about duplicate symbols is to compile and link the rust static library with the
makes rustc include symbols coming from <common-static-lib> which will then conflict during the final linking process of C/C++/Rust shared library.
The temporary solution for such cases is to do an intermediate step to strip away symbols belonging to <common-static-lib> from the rust static library.
Would it be possible to somehow include the static-nobundle option in pkg-config ?
The text was updated successfully, but these errors were encountered:
In use cases where rust code is used to build a static library
which is then integrated into a bigger shared library that includes some C/C++ code as well, and both the rust and the C/C++ parts depend on a common static library, the only possible way to make the build process work without the linker complaining about duplicate symbols is to compile and link the rust static library with the
cargo:rustc-link-lib=static-nobundle=<common-static-lib>
option, briefly described in here
Going with the classic
makes rustc include symbols coming from
<common-static-lib>
which will then conflict during the final linking process of C/C++/Rust shared library.The temporary solution for such cases is to do an intermediate step to strip away symbols belonging to
<common-static-lib>
from the rust static library.Would it be possible to somehow include the
static-nobundle
option inpkg-config
?The text was updated successfully, but these errors were encountered: