rust-lang / rust-lang/rust

False-positive "ignoring deprecated linker" warning

Open
#158,192 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-linkers L-linker_messages needs-triage
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

When using Zig's CC wrapper as the linker, warn(linker_messages) shows:

warning: linker stderr: ignoring deprecated linker optimization setting '1'
  |
  = note: `#[warn(linker_messages)]` on by default

This is coming from here: https://codeberg.org/ziglang/zig/src/commit/e949341b705c16b46544f26f5aab0a16670f42b4/src/main.zig#L3245

I suspect we should either silence this message unconditionally in our existing filtering code or figure out a detection strategy for users opting into using Zig (and then not pass -O flags).

cc https://github.com/rust-lang/rust/issues/136096

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing linker-message filtering code and the linked Zig source at src/main.zig around line 3245. Reproduce the warning with Zig's CC wrapper, then determine whether the accepted fix is to filter this message or detect Zig and avoid passing -O flags; done means the false-positive no longer appears without hiding unrelated linker diagnostics.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, zig
Domain
build-system, compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.