build: add link args to prevent dso unloading error on GNU targets (#10602)

This commit is contained in:
Brooooooklyn
2025-03-04 06:58:41 +00:00
parent 22924c767c
commit a486174669
+6
View File
@@ -6,3 +6,9 @@ rustflags = ["-C", "target-feature=+crt-static"]
rustflags = ["-C", "link-args=-Wl,--warn-unresolved-symbols"]
[target.'cfg(target_os = "macos")']
rustflags = ["-C", "link-args=-all_load"]
# https://sourceware.org/bugzilla/show_bug.cgi?id=21032
# https://sourceware.org/bugzilla/show_bug.cgi?id=21031
# https://github.com/rust-lang/rust/issues/134820
# pthread_key_create() destructors and segfault after a DSO unloading
[target.'cfg(all(target_env = "gnu", not(target_os = "windows")))']
rustflags = ["-C", "link-args=-Wl,-z,nodelete"]