Skip to content

relax_elf_relocations is x86-only - #163951

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:relax_elf_relocations
Oct 8, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:relax_elf_relocations

Conversation

@RalfJung

@RalfJung RalfJung commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

The flag ends up here

Options.MCOptions.X86RelaxRelocations = RelaxELFRelocations;

The LLVM name for this, X86RelaxRelocations, makes me believe that this is x86-only. So let's at least document that on our side as well.

Cc @bjorn3 @nikic

@rustbot

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

rustbot commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

r? @davidtwco

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

// Only becomes a problem for binaries with thousands of dependencies.
code_model: Some(CodeModel::Small),
// Prevents LLVM from emitting modern linker relaxation relocations.
relax_elf_relocations: false,

@RalfJung RalfJung Oct 7, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

false is the default so setting this here is doubly unnecessary -- it is the default and it's x86-only.

View changes since the review

@RalfJung
RalfJung force-pushed the relax_elf_relocations branch from 2d72a84 to b247d59 Compare October 7, 2026 15:47
@rustbot rustbot added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Oct 7, 2026
Comment thread compiler/rustc_target/src/spec/mod.rs Outdated
@RalfJung
RalfJung force-pushed the relax_elf_relocations branch from b247d59 to 6396944 Compare October 7, 2026 15:59
@wesleywiser

Copy link
Copy Markdown
Member

Makes sense!

@bors r+ rollup

@rust-bors

rust-bors Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 6396944 has been tentatively approved by wesleywiser

It will be put into the queue for this repository once PR CI succeeds.

@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 7, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Oct 8, 2026
…wesleywiser

relax_elf_relocations is x86-only

The flag ends up here

https://github.com/rust-lang/rust/blob/8d1a76430406c877b35d0b627e7f796dcf0dfeca/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp#L393

The LLVM name for this, `X86RelaxRelocations`, makes me believe that this is x86-only. So let's at least document that on our side as well.

Cc @bjorn3  @nikic
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 8, 2026
…wesleywiser

relax_elf_relocations is x86-only

The flag ends up here

https://github.com/rust-lang/rust/blob/8d1a76430406c877b35d0b627e7f796dcf0dfeca/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp#L393

The LLVM name for this, `X86RelaxRelocations`, makes me believe that this is x86-only. So let's at least document that on our side as well.

Cc @bjorn3  @nikic
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 8, 2026
…wesleywiser

relax_elf_relocations is x86-only

The flag ends up here

https://github.com/rust-lang/rust/blob/8d1a76430406c877b35d0b627e7f796dcf0dfeca/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp#L393

The LLVM name for this, `X86RelaxRelocations`, makes me believe that this is x86-only. So let's at least document that on our side as well.

Cc @bjorn3  @nikic
rust-bors Bot pushed a commit that referenced this pull request Oct 8, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #162741 (codegen: tell LLVM that the discriminant is a power of two)
 - #162758 (Split PassMode::IndirectUnsized out of PassMode::Indirect)
 - #163931 (Move `loop_hint_attrs` from `Terminator` into `TerminatorKind::Goto`)
 - #163028 (autodiff: fix sysroot candidates in libEnzyme not found error)
 - #163538 (Add `rustc::missing_generic_type_visitable` lint)
 - #163841 ([rustdoc] Fix more `incoherent_impl` linking)
 - #163908 (Update Enzyme submodule)
 - #163935 (Use BasicBlock::start_location and Location::START)
 - #163949 (disable next-solver with higher-ranked-assumptions)
 - #163951 (relax_elf_relocations is x86-only)
rust-bors Bot pushed a commit that referenced this pull request Oct 8, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #162741 (codegen: tell LLVM that the discriminant is a power of two)
 - #162758 (Split PassMode::IndirectUnsized out of PassMode::Indirect)
 - #163931 (Move `loop_hint_attrs` from `Terminator` into `TerminatorKind::Goto`)
 - #163028 (autodiff: fix sysroot candidates in libEnzyme not found error)
 - #163257 (abby DSL: sanity checks on forall where clauses)
 - #163841 ([rustdoc] Fix more `incoherent_impl` linking)
 - #163908 (Update Enzyme submodule)
 - #163935 (Use BasicBlock::start_location and Location::START)
 - #163949 (disable next-solver with higher-ranked-assumptions)
 - #163951 (relax_elf_relocations is x86-only)
 - #163968 (Remove needs-triage label from relnotes issues)
@rust-bors
rust-bors Bot merged commit 407fe75 into rust-lang:main Oct 8, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 8, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 8, 2026
Rollup merge of #163951 - RalfJung:relax_elf_relocations, r=wesleywiser

relax_elf_relocations is x86-only

The flag ends up here

https://github.com/rust-lang/rust/blob/8d1a76430406c877b35d0b627e7f796dcf0dfeca/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp#L393

The LLVM name for this, `X86RelaxRelocations`, makes me believe that this is x86-only. So let's at least document that on our side as well.

Cc @bjorn3  @nikic
makai410 pushed a commit to makai410/rustc_public that referenced this pull request Oct 9, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#162741 (codegen: tell LLVM that the discriminant is a power of two)
 - rust-lang/rust#162758 (Split PassMode::IndirectUnsized out of PassMode::Indirect)
 - rust-lang/rust#163931 (Move `loop_hint_attrs` from `Terminator` into `TerminatorKind::Goto`)
 - rust-lang/rust#163028 (autodiff: fix sysroot candidates in libEnzyme not found error)
 - rust-lang/rust#163257 (abby DSL: sanity checks on forall where clauses)
 - rust-lang/rust#163841 ([rustdoc] Fix more `incoherent_impl` linking)
 - rust-lang/rust#163908 (Update Enzyme submodule)
 - rust-lang/rust#163935 (Use BasicBlock::start_location and Location::START)
 - rust-lang/rust#163949 (disable next-solver with higher-ranked-assumptions)
 - rust-lang/rust#163951 (relax_elf_relocations is x86-only)
 - rust-lang/rust#163968 (Remove needs-triage label from relnotes issues)
@RalfJung
RalfJung deleted the relax_elf_relocations branch October 10, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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.

5 participants