Skip to content

Comments

try enabling linker-messages by default again#149937

Open
jyn514 wants to merge 5 commits intorust-lang:mainfrom
jyn514:linker-info
Open

try enabling linker-messages by default again#149937
jyn514 wants to merge 5 commits intorust-lang:mainfrom
jyn514:linker-info

Conversation

@jyn514
Copy link
Member

@jyn514 jyn514 commented Dec 13, 2025

View all comments

  • Split out linker-info from linker-messages
  • Make linker-messages warn-by-default; keep linker-info deny-by-default

Helps with #136096.

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 13, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@saethlin
Copy link
Member

@bors try

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Dec 13, 2025
try enabling `linker-messages` by default again
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link
Contributor

rust-bors bot commented Dec 13, 2025

☀️ Try build successful (CI)
Build commit: 58b1b3c (58b1b3c5342a414c161338871f8004258ccef2a7, parent: eb171a227f9e5de5d376b6edb56b174bc8235fb3)

@saethlin
Copy link
Member

@craterbot build-only

@craterbot
Copy link
Collaborator

🚨 Error: failed to parse the command

🆘 If you have any trouble with Crater please ask in t-infra on Zulip
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@saethlin
Copy link
Member

@craterbot run mode=build-only

@craterbot
Copy link
Collaborator

👌 Experiment pr-149937 created and queued.
🤖 Automatically detected try build 58b1b3c
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 13, 2025
@rustbot rustbot added the A-run-make Area: port run-make Makefiles to rmake.rs label Dec 13, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 14, 2025
don't use no_main and no_core to test IBT

The previous test was quite fragile and depended on a bunch of internal features. Simplify it.

Split out of rust-lang#149937.

cc `@jieyouxu` `@Oneirical`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 14, 2025
don't use no_main and no_core to test IBT

The previous test was quite fragile and depended on a bunch of internal features. Simplify it.

Split out of rust-lang#149937.

cc ``@jieyouxu`` ``@Oneirical``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 14, 2025
don't use no_main and no_core to test IBT

The previous test was quite fragile and depended on a bunch of internal features. Simplify it.

Split out of rust-lang#149937.

cc ```@jieyouxu``` ```@Oneirical```
rust-timer added a commit that referenced this pull request Dec 15, 2025
Rollup merge of #149969 - jyn514:ibt, r=jieyouxu

don't use no_main and no_core to test IBT

The previous test was quite fragile and depended on a bunch of internal features. Simplify it.

Split out of #149937.

cc ```@jieyouxu``` ```@Oneirical```
@bors
Copy link
Collaborator

bors commented Dec 15, 2025

☔ The latest upstream changes (presumably #149999) made this pull request unmergeable. Please resolve the merge conflicts.

github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Dec 18, 2025
don't use no_main and no_core to test IBT

The previous test was quite fragile and depended on a bunch of internal features. Simplify it.

Split out of rust-lang/rust#149937.

cc ```@jieyouxu``` ```@Oneirical```
@craterbot
Copy link
Collaborator

🚧 Experiment pr-149937 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-149937 is completed!
📊 24 regressed and 5 fixed (758860 total)
📊 2582 spurious results on the retry-regressed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-149937/retry-regressed-list.txt

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 18, 2026
@mati865
Copy link
Member

mati865 commented Feb 18, 2026

@bors try jobs=dist-x86_64-llvm-mingw

I have noticed recently that Clang doesn't handle -nolibc argument on Windows, so we will have to ignore the error for now (I'll implement the fix for the next version), or disable Clang's unused-command-line-argument warnings.

The error:

warning: linker stderr: x86_64-w64-mingw32-clang: argument unused during compilation: '-nolibc' [-Wunused-command-line-argument]
  |
  = note: `#[warn(linker_messages)]` on by default

warning: `std` (lib) generated 1 warning

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 18, 2026
try enabling `linker-messages` by default again


try-job: dist-x86_64-llvm-mingw
@rust-bors rust-bors bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 18, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 18, 2026

💔 Test for 75ce9fd failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 18, 2026
… r=petrochenkov

Do no add -no-pie on Windows

Windows binaries are always position independent and Clang warns when trying to enable or disable that:
```
❯ clang hello.c -pie
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]

❯ clang hello.c -no-pie
clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
```

rust-lang#149937 will turn these warnings into build errors:
```
❯ cargo rustc -- -D linker-messages
   Compiling hello v0.1.0 (E:\tmp\hello)
error: linker stderr: x86_64-w64-mingw32-clang: argument unused during compilation: '-nolibc' [-Wunused-command-line-argument]␍
       x86_64-w64-mingw32-clang: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]␍

  |
  = note: requested on the command line with `-D linker-messages`

error: could not compile `hello` (bin "hello") due to 1 previous error
```
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 18, 2026
… r=petrochenkov

Do no add -no-pie on Windows

Windows binaries are always position independent and Clang warns when trying to enable or disable that:
```
❯ clang hello.c -pie
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]

❯ clang hello.c -no-pie
clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
```

rust-lang#149937 will turn these warnings into build errors:
```
❯ cargo rustc -- -D linker-messages
   Compiling hello v0.1.0 (E:\tmp\hello)
error: linker stderr: x86_64-w64-mingw32-clang: argument unused during compilation: '-nolibc' [-Wunused-command-line-argument]␍
       x86_64-w64-mingw32-clang: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]␍

  |
  = note: requested on the command line with `-D linker-messages`

error: could not compile `hello` (bin "hello") due to 1 previous error
```
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 18, 2026
… r=petrochenkov

Do no add -no-pie on Windows

Windows binaries are always position independent and Clang warns when trying to enable or disable that:
```
❯ clang hello.c -pie
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]

❯ clang hello.c -no-pie
clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
```

rust-lang#149937 will turn these warnings into build errors:
```
❯ cargo rustc -- -D linker-messages
   Compiling hello v0.1.0 (E:\tmp\hello)
error: linker stderr: x86_64-w64-mingw32-clang: argument unused during compilation: '-nolibc' [-Wunused-command-line-argument]␍
       x86_64-w64-mingw32-clang: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]␍

  |
  = note: requested on the command line with `-D linker-messages`

error: could not compile `hello` (bin "hello") due to 1 previous error
```
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 18, 2026
… r=petrochenkov

Do no add -no-pie on Windows

Windows binaries are always position independent and Clang warns when trying to enable or disable that:
```
❯ clang hello.c -pie
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]

❯ clang hello.c -no-pie
clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
```

rust-lang#149937 will turn these warnings into build errors:
```
❯ cargo rustc -- -D linker-messages
   Compiling hello v0.1.0 (E:\tmp\hello)
error: linker stderr: x86_64-w64-mingw32-clang: argument unused during compilation: '-nolibc' [-Wunused-command-line-argument]␍
       x86_64-w64-mingw32-clang: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]␍

  |
  = note: requested on the command line with `-D linker-messages`

error: could not compile `hello` (bin "hello") due to 1 previous error
```
rust-timer added a commit that referenced this pull request Feb 19, 2026
Rollup merge of #152793 - mati865:disable-no-pie-on-windows, r=petrochenkov

Do no add -no-pie on Windows

Windows binaries are always position independent and Clang warns when trying to enable or disable that:
```
❯ clang hello.c -pie
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]

❯ clang hello.c -no-pie
clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
```

#149937 will turn these warnings into build errors:
```
❯ cargo rustc -- -D linker-messages
   Compiling hello v0.1.0 (E:\tmp\hello)
error: linker stderr: x86_64-w64-mingw32-clang: argument unused during compilation: '-nolibc' [-Wunused-command-line-argument]␍
       x86_64-w64-mingw32-clang: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]␍

  |
  = note: requested on the command line with `-D linker-messages`

error: could not compile `hello` (bin "hello") due to 1 previous error
```
jyn514 and others added 5 commits February 19, 2026 11:30
- Hide common linker output behind `linker-info`
- Add tests
- Account for different capitalization on windows-gnu when removing
  "warning" prefix
- Add some more comments
- Add macOS deployment-target test
- Ignore linker warnings from trying to statically link glibc

  I don't know what's going on in `nofile-limit.rs` but I want no part
  of it.

- Use a fake linker so tests are platform-independent
It's an incomplete feature anyway, it's ok for it to be broken.
@rustbot
Copy link
Collaborator

rustbot commented Feb 19, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@jyn514
Copy link
Member Author

jyn514 commented Feb 19, 2026

rebased this over #152793, the windows job should hopefully pass now.

@mati865
Copy link
Member

mati865 commented Feb 19, 2026

Perhaps I wasn't clear enough. There were two warnings with windows-gnullvm targets:

  1. x86_64-w64-mingw32-clang: argument unused during compilation: '-nolibc' which occurs every time when linking and requires Clang fix: [Clang] [MinGW] Handle -nolibc argument llvm/llvm-project#182062
  2. clang: warning: argument unused during compilation: '-no-pie' which used to occur when creating an executable and is solved by Do no add -no-pie on Windows #152793

Point 1. will still need to be handled until Clang's fix is generally available (may take years) or we change how rustc links mingw-w64 libs for windows-gnullvm.

github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Feb 22, 2026
…henkov

Do no add -no-pie on Windows

Windows binaries are always position independent and Clang warns when trying to enable or disable that:
```
❯ clang hello.c -pie
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]

❯ clang hello.c -no-pie
clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
```

rust-lang/rust#149937 will turn these warnings into build errors:
```
❯ cargo rustc -- -D linker-messages
   Compiling hello v0.1.0 (E:\tmp\hello)
error: linker stderr: x86_64-w64-mingw32-clang: argument unused during compilation: '-nolibc' [-Wunused-command-line-argument]␍
       x86_64-w64-mingw32-clang: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]␍

  |
  = note: requested on the command line with `-D linker-messages`

error: could not compile `hello` (bin "hello") due to 1 previous error
```
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 22, 2026

☔ The latest upstream changes (presumably #152965) made this pull request unmergeable. Please resolve the merge conflicts.

@jyn514
Copy link
Member Author

jyn514 commented Feb 23, 2026

I think it might make sense to merge all the changes except for the Allow -> Warn bump, so we can avoid merge conflicts.

@mati865
Copy link
Member

mati865 commented Feb 23, 2026

Yeah, sounds fine. Can't tell how many bugs are there yet to be uncovered,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs A-tidy Area: The tidy tool S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.