Skip to content

Commit 016e9be

Browse files
committed
Ignore -znostart-stop-gc linker flag
This makes `cargo zigbuild` work on nightly on Linux.
1 parent 58f09d7 commit 016e9be

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/zig.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ impl Zig {
289289
// https://github.com/rust-lang/rust/blob/542ed2bf72b232b245ece058fc11aebb1ca507d7/compiler/rustc_codegen_ssa/src/back/linker.rs#L723
290290
// zig doesn't support --no-undefined-version
291291
return vec![];
292+
} else if arg == "-Wl,-znostart-stop-gc" {
293+
// https://github.com/rust-lang/rust/blob/c580c498a1fe144d7c5b2dfc7faab1a229aa288b/compiler/rustc_codegen_ssa/src/back/link.rs#L3371
294+
// zig doesn't support -znostart-stop-gc
295+
return vec![];
292296
}
293297
if target_info.is_musl || target_info.is_ohos {
294298
// Avoids duplicated symbols with both zig musl libc and the libc crate

0 commit comments

Comments
 (0)