Skip to content
Snippets Groups Projects
Commit e22da41f authored by Dmitry Ivanov's avatar Dmitry Ivanov
Browse files

fix: Link libldap & libsasl2 w/o -Wl,--whole-archive

Some code in libldap which we don't need requires libresolv,
so we should relax linking rules to let linker drop it.
parent 1dd6e9c7
Branches
Tags
Loading
Pipeline #21703 passed
...@@ -278,10 +278,10 @@ fn build_tarantool(jsc: Option<&jobserver::Client>, build_root: &Path) { ...@@ -278,10 +278,10 @@ fn build_tarantool(jsc: Option<&jobserver::Client>, build_root: &Path) {
// Add LDAP authentication support libraries. // Add LDAP authentication support libraries.
rustc::link_search(format!("{tarantool_build}/bundled-ldap-prefix/lib")); rustc::link_search(format!("{tarantool_build}/bundled-ldap-prefix/lib"));
rustc::link_lib_static("ldap"); rustc::link_lib_static_no_whole_archive("ldap");
rustc::link_lib_static("lber"); rustc::link_lib_static_no_whole_archive("lber");
rustc::link_search(format!("{tarantool_build}/bundled-sasl-prefix/lib")); rustc::link_search(format!("{tarantool_build}/bundled-sasl-prefix/lib"));
rustc::link_lib_static("sasl2"); rustc::link_lib_static_no_whole_archive("sasl2");
if cfg!(target_os = "macos") { if cfg!(target_os = "macos") {
// Currently we link against 2 versions of `decNumber` library: one // Currently we link against 2 versions of `decNumber` library: one
...@@ -390,6 +390,11 @@ mod rustc { ...@@ -390,6 +390,11 @@ mod rustc {
); );
} }
// NB: this is needed less often and thus designed to be opt-out.
pub fn link_lib_static_no_whole_archive(lib: impl AsRef<str>) {
println!("cargo:rustc-link-lib=static:-bundle={}", lib.as_ref());
}
pub fn link_lib_dynamic(lib: impl AsRef<str>) { pub fn link_lib_dynamic(lib: impl AsRef<str>) {
println!("cargo:rustc-link-lib=dylib={}", lib.as_ref()); println!("cargo:rustc-link-lib=dylib={}", lib.as_ref());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment