Skip to content

Commit c8a660f

Browse files
authored
Filter out --dynamic-list linker arg unsupported by zig cc (#392)
zig's lld supports `--dynamic-list` but `zig cc` doesn't pass it through. Filter it out along with its file path argument to allow linking to succeed. Note: This may affect symbol visibility but is necessary for linking powerpc64-unknown-linux-musl and similar targets. Fixes #355
1 parent cd424dd commit c8a660f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/zig.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,10 @@ impl Zig {
149149
self.filter_linker_arg(arg, &rustc_ver, &zig_version, &target_info)
150150
};
151151
for arg in args {
152-
if arg == "-Wl,-exported_symbols_list" {
152+
if arg == "-Wl,-exported_symbols_list" || arg == "-Wl,--dynamic-list" {
153153
// Filter out this and the next argument
154+
// zig cc doesn't pass these through to lld even though lld supports them
155+
// See https://github.com/rust-cross/cargo-zigbuild/issues/355
154156
skip_next_arg = true;
155157
} else {
156158
new_cmd_args.push(arg);

0 commit comments

Comments
 (0)