Skip to content

unsupported linker arg: -exported_symbols_list #24662

@guw

Description

@guw

Zig Version

0.12.0

Steps to Reproduce and Observed Behavior

I am using a toolchain in Bazel which uses Zig to compile Rust. I am running into a problem on MacOS Arm64 only. It works fine on Linux.

This is because Rust only adds that option on Darwin like systems:
https://github.com/rust-lang/rust/blob/c23f07d8c56c51b5e634bda55daca2b073306340/compiler/rustc_codegen_ssa/src/back/linker.rs#L811

From inspecting the command line generated by Bazel for the Rust compilation, these options are passed to Zig:

  "-Wl,-exported_symbols_list" 
  "-Wl,/path/to/list" 

Zig fails with the following error:

  = note: error: unsupported linker arg: -exported_symbols_list

I checked main.zig and indeed it looks like the support for this option is missing.

Expected Behavior

Zig works without failing

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.zig ccZig as a drop-in C compiler feature

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions