Skip to content

Enable static_position_independent_executables on all gnu and musl targets#158510

Open
Amanieu wants to merge 1 commit into
rust-lang:mainfrom
Amanieu:static-pie-gnu
Open

Enable static_position_independent_executables on all gnu and musl targets#158510
Amanieu wants to merge 1 commit into
rust-lang:mainfrom
Amanieu:static-pie-gnu

Conversation

@Amanieu

@Amanieu Amanieu commented Jun 28, 2026

Copy link
Copy Markdown
Member

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.

@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

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.
@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.
@scottmcm

Copy link
Copy Markdown
Member

In case this was the cause of #159037 (comment)

@bors try jobs=dist-i586-gnu-i586-i686-musl

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 10, 2026
Enable `static_position_independent_executables` on all gnu and musl targets


try-job: dist-i586-gnu-i586-i686-musl
@jhpratt

jhpratt commented Jul 10, 2026

Copy link
Copy Markdown
Member

@bors r- while that's figured out

@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 Jul 10, 2026
@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:

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-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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants