cargo-zigbuild icon indicating copy to clipboard operation
cargo-zigbuild copied to clipboard

Linking failed with -Clinker-plugin-lto

Open NobodyXu opened this issue 3 months ago • 2 comments

note: error: unsupported linker arg: -plugin-opt

https://github.com/cargo-bins/cargo-binstall/actions/runs/18034817706/job/51319408221#step:8:827

This prevents cross-lang lto from being used

Related issue: cargo-bins/cargo-binstall#2320

NobodyXu avatar Oct 14 '25 23:10 NobodyXu

Not much we can do here besides filtering out the unsupported linker arg unless zig cc adds support?

messense avatar Oct 17 '25 03:10 messense

Yeah filtering is good enough, rustc use linker-plugin-lto to ask linker to load llvm gold plugins to do cross lang LTO, since zig-cc is already LLVM it doesn't need it, just ignoring it would be fine

NobodyXu avatar Oct 17 '25 08:10 NobodyXu