Skip to content

Commit 5ced7bd

Browse files
committed
Explicitly specify static linkage with whole archive.
1 parent 7ae879f commit 5ced7bd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ lazy_static::lazy_static! {
3939
static ref V8_FORCE_MONOLITH_DOWNLOAD: bool = env::var("V8_FORCE_DOWNLOAD_V8_MONOLITH").map(|v| v == "yes").unwrap_or(false);
4040
}
4141

42+
// fn find_ld_default_library_paths() -> Vec<String> {
43+
// Command::new("ld").args("--verbose").status().expect()
44+
// }
45+
4246
fn run_cmd(cmd: &str, args: &[&str]) {
4347
let failure_message = format!("Failed running command: {} {}", cmd, args.join(" "));
4448
if !Command::new(cmd)
@@ -107,7 +111,7 @@ fn main() {
107111
"cargo:rustc-flags=-L{} -lv8 -lv8_monolith_{} -ldl -lc",
108112
output_dir, *PROFILE
109113
);
110-
println!("cargo:rustc-link-lib=stdc++");
114+
println!("cargo:rustc-link-lib=static:-bundle,+whole-archive=stdc++");
111115
}
112116
"macos" => {
113117
println!(

0 commit comments

Comments
 (0)