fix(build): add back undefined symbols lookup behavior (#3015)

This commit is contained in:
LongYinan 2025-11-10 12:27:40 +08:00 committed by GitHub
parent 8a60cd0f64
commit f61c6e9f6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,6 +30,12 @@ pub fn setup() {
"wasi" => {
wasi::setup();
}
"macos" => {
// Keep the dynamic lookup behavior on macOS to avoid breaking changes.
println!("cargo:rustc-cdylib-link-arg=-Wl");
println!("cargo:rustc-cdylib-link-arg=-undefined");
println!("cargo:rustc-cdylib-link-arg=dynamic_lookup");
}
"windows" => {
if let Ok("gnu") = env::var("CARGO_CFG_TARGET_ENV").as_deref() {
windows::setup_gnu();