about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-10-16 12:14:19 +0000
committerbors <bors@rust-lang.org>2024-10-16 12:14:19 +0000
commit0037048da8ed19feef7ee1437f123a88a7342b33 (patch)
tree9fd7bbde8810dca534b21abc753438f4ba9bbb71 /compiler/rustc_codegen_llvm/src
parentd829780c4e4ef11f5e09c1c5ed9684c12aad7236 (diff)
parente0e1e35a48202e5d73151cfb7bc4208adfce0856 (diff)
downloadrust-0037048da8ed19feef7ee1437f123a88a7342b33.tar.gz
rust-0037048da8ed19feef7ee1437f123a88a7342b33.zip
Auto merge of #131775 - Urgau:rollup-yc4a3sf, r=Urgau
Rollup of 10 pull requests

Successful merges:

 - #131582 (Add wasm32-unknown-emscripten platform support document)
 - #131694 (Make fuchsia-test-runner.py compatible with new JSON output from llvm-readelf)
 - #131700 (Fix match_same_arms in stable_mir)
 - #131712 (Mark the unstable LazyCell::into_inner const)
 - #131746 (Relax a memory order in `once_box`)
 - #131754 (Don't report bivariance error when nesting a struct with field errors into another struct)
 - #131760 (llvm: Match aarch64 data layout to new LLVM layout)
 - #131764 (Fix unnecessary nesting in run-make test output directories)
 - #131766 (Add mailmap entry for my dev-desktop setup)
 - #131771 (Handle gracefully true/false in `cfg(target(..))` compact)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/context.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs
index c836dd5473f..2f830d6f941 100644
--- a/compiler/rustc_codegen_llvm/src/context.rs
+++ b/compiler/rustc_codegen_llvm/src/context.rs
@@ -138,6 +138,16 @@ pub(crate) unsafe fn create_module<'ll>(
         }
     }
 
+    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", "");
+        }
+    }
+
     // Ensure the data-layout values hardcoded remain the defaults.
     {
         let tm = crate::back::write::create_informational_target_machine(tcx.sess, false);