1
0
element-desktop/cc-link-lib-no-static.patch

19 lines
1.0 KiB
Diff

Do not make cc emit "static" to cargo, that option is broken (rustc tries to repact LTO objects and corrupts them in the process leading to missing symbols).
Make rustc believe everything foreign is a “dylib”. (It's not, but that makes it pass them to intact to GCC to do the linking)
--- vendor/.hak/hakModules/matrix-seshat/vendor/cc/src/lib.rs.orig 2024-05-16 18:44:16.828468243 +0200
+++ vendor/.hak/hakModules/matrix-seshat/vendor/cc/src/lib.rs 2024-05-16 19:04:27.036595422 +0200
@@ -1100,10 +1100,10 @@ impl Build {
}
if self.link_lib_modifiers.is_empty() {
- self.print(&format!("cargo:rustc-link-lib=static={}", lib_name));
+ self.print(&format!("cargo:rustc-link-lib={}", lib_name));
} else {
let m = self.link_lib_modifiers.join(",");
- self.print(&format!("cargo:rustc-link-lib=static:{}={}", m, lib_name));
+ self.print(&format!("cargo:rustc-link-lib:{}={}", m, lib_name));
}
self.print(&format!("cargo:rustc-link-search=native={}", dst.display()));