Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mips64 data layout to match LLVM 20 change #132741

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

zmodem
Copy link
Contributor

@zmodem zmodem commented Nov 7, 2024

LLVM changed the data layout in llvm/llvm-project#112084

@rustbot
Copy link
Collaborator

rustbot commented Nov 7, 2024

r? @Nadrieril

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

@zmodem
Copy link
Contributor Author

zmodem commented Nov 7, 2024

@rustbot label llvm-main

@rustbot
Copy link
Collaborator

rustbot commented Nov 7, 2024

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. llvm-main Marks PRs that are making Rust work with LLVM main (this label is consumed by CI tooling) labels Nov 7, 2024
@zmodem
Copy link
Contributor Author

zmodem commented Nov 7, 2024

r? @nikic

@rustbot rustbot assigned nikic and unassigned Nadrieril Nov 7, 2024
@zmodem
Copy link
Contributor Author

zmodem commented Nov 7, 2024

Is there some way to make this conditional on the LLVM version, or how are these kind of changes normally handled?

@beetrees
Copy link
Contributor

beetrees commented Nov 7, 2024

You want to add an adjustment here in compiler/rustc_codegen_llvm/src/context.rs, see #132422 for an example of the same change for SPARC.

@rust-log-analyzer

This comment has been minimized.

@zmodem
Copy link
Contributor Author

zmodem commented Nov 7, 2024

You want to add an adjustment here in compiler/rustc_codegen_llvm/src/context.rs, see #132422 for an example of the same change for SPARC.

Perfect, thanks!

@nikic
Copy link
Contributor

nikic commented Nov 7, 2024

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 7, 2024

📌 Commit eb7d95b has been approved by nikic

It is now in the queue for this repository.

@bors bors 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 Nov 7, 2024
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Nov 8, 2024
Update mips64 data layout to match LLVM 20 change

LLVM changed the data layout in llvm/llvm-project#112084
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 8, 2024
…kingjubilee

Rollup of 10 pull requests

Successful merges:

 - rust-lang#130586 (Set "symbol name" in raw-dylib import libraries to the decorated name)
 - rust-lang#131913 (Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support)
 - rust-lang#132095 (Fix rust-lang#131977 parens mangled in shared mut static lint suggestion)
 - rust-lang#132131 ([StableMIR] API to retrieve definitions from crates)
 - rust-lang#132639 (core: move intrinsics.rs into intrinsics folder)
 - rust-lang#132696 (Compile `test_num_f128` conditionally on `reliable_f128_math` config)
 - rust-lang#132737 (bootstrap: Print better message if lock pid isn't available)
 - rust-lang#132739 (Fix `librustdoc/scrape_examples.rs` formatting)
 - rust-lang#132740 (Update test for LLVM 20's new vector splat syntax)
 - rust-lang#132741 (Update mips64 data layout to match LLVM 20 change)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 97dbab9 into rust-lang:master Nov 8, 2024
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 8, 2024
Rollup merge of rust-lang#132741 - zmodem:mips_data_layout, r=nikic

Update mips64 data layout to match LLVM 20 change

LLVM changed the data layout in llvm/llvm-project#112084
@rustbot rustbot added this to the 1.84.0 milestone Nov 8, 2024
@workingjubilee workingjubilee added A-target-specs Area: Compile-target specifications O-MIPS Target: MIPS processors labels Nov 8, 2024
mati865 pushed a commit to mati865/rust that referenced this pull request Nov 12, 2024
Update mips64 data layout to match LLVM 20 change

LLVM changed the data layout in llvm/llvm-project#112084
mati865 pushed a commit to mati865/rust that referenced this pull request Nov 12, 2024
…kingjubilee

Rollup of 10 pull requests

Successful merges:

 - rust-lang#130586 (Set "symbol name" in raw-dylib import libraries to the decorated name)
 - rust-lang#131913 (Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support)
 - rust-lang#132095 (Fix rust-lang#131977 parens mangled in shared mut static lint suggestion)
 - rust-lang#132131 ([StableMIR] API to retrieve definitions from crates)
 - rust-lang#132639 (core: move intrinsics.rs into intrinsics folder)
 - rust-lang#132696 (Compile `test_num_f128` conditionally on `reliable_f128_math` config)
 - rust-lang#132737 (bootstrap: Print better message if lock pid isn't available)
 - rust-lang#132739 (Fix `librustdoc/scrape_examples.rs` formatting)
 - rust-lang#132740 (Update test for LLVM 20's new vector splat syntax)
 - rust-lang#132741 (Update mips64 data layout to match LLVM 20 change)

r? `@ghost`
`@rustbot` modify labels: rollup
tgross35 added a commit to tgross35/rust that referenced this pull request Feb 20, 2025
Rust's 128-bit integers have historically been incompatible with C [1].
However, there have been a number of changes in Rust and LLVM that
mean this is no longer the case:

* Incorrect alignment of `i128` on x86 [1]: adjusting Rust's alignment
  proposed at rust-lang/compiler-team#683,
  implemented at rust-lang#116672.
* LLVM version of the above: resolved in LLVM, including ABI fix.
  Present in LLVM18 (our minimum supported version).
* Incorrect alignment of `i128` on 64-bit PowerPC, SPARC, and MIPS [2]:
  Rust's data layouts adjusted at
  rust-lang#132422,
  rust-lang#132741,
  rust-lang#134115.
* LLVM version of the above: done in LLVM 20
  llvm/llvm-project#102783.
* Incorrect return convention of `i128` on Windows: adjusted to match
  GCC and Clang at rust-lang#134290.

At [3], the lang team considered it acceptable to remove `i128` from
`improper_ctypes_definitions` if the LLVM version is known to be
compatible. Time has elapsed since then and we have dropped support for
LLVM versions that do not have the x86 fixes, meaning a per-llvm-version
lint should no longer be necessary. The PowerPC, SPARC, and MIPS changes
only came in LLVM 20 but since Rust's datalayouts have also been updated
to match, we will be using the correct alignment regardless of LLVM
version.

Closes: rust-lang#134288
Closes: rust-lang#128950

[1]: rust-lang#54341
[2]: rust-lang#128950
[3]: rust-lang/lang-team#255 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-target-specs Area: Compile-target specifications llvm-main Marks PRs that are making Rust work with LLVM main (this label is consumed by CI tooling) O-MIPS Target: MIPS processors 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.

8 participants