Skip to content

[AVR] Changed data_layout - #145241

Merged
bors merged 1 commit into
rust-lang:masterfrom
tomtor:avr-layout
Aug 13, 2025
Merged

[AVR] Changed data_layout#145241
bors merged 1 commit into
rust-lang:masterfrom
tomtor:avr-layout

Conversation

@tomtor

@tomtortomtor commented Aug 11, 2025

Copy link
Copy Markdown
Contributor

This change is required when

llvm/llvm-project@97f0ff0

gets included in the Rust llvm tree, because it changes the AVR data-layout

@rustbot

Copy link
Copy Markdown
Collaborator

r? @fee1-dead

rustbot has assigned @fee1-dead.
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

@rustbotrustbot 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 Aug 11, 2025
@rustbot

Copy link
Copy Markdown
Collaborator

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

@tomtor

Copy link
Copy Markdown
ContributorAuthor

@Patryk27 FYI

@rust-log-analyzer

This comment has been minimized.

@nikic

Copy link
Copy Markdown
Contributor

You need to adjust the datalayout in

if llvm_version < (20,0,0){
if sess.target.arch == "aarch64" || sess.target.arch.starts_with("arm64"){
// LLVM 20 defines three additional address spaces for alternate
// pointer kinds used in Windows.
// See https://github.com/llvm/llvm-project/pull/111879
target_data_layout =
target_data_layout.replace("-p270:32:32-p271:32:32-p272:64:64","");
}
if sess.target.arch.starts_with("sparc"){
// LLVM 20 updates the sparc layout to correctly align 128 bit integers to 128 bit.
// See https://github.com/llvm/llvm-project/pull/106951
target_data_layout = target_data_layout.replace("-i128:128","");
}
if sess.target.arch.starts_with("mips64"){
// LLVM 20 updates the mips64 layout to correctly align 128 bit integers to 128 bit.
// See https://github.com/llvm/llvm-project/pull/112084
target_data_layout = target_data_layout.replace("-i128:128","");
}
if sess.target.arch.starts_with("powerpc64"){
// LLVM 20 updates the powerpc64 layout to correctly align 128 bit integers to 128 bit.
// See https://github.com/llvm/llvm-project/pull/118004
target_data_layout = target_data_layout.replace("-i128:128","");
}
if sess.target.arch.starts_with("wasm32") || sess.target.arch.starts_with("wasm64"){
// LLVM 20 updates the wasm(32|64) layout to correctly align 128 bit integers to 128 bit.
// See https://github.com/llvm/llvm-project/pull/119204
target_data_layout = target_data_layout.replace("-i128:128","");
}
}
if llvm_version < (21,0,0){
if sess.target.arch == "nvptx64"{
// LLVM 21 updated the default layout on nvptx: https://github.com/llvm/llvm-project/pull/124961
target_data_layout = target_data_layout.replace("e-p6:32:32-i64","e-i64");
}
if sess.target.arch == "amdgpu"{
// LLVM 21 adds the address width for address space 8.
// See https://github.com/llvm/llvm-project/pull/139419
target_data_layout = target_data_layout.replace("p8:128:128:128:48","p8:128:128")
}
}
for old LLVM versions.

@tomtor

Copy link
Copy Markdown
ContributorAuthor

@nikic Would the version with the matching LLVM be 21.2.0, because it missed 21.1 from aug 1th ?

@rustbotrustbot added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Aug 11, 2025
@nikic

Copy link
Copy Markdown
Contributor

@nikic Would the version with the matching LLVM be 21.2.0, because it missed 21.1 from aug 1th ?

The version should be 22.0.0.

@nikic

Copy link
Copy Markdown
Contributor

Blocked on llvm/llvm-project#153010.

@fee1-dead

Copy link
Copy Markdown
Member

r? nikic

@rustbotrustbot assigned nikic and unassigned fee1-deadAug 11, 2025

@nikicnikic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, can you please squash the commits?

@nikic

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Aug 13, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 2563e4a has been approved by nikic

It is now in the queue for this repository.

@borsbors 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 Aug 13, 2025
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 13, 2025
[AVR] Changed data_layout
This change is required when
llvm/llvm-project@97f0ff0
gets included in the Rust llvm tree, because it changes the AVR data-layout
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 13, 2025
[AVR] Changed data_layout
This change is required when
llvm/llvm-project@97f0ff0
gets included in the Rust llvm tree, because it changes the AVR data-layout
This was referenced Aug 13, 2025
bors added a commit that referenced this pull request Aug 13, 2025
Rollup of 9 pull requests
Successful merges:
- #144761 (aarch64: Make `outline-atomics` a known target feature)
- #144949 (More `Printer` cleanups)
- #144955 (search graph: lazily update parent goals)
- #144962 (Add aarch64_be-unknown-none-softfloat target)
- #145153 (Handle macros with multiple kinds, and improve errors)
- #145241 ([AVR] Changed data_layout)
- #145341 (Install libgccjit into the compiler's sysroot when cg_gcc is enabled)
- #145349 (Correctly handle when there are no unstable items in the documented crate)
- #145356 (Add another example for escaped `#` character in doctest in rustdoc book)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit a6146fd into rust-lang:masterAug 13, 2025
10 checks passed
@rustbotrustbot added this to the 1.91.0 milestone Aug 13, 2025
rust-timer added a commit that referenced this pull request Aug 13, 2025
Rollup merge of #145241 - tomtor:avr-layout, r=nikic
[AVR] Changed data_layout
This change is required when
llvm/llvm-project@97f0ff0
gets included in the Rust llvm tree, because it changes the AVR data-layout
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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

@tomtor@rustbot@rust-log-analyzer@nikic@fee1-dead@bors