Skip to content

Add a fallback for -static-pie missing CRT objects - #164451

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
cuviper:static-pie-fallback
Oct 19, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
cuviper:static-pie-fallback

Conversation

@cuviper

@cuviper cuviper commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

We already have a fallback when the linker doesn't support -static-pie
to use plain -static instead. However, it is also possible that the
linker understands that option, but the C library doesn't have the
necessary CRT objects. For example, gcc has known this option for a
long time, but glibc doesn't support it for powerpc targets at all.
We can detect this case in the link output for -static fallback too.

Fixes #164448

@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 Oct 17, 2026
@rustbot

rustbot commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

r? @camelid

rustbot has assigned @camelid.
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 77 candidates
  • Random selection from 20 candidates

@rustbot

This comment has been minimized.

We already have a fallback when the linker doesn't support `-static-pie`
to use plain `-static` instead. However, it is also possible that the
linker understands that option, but the C library doesn't have the
necessary CRT objects. For example, `gcc` has known this option for a
long time, but `glibc` doesn't support it for `powerpc` targets at all.
We can detect this case in the link output for `-static` fallback too.
@cuviper
cuviper force-pushed the static-pie-fallback branch from 8cac682 to 4332bd9 Compare October 17, 2026 01:32
@cuviper cuviper added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Oct 17, 2026
@wesleywiser

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-bors Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 4332bd9 has been approved by wesleywiser

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 5. This pull request will be tested once the tree is reopened.

Reason for tree closure: GitHub outage

@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 Oct 19, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 19, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #163436 (Stabilize `-Zembed-metadata`)
 - #164586 (Miri can now handle the actual apple thread parking implementation)
 - #164451 (Add a fallback for `-static-pie` missing CRT objects)
 - #164539 (Remove `rest` in `LintCheck`)
 - #164576 (linux thread_atexit: fix use of __dso_handle)
 - #164587 (tests: drop trailing comma on a couple of checks)
@rust-bors
rust-bors Bot merged commit 3ca07d7 into rust-lang:main Oct 19, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 19, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 19, 2026
Rollup merge of #164451 - cuviper:static-pie-fallback, r=wesleywiser

Add a fallback for `-static-pie` missing CRT objects

We already have a fallback when the linker doesn't support `-static-pie`
to use plain `-static` instead. However, it is also possible that the
linker understands that option, but the C library doesn't have the
necessary CRT objects. For example, `gcc` has known this option for a
long time, but `glibc` doesn't support it for `powerpc` targets at all.
We can detect this case in the link output for `-static` fallback too.

Fixes #164448
@rustbot

rustbot commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

beta backport approved as per compiler team on Zulip. A backport PR will be authored by the release team at the end of the current development cycle. Backport labels are handled by them.

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta-accepted Accepted for backporting to the compiler in the beta channel. beta-nominated Nominated for backporting to the compiler in the beta channel. 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.

PPC64LE fails to link rcrt1.o in static builds

4 participants