ZJIT: Add --allow-multiple-definition for make zjit-test

This commit is contained in:
Alan Wu 2025-05-20 18:40:35 +09:00
parent 2297afda7f
commit 1fed568e3e
Notes: git 2025-05-20 16:30:17 +00:00

View File

@ -1,3 +1,5 @@
// This build script is only used for `make zjit-test` for building
// the test binary; ruby builds don't use this.
fn main() {
use std::env;
@ -21,5 +23,13 @@ fn main() {
println!("cargo:rustc-link-lib={lib_name}");
}
}
// When doing a combo build, there is a copy of ZJIT symbols in libruby.a
// and Cargo builds another copy for the test binary. Tell the linker to
// not complaint about duplicate symbols. For some reason, darwin doesn't
// suffer the same issue.
if env::var("TARGET").unwrap().contains("linux") {
println!("cargo:rustc-link-arg=-Wl,--allow-multiple-definition");
}
}
}