Skip to content

Commit

Permalink
Explicitly specify static linkage with whole archive.
Browse files Browse the repository at this point in the history
  • Loading branch information
iddm committed Nov 15, 2023
1 parent 7ae879f commit 5ced7bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ lazy_static::lazy_static! {
static ref V8_FORCE_MONOLITH_DOWNLOAD: bool = env::var("V8_FORCE_DOWNLOAD_V8_MONOLITH").map(|v| v == "yes").unwrap_or(false);
}

// fn find_ld_default_library_paths() -> Vec<String> {
// Command::new("ld").args("--verbose").status().expect()
// }

fn run_cmd(cmd: &str, args: &[&str]) {
let failure_message = format!("Failed running command: {} {}", cmd, args.join(" "));
if !Command::new(cmd)
Expand Down Expand Up @@ -107,7 +111,7 @@ fn main() {
"cargo:rustc-flags=-L{} -lv8 -lv8_monolith_{} -ldl -lc",
output_dir, *PROFILE
);
println!("cargo:rustc-link-lib=stdc++");
println!("cargo:rustc-link-lib=static:-bundle,+whole-archive=stdc++");
}
"macos" => {
println!(
Expand Down

0 comments on commit 5ced7bd

Please sign in to comment.