Skip to content

Commit d22de80

Browse files
committed
ZJIT: Add --allow-multiple-definition for make zjit-test
1 parent a82e713 commit d22de80

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

zjit/build.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// This build script is only used for `make zjit-test` for building
2+
// the test binary; ruby builds don't use this.
13
fn main() {
24
use std::env;
35

@@ -21,5 +23,13 @@ fn main() {
2123
println!("cargo:rustc-link-lib={lib_name}");
2224
}
2325
}
26+
27+
// When doing a combo build, there is a copy of ZJIT symbols in libruby.a
28+
// and Cargo builds another copy for the test binary. Tell the linker to
29+
// not complaint about duplicate symbols. For some reason, darwin doesn't
30+
// suffer the same issue.
31+
if env::var("TARGET").unwrap().contains("linux") {
32+
println!("cargo:rustc-link-arg=-Wl,--allow-multiple-definition");
33+
}
2434
}
2535
}

0 commit comments

Comments
 (0)