Skip to content

Enable static_position_independent_executables on all gnu targets - #158510

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Amanieu:static-pie-gnu
Aug 14, 2026
Merged

Enable static_position_independent_executables on all gnu targets#158510
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Amanieu:static-pie-gnu

Conversation

@Amanieu

@Amanieu Amanieu commented Jun 28, 2026

Copy link
Copy Markdown
Member

View all comments

Glibc has supported static PIE for a while, so there's no reason to ever build a non-PIE executable with a modern toolchain.

@rustbot

rustbot commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

These commits modify compiler targets.
(See the Target Tier Policy.)

@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 Jun 28, 2026
@rustbot

rustbot commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

r? @adwinwhite

rustbot has assigned @adwinwhite.
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: compiler
  • compiler expanded to 73 candidates
  • Random selection from 18 candidates

@adwinwhite

Copy link
Copy Markdown
Contributor

probably r? codegen

@rustbot rustbot assigned saethlin and unassigned adwinwhite Jun 29, 2026
@saethlin saethlin changed the title Enable static_position_executables on all gnu and musl targets Enable static_position_independent_executables on all gnu and musl targets Jul 8, 2026
@saethlin saethlin added the relnotes Marks issues that should be documented in the release notes of the next release. label Jul 9, 2026
@saethlin

saethlin commented Jul 9, 2026

Copy link
Copy Markdown
Member

I think we should do this, but I suspect this will be disruptive for some uncommon use cases.

@bors r+ rollup=iffy (anything that touches linkage might perturb a more obscure target)

@rust-bors

rust-bors Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 9e4b398 has been approved by saethlin

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 Jul 9, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 9, 2026
Enable `static_position_independent_executables` on all gnu and musl targets

Both musl and glibc have supported static PIE for a while, so there's no reason to ever build a non-PIE executable with a modern toolchain.
rust-bors Bot pushed a commit that referenced this pull request Jul 9, 2026
…uwer

Rollup of 17 pull requests

Successful merges:

 - #158510 (Enable `static_position_independent_executables` on all gnu and musl targets)
 - #158541 (Move `std::io::Write` to `core::io`)
 - #158899 (Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED`)
 - #155429 (Support `u128`/`i128` c-variadic arguments)
 - #156370 (Reject linked dylib EII default overrides)
 - #157153 (allow `Allocator`s to be used as `#[global_allocator]`s)
 - #158535 (Support `#[track_caller]` on EII declarations)
 - #158617 (allow mGCA const arguments to fall back to anon consts)
 - #158645 (Fix splat ICEs and ban it in closures)
 - #158988 (Redo `TokenStreamIter`)
 - #158347 (Improve generic parameters handling for #[diagnostic::on_const])
 - #158722 (delegation: do not always inherit `ConstArgHasType` predicates)
 - #158739 (view-types: HIR lowering)
 - #158883 (tests: fix enum-match.rs to handle LLVM 23)
 - #158886 (Add documentation for the `no_std` attribute)
 - #158951 (Merge three `MaxUniverse`s into one)
 - #158961 (Reapply "LLVM 23: Run AssignGUIDPass in some places")
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 9, 2026
Enable `static_position_independent_executables` on all gnu and musl targets

Both musl and glibc have supported static PIE for a while, so there's no reason to ever build a non-PIE executable with a modern toolchain.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 9, 2026
Enable `static_position_independent_executables` on all gnu and musl targets

Both musl and glibc have supported static PIE for a while, so there's no reason to ever build a non-PIE executable with a modern toolchain.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 9, 2026
Enable `static_position_independent_executables` on all gnu and musl targets

Both musl and glibc have supported static PIE for a while, so there's no reason to ever build a non-PIE executable with a modern toolchain.
rust-bors Bot pushed a commit that referenced this pull request Jul 9, 2026
…uwer

Rollup of 21 pull requests

Successful merges:

 - #150946 (intrinsics: Add a fallback for non-const libm float functions)
 - #158510 (Enable `static_position_independent_executables` on all gnu and musl targets)
 - #158541 (Move `std::io::Write` to `core::io`)
 - #158899 (Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED`)
 - #155429 (Support `u128`/`i128` c-variadic arguments)
 - #156370 (Reject linked dylib EII default overrides)
 - #156508 (Infer all anonymous lifetimes in assoc consts as `'static`)
 - #158617 (allow mGCA const arguments to fall back to anon consts)
 - #158645 (Fix splat ICEs and ban it in closures)
 - #158859 (Improve `-Zls` diagnostic message on `.rs` files)
 - #158988 (Redo `TokenStreamIter`)
 - #158347 (Improve generic parameters handling for #[diagnostic::on_const])
 - #158722 (delegation: do not always inherit `ConstArgHasType` predicates)
 - #158739 (view-types: HIR lowering)
 - #158883 (tests: fix enum-match.rs to handle LLVM 23)
 - #158886 (Add documentation for the `no_std` attribute)
 - #158940 (Implement feature `char_to_u32`)
 - #158951 (Merge three `MaxUniverse`s into one)
 - #158961 (Reapply "LLVM 23: Run AssignGUIDPass in some places")
 - #158996 ([compiler] Implement `PartialOrd` via `Ord` for `Span` and newtype_indexes)
 - #159005 (Use `as_lang_item` instead of repeatedly matching)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 9, 2026
Enable `static_position_independent_executables` on all gnu and musl targets

Both musl and glibc have supported static PIE for a while, so there's no reason to ever build a non-PIE executable with a modern toolchain.
rust-bors Bot pushed a commit that referenced this pull request Jul 9, 2026
…uwer

Rollup of 24 pull requests

Successful merges:

 - #150946 (intrinsics: Add a fallback for non-const libm float functions)
 - #158510 (Enable `static_position_independent_executables` on all gnu and musl targets)
 - #158541 (Move `std::io::Write` to `core::io`)
 - #158899 (Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED`)
 - #156027 (Consider captured regions for opaque type region liveness.)
 - #156370 (Reject linked dylib EII default overrides)
 - #156508 (Infer all anonymous lifetimes in assoc consts as `'static`)
 - #157561 (rustdoc: do not include extra stuff in span)
 - #158617 (allow mGCA const arguments to fall back to anon consts)
 - #158645 (Fix splat ICEs and ban it in closures)
 - #158859 (Improve `-Zls` diagnostic message on `.rs` files)
 - #158988 (Redo `TokenStreamIter`)
 - #158347 (Improve generic parameters handling for #[diagnostic::on_const])
 - #158384 (Allow BackwardIncompatibleDropHint in polonius legacy)
 - #158722 (delegation: do not always inherit `ConstArgHasType` predicates)
 - #158739 (view-types: HIR lowering)
 - #158877 (borrowck: Keep returned `path` from `best_blame_constraint()` consistent)
 - #158883 (tests: fix enum-match.rs to handle LLVM 23)
 - #158886 (Add documentation for the `no_std` attribute)
 - #158940 (Implement feature `char_to_u32`)
 - #158951 (Merge three `MaxUniverse`s into one)
 - #158961 (Reapply "LLVM 23: Run AssignGUIDPass in some places")
 - #158995 (Use REST API in linkchecker script)
 - #158996 ([compiler] Implement `PartialOrd` via `Ord` for `Span` and newtype_indexes)
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 9, 2026
Enable `static_position_independent_executables` on all gnu and musl targets

Both musl and glibc have supported static PIE for a while, so there's no reason to ever build a non-PIE executable with a modern toolchain.
@rust-bors

rust-bors Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#159045), which was unapproved.

View changes since this unapproval

@rust-bors

rust-bors Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 55b704f failed: CI. Failed job:

@rustbot

rustbot commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

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.

@Amanieu

Amanieu commented Aug 2, 2026

Copy link
Copy Markdown
Member Author

It seems that the musl-gcc wrapper script doesn't actually support -static-pie and that this only worked because some musl targets build a full gcc cross-toolchain and use the gcc binary directly as the linker. I removed all the changes to musl targets so this only applies to gnu targets now.

@Amanieu Amanieu changed the title Enable static_position_independent_executables on all gnu and musl targets Enable static_position_independent_executables on all gnu targets Aug 2, 2026
@saethlin

Copy link
Copy Markdown
Member

@bors r+ rollup=iffy

@rust-bors

rust-bors Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2566b8f has been approved by saethlin

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 14, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 14, 2026
Enable `static_position_independent_executables` on all gnu targets

Glibc has supported static PIE for a while, so there's no reason to ever build a non-PIE executable with a modern toolchain.
@JonathanBrouwer

Copy link
Copy Markdown
Contributor

💔 I suspect this PR failed tests as part of a rollup
@bors r-

After fixing the problem, consider running a try job for the failed job before re-approving.

Link to failure: #161089 (comment)

@bors try jobs=test-various

@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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 14, 2026
@rust-bors

rust-bors Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#161089), which was unapproved.

View changes since this unapproval

rust-bors Bot pushed a commit that referenced this pull request Aug 14, 2026
Enable `static_position_independent_executables` on all gnu targets


try-job: test-various
@rust-bors

This comment has been minimized.

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

This was not the problematic pr, sorry
@bors r=saethlin

@rust-bors

rust-bors Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2566b8f has been approved by saethlin

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 14, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 14, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #158510 (Enable `static_position_independent_executables` on all gnu targets)
 - #160441 (PowerPC inline ASM: Fix scalar floats being in the wrong vector lane on little endian)
 - #160760 (Miri: give the incremental session a chance to finish)
 - #160892 (Inline some hot new-solver functions)
 - #160821 (Updates the expect messages in library/std/src/net/udp.rs to follow the style guide)
 - #160997 (Add an AGENTS.md that enforces the LLM policy)
 - #161057 (Silence unecessary errors on `Vec<foo::Bar>` to `Vec<foo:Bar>` typo)
 - #161079 (bootstrap: Clean up imports related to `define_config!` and `check_ci_llvm!`)
 - #161080 (propagate `RerunNonErased` in `projection_may_match`)
 - #161085 (bootstrap: Restrict the normalization of relative paths)
 - #161086 (add crashtests [3/N])
@rust-bors

rust-bors Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 82d14e8 (82d14e813e49c9baf4dc763547e922199f67cd03)
Base parent: 059bf4a (059bf4a660ddea5bd8302ecdd4f7e40dd7a04313)

@rust-bors
rust-bors Bot merged commit a0f0d29 into rust-lang:main Aug 14, 2026
14 checks passed
rust-bors Bot pushed a commit that referenced this pull request Aug 14, 2026
Rollup merge of #158510 - Amanieu:static-pie-gnu, r=saethlin

Enable `static_position_independent_executables` on all gnu targets

Glibc has supported static PIE for a while, so there's no reason to ever build a non-PIE executable with a modern toolchain.
rust-timer added a commit that referenced this pull request Aug 14, 2026
Rollup merge of #158510 - Amanieu:static-pie-gnu, r=saethlin

Enable `static_position_independent_executables` on all gnu targets

Glibc has supported static PIE for a while, so there's no reason to ever build a non-PIE executable with a modern toolchain.
@rustbot rustbot added this to the 1.99.0 milestone Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

relnotes Marks issues that should be documented in the release notes of the next release. 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.

7 participants