Skip to content

Comments

Do no add -no-pie on Windows#152793

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
mati865:disable-no-pie-on-windows
Feb 19, 2026
Merged

Do no add -no-pie on Windows#152793
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
mati865:disable-no-pie-on-windows

Conversation

@mati865
Copy link
Member

@mati865 mati865 commented Feb 18, 2026

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

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]
```
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 18, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 18, 2026

r? @petrochenkov

rustbot has assigned @petrochenkov.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: codegen, compiler
  • codegen, compiler expanded to 68 candidates
  • Random selection from 13 candidates

@petrochenkov
Copy link
Contributor

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 18, 2026

📌 Commit 92e60a3 has been approved by petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 18, 2026
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-bors bot pushed a commit that referenced this pull request Feb 18, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #152799 (Subtree sync for rustc_codegen_cranelift)
 - #152569 (Stop using rustc_layout_scalar_valid_range_* in rustc)
 - #151059 (x86: support passing `u128`/`i128` to inline assembly)
 - #152097 (Suggest local variables for captured format args)
 - #152734 (Respect the `--ci` flag in more places in bootstrap)
 - #151703 (Fix ICE in transmutability error reporting when type aliases are normalized)
 - #152173 (Reflection TypeKind::FnPtr)
 - #152564 (Remove unnecessary closure.)
 - #152628 (tests: rustc_public: Check const allocation for all variables (1 of 11 was missing))
 - #152658 (compiletest: normalize stderr before SVG rendering)
 - #152766 (std::r#try! - avoid link to nightly docs)
 - #152780 (Remove some clones in deriving)
 - #152787 (Add a mir-opt test for alignment check generation [zero changes outside tests])
 - #152790 (Fix incorrect target in aarch64-unknown-linux-gnu docs)
 - #152792 (Fix an ICE while checking param env shadowing on an erroneous trait impl)
 - #152793 (Do no add -no-pie on Windows)
 - #152803 (Avoid delayed-bug ICE for malformed diagnostic attrs)
 - #152806 (interpret: fix comment typo)
rust-bors bot pushed a commit that referenced this pull request Feb 19, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #152799 (Subtree sync for rustc_codegen_cranelift)
 - #152814 (stdarch subtree update)
 - #151059 (x86: support passing `u128`/`i128` to inline assembly)
 - #152097 (Suggest local variables for captured format args)
 - #152734 (Respect the `--ci` flag in more places in bootstrap)
 - #151703 (Fix ICE in transmutability error reporting when type aliases are normalized)
 - #152173 (Reflection TypeKind::FnPtr)
 - #152564 (Remove unnecessary closure.)
 - #152628 (tests: rustc_public: Check const allocation for all variables (1 of 11 was missing))
 - #152658 (compiletest: normalize stderr before SVG rendering)
 - #152766 (std::r#try! - avoid link to nightly docs)
 - #152780 (Remove some clones in deriving)
 - #152787 (Add a mir-opt test for alignment check generation [zero changes outside tests])
 - #152790 (Fix incorrect target in aarch64-unknown-linux-gnu docs)
 - #152792 (Fix an ICE while checking param env shadowing on an erroneous trait impl)
 - #152793 (Do no add -no-pie on Windows)
 - #152803 (Avoid delayed-bug ICE for malformed diagnostic attrs)
 - #152806 (interpret: fix comment typo)
rust-bors bot pushed a commit that referenced this pull request Feb 19, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #152799 (Subtree sync for rustc_codegen_cranelift)
 - #152814 (stdarch subtree update)
 - #151059 (x86: support passing `u128`/`i128` to inline assembly)
 - #152097 (Suggest local variables for captured format args)
 - #152734 (Respect the `--ci` flag in more places in bootstrap)
 - #151703 (Fix ICE in transmutability error reporting when type aliases are normalized)
 - #152173 (Reflection TypeKind::FnPtr)
 - #152564 (Remove unnecessary closure.)
 - #152628 (tests: rustc_public: Check const allocation for all variables (1 of 11 was missing))
 - #152658 (compiletest: normalize stderr before SVG rendering)
 - #152766 (std::r#try! - avoid link to nightly docs)
 - #152780 (Remove some clones in deriving)
 - #152787 (Add a mir-opt test for alignment check generation [zero changes outside tests])
 - #152790 (Fix incorrect target in aarch64-unknown-linux-gnu docs)
 - #152792 (Fix an ICE while checking param env shadowing on an erroneous trait impl)
 - #152793 (Do no add -no-pie on Windows)
 - #152803 (Avoid delayed-bug ICE for malformed diagnostic attrs)
 - #152806 (interpret: fix comment typo)
@rust-bors rust-bors bot merged commit a1e029b into rust-lang:main Feb 19, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 19, 2026
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
```
@mati865 mati865 deleted the disable-no-pie-on-windows branch February 19, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

3 participants