diff --git a/cli/build.rs b/cli/build.rs index 8c8df104..a29a940b 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -29,7 +29,23 @@ fn main() { target_os = "netbsd", target_os = "dragonfly", ))] - println!("cargo:rustc-link-arg=-Wl,--dynamic-list=cli/dynamic-symbols.txt"); + { + let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()).join("dynamic-symbols.txt"); + std::fs::write( + &out_dir, + "{ + ts_current_malloc; + ts_current_calloc; + ts_current_realloc; + ts_current_free; + };", + ) + .unwrap(); + println!( + "cargo:rustc-link-arg=-Wl,--dynamic-list={}", + out_dir.display() + ); + } } fn web_playground_files_present() -> bool { diff --git a/cli/dynamic-symbols-darwin.txt b/cli/dynamic-symbols-darwin.txt deleted file mode 100644 index 1b4f3c68..00000000 --- a/cli/dynamic-symbols-darwin.txt +++ /dev/null @@ -1,4 +0,0 @@ -_ts_current_malloc -_ts_current_calloc -_ts_current_realloc -_ts_current_free diff --git a/cli/dynamic-symbols.txt b/cli/dynamic-symbols.txt deleted file mode 100644 index 3c1ecc36..00000000 --- a/cli/dynamic-symbols.txt +++ /dev/null @@ -1,6 +0,0 @@ -{ - ts_current_malloc; - ts_current_calloc; - ts_current_realloc; - ts_current_free; -};